Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.


Deploy on Kubernetes with Tanka

To deploy Grafana Enterprise Metrics to Kubernetes using a Jsonnet library and Grafana Tanka, you can use MinIO to provide object storage. It is best to leverage your cloud provider’s object storage service to avoid the operational overhead of running object storage in production.


Before you begin, verify that you have the following:

  • Kubernetes cluster
  • GEM license

Deployment instructions

  1. Create a namespace:

    $ kubectl create namespace enterprise-metrics
  2. Create a Kubernetes Secret for your GEM license:

    $ kubectl --namespace=enterprise-metrics create secret generic gem-license --from-file=license.jwt
  3. Install Grafana Tanka; refer to Installing Tanka.

  4. Install jsonnet-bundler; refer to the jsonnet-bundler README.

  5. Set up Tanka environment:

    • a. Initialize Tanka:

      $ tk init --k8s=false
      $ tk env add environments/enterprise-metrics
      $ tk env set environments/enterprise-metrics \
        --namespace=enterprise-metrics \
        --server-from-context=<KUBECFG CONTEXT NAME>
    • b. Install k.libsonnet for your version of Kubernetes:

      $ mkdir -p lib
      $ export K8S_VERSION=1.18
      $ jb install${K8S_VERSION}@main
      $ cat <<EOF > lib/k.libsonnet
      import '${K8S_VERSION}/main.libsonnet'
  6. Install the Grafana Enterprise Metrics Jsonnet library.

    $ jb install
  7. Deploy MinIO object storage; refer to Deploy Minio for the YAML manifests:

    $ kubectl apply --namespace enterprise-metrics -f minio.yaml
  8. Deploy a GEM cluster using the MinIO object storage by replacing the contents of the environments/enterprise-metrics/main.jsonnet file with the following configuration:

    $ cat <<EOF > environments/enterprise-metrics/main.jsonnet
    local gem = import '';
    gem {
      _config+:: {
        commonArgs+:: {
          'admin.client.backend-type': 's3',
          'admin.client.s3.access-key-id': 'minio',
          'admin.client.s3.bucket-name': 'grafana-metrics-admin',
          'admin.client.s3.endpoint': 'minio:9000',
          'admin.client.s3.insecure': true,
          'admin.client.s3.secret-access-key': 'minio123',
          'blocks-storage.backend': 's3',
          'blocks-storage.s3.access-key-id': 'minio',
          'blocks-storage.s3.bucket-name': 'grafana-metrics-tsdb',
          'blocks-storage.s3.endpoint': 'minio:9000',
          'blocks-storage.s3.insecure': true,
          'blocks-storage.s3.secret-access-key': 'minio123',
      // Run without an alertmanager or ruler.
      alertmanager:: null,
      ruler:: null,
      // Make tokengen manifests available on a first run.
      tokengen+::: {}
  9. Deploy Grafana Enterprise Metrics.

    $ tk apply environments/enterprise-metrics/main.jsonnet