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.
Prerequisites
Before you begin, verify that you have the following:
- Kubernetes cluster
- GEM license
Deployment instructions
Create a namespace:
$ kubectl create namespace enterprise-metrics
Create a Kubernetes Secret for your GEM license:
$ kubectl --namespace=enterprise-metrics create secret generic gem-license --from-file=license.jwt
Install Grafana Tanka; refer to Installing Tanka.
Install
jsonnet-bundler
; refer to thejsonnet-bundler
README.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 github.com/jsonnet-libs/k8s-libsonnet/${K8S_VERSION}@main $ cat <<EOF > lib/k.libsonnet import 'github.com/jsonnet-libs/k8s-libsonnet/${K8S_VERSION}/main.libsonnet' EOF
Install the Grafana Enterprise Metrics Jsonnet library.
$ jb install github.com/grafana/jsonnet-libs/enterprise-metrics
Deploy MinIO object storage; refer to Deploy Minio for the YAML manifests:
$ kubectl apply --namespace enterprise-metrics -f minio.yaml
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 'github.com/grafana/jsonnet-libs/enterprise-metrics/main.libsonnet'; 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+::: {} } EOF
Deploy Grafana Enterprise Metrics.
$ tk apply environments/enterprise-metrics/main.jsonnet