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 Grafana Mimir with Jsonnet and Tanka
Follow the steps at https://tanka.dev/install. If you have
goinstalled locally you can also use:console
# make sure to be outside of GOPATH or a go.mod project go install github.com/grafana/tanka/cmd/tk@latest go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
Set up a Jsonnet project, based on the example that follows:
- Initialize Tanka
- Install Grafana Mimir and Kubernetes Jsonnet libraries
- Set up an environment
#!/usr/bin/env bash # SPDX-License-Identifier: AGPL-3.0-only set -e # Initialise the Tanka. mkdir jsonnet-example && cd jsonnet-example tk init --k8s=1.21 # Install Mimir jsonnet. jb install github.com/grafana/mimir/operations/mimir@main # Use the provided example. cp vendor/mimir/mimir-manifests.jsonnet.example environments/default/main.jsonnet # Generate the YAML manifests. export PAGER=cat tk show environments/default
Generate the Kubernetes YAML manifests and store them in the
# Generate the YAML manifests: export PAGER=cat tk show environments/default tk export manifests environments/default
Configure the environment specification file at
To learn about how to use Tanka and to configure the
spec.jsonfile, see Using Jsonnet: Creating a new project.
Deploy the manifests to a Kubernetes cluster, in one of two ways:
Tanka supports commands to show the
applychanges to a Kubernetes cluster:sh
# Show the difference between your Jsonnet definition and your Kubernetes cluster: tk diff environments/default # Apply changes to your Kubernetes cluster: tk apply environments/default
You generated the Kubernetes manifests and stored them in the
./manifestsdirectory in the previous step.
You can run the following command to directly apply these manifests to your Kubernetes cluster:sh
# Review the changes that will apply to your Kubernetes cluster: kubectl apply --dry-run=client -k manifests/ # Apply the changes to your Kubernetes cluster: kubectl apply -k manifests/
Note: The generated Kubernetes manifests create resources in the
defaultnamespace. To use a different namespace, change the
namespaceconfiguration option in the
environments/default/main.jsonnetfile, and re-generate the Kubernetes manifests.
Note: A Jsonnet-based installation uses etcd for the HA tracker by default. The Jsonnet-based installation creates the etcd using the etcd-operator. Before applying the
kubectl applycommand , make sure that you have the etcd-operator running in your Kubernetes cluster.