This repo has the jsonnet for deploying Cortex and the related monitoring in Kubernetes.
NOTE
If you are more familiar with helm you should use the helm chart for cortex
To generate the YAMLs for deploying Cortex:
-
Make sure you have tanka and jb installed:
Follow the steps at https://tanka.dev/install. If you have
go
installed locally you can also use:$ # make sure to be outside of GOPATH or a go.mod project $ GO111MODULE=on go install github.com/grafana/tanka/cmd/[email protected] $ GO111MODULE=on go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected]
-
Initialise the Tanka repo, install the Cortex and Kubernetes Jsonnet libraries.
$ mkdir <name> && cd <name> $ tk init --k8s=1.26 # this includes github.com/jsonnet-libs/k8s-libsonnet/1.26@main $ jb install github.com/cortexproject/cortex-jsonnet/cortex@main
-
Use any of the examples to get a main.jsonnet and adjust as needed
$ cp vendor/cortex/azure/main.jsonnet.example environments/default/main.jsonnet
$ cp vendor/cortex/gcs/main.jsonnet.example environments/default/main.jsonnet
$ cp vendor/cortex/s3/main.jsonnet.example environments/default/main.jsonnet
-
Check what is in the example:
$ cat environments/default/main.jsonnet ...
-
Generate the YAML manifests:
$ tk show environments/default
To output YAML manifests to
./manifests
, run:$ tk export manifests environments/default
To generate the Grafana dashboards and Prometheus alerts for Cortex:
$ GO111MODULE=on go install github.com/monitoring-mixins/mixtool/cmd/mixtool@2ff523ea63d1cdeee2a10e01d1d48d20adcc7030
$ GO111MODULE=on go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected]
$ git clone https://github.com/cortexproject/cortex-jsonnet
$ cd cortex-jsonnet
$ make build-mixin
This will leave all the alerts and dashboards in cortex-mixin/cortex-mixin.zip (or cortex-mixin/out).