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 Logs to Kubernetes using a Jsonnet library and Grafana Tanka, you can use MinIO to provide object storage. That said, it is best to leverage your cloud provider’s object storage service to avoid the operational overhead of running object storage in production.
Prerequisites
- Kubernetes cluster
kubectl
- GEL license
Procedure
Create a Kubernetes namespace:
consolekubectl create namespace enterprise-logs
Create a Kubernetes Secret for your GEL license:
consolekubectl --namespace=enterprise-logs create secret generic gel-license --from-file=license.jwt
Install Grafana Tanka; refer to Installing Tanka.
Install
jsonnet-bundler
; refer to thejsonnet-bundler
README.Set up the Tanka environment:
Initialize Tanka
consoletk init --k8s=false tk env add environments/enterprise-logs tk env set environments/enterprise-logs \ --namespace=enterprise-logs \ --server-from-context=<KUBECFG CONTEXT NAME>
Install
k.libsonnet
for your version of Kubernetes:consolemkdir -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 GEL Jsonnet library and its dependencies.
consolejb install github.com/grafana/loki/production/ksonnet/enterprise-logs@main
Deploy MinIO object storage; refer to Deploy Minio for the YAML manifests:
consolekubectl apply --namespace enterprise-logs -f minio.yaml
Deploy a GEL cluster using the MinIO object storage by replacing the contents of the
environments/enterprise-logs/main.jsonnet
file with the following configuration:consoleexport CLUSTER_NAME=<cluster-name in license.jwt> cat <<EOF > environments/enterprise-logs/main.jsonnet local gel = import 'github.com/grafana/loki/production/ksonnet/enterprise-logs/main.libsonnet'; gel { _config+:: { commonArgs+:: { 'admin.client.backend-type': 's3', 'admin.client.s3.access-key-id': 'minio', 'admin.client.s3.bucket-name': 'grafana-logs-admin', 'admin.client.s3.endpoint': 'minio:9000', 'admin.client.s3.insecure': true, 'admin.client.s3.secret-access-key': 'minio123', 'cluster-name': '$CLUSTER_NAME', }, namespace: 'enterprise-logs', boltdb_shipper_shared_store: 's3', storage_backend: 's3', s3_access_key: 'minio', s3_address: 'minio:9000', s3_bucket_name: 'grafana-logs-data', s3_secret_access_key: 'minio123', }, // Deploy tokengen Job available on a first run. tokengen_job+::: {}, } EOF
Deploy GEL:
consoletk apply environments/enterprise-logs/main.jsonnet