Table of Contents
Mimir is an Open Source, horizontally scalable, highly available, multi-tenant TSDB for long-term storage for Prometheus.
Mimir is a single binary that can be configured to run in several modes to take up different roles in the ingestion/storage/read pipeline, such as distributor, compactor and so on, read the official docs for a more detailed explanation..
Charmed Mimir consists of two charms, a coordinator and a worker.
The coordinator is responsible for creating the configuration files for each worker and deciding whether the cluster is in a coherent state, based on the roles that each worker has adopted.
Several worker applications can be deployed and related to the coordinator, taking on different roles and enabling independent scalability of the various components of the stack.
The coordinator charm acts as single access point for bundle-level integrations such as TLS, ingress, self-monitoring, etc..., and as single source of truth for bundle-level configurations that otherwise would have to be repeated (and kept in sync) between the individual worker nodes.
This Juju bundle deploys Mimir and a small object storage server, consisting of the following interrelated charmed operators:
This bundle is under development. Join us on:
Before deploying the bundle you may want to create a dedicated model for Mimir components:
juju add-model mimirThe bundle deploys Mimir in its monolithic mode, which runs all required components in a single process and is the default mode of operation. Monolithic mode is the simplest way to deploy Grafana Mimir and is useful if you want to get started quickly or want to work with Grafana Mimir in a development environment.
tox -e render-bundle -- bundle.yaml
juju deploy ./bundle.yaml --trustThe bundle will deploy:
- 3
mimir-workerunits (mimir-worker-k8scharm) - 1
coordinatorunit (mimir-coordinator-k8scharm) - 1
s3-integratorunit (s3-integratorcharm)
[note] The default number of worker units is an odd number to prevent split-brain situations, and greater than 1 for the deployment to be HA. [/note]
Mimir can also be deployed distributing the roles across units freely. This includes for example the experimental read/write deployment mode. You can achieve this (or any other allocation of roles) by deploying the components manually:
juju deploy mimir-coordinator-k8s mimir
juju deploy mimir-worker-k8s mimir-read --config query-frontend=true --config querier=true
juju deploy mimir-worker-k8s mimir-write --config distributor=true --config ingester=true
juju deploy mimir-worker-k8s mimir-backend --config store-gateway=true --config compactor=true --config ruler=true --config alertmanager=true --config query-scheduler=true --config overrides-exporter=true
juju deploy s3-integrator
juju relate mimir mimir-read
juju relate mimir mimir-write
juju relate mimir mimir-backend
juju relate mimir s3-integrator
We also make available some overlays for convenience:
- the
cos-relationsoverlay establishes relationships between the charms in this bundle and those in thecos-litebundle, as well as exposing Mimir as a Prometheus compatible remote-write targets as a Juju offer which may be used to set up a cross-model relation. - the
storage-smalloverlays provides a (small) setup of the various storages for the Mimir bundle charms. Using an overlay for storage is fundamental for a production deployment, as you cannot change the amount of storage assigned to the various charms after the bundle is deployed.
In order to use the overlays above, you need to:
- Download the overlays (or clone the repository)
- Pass the
--overlay <path-to-overlay-file-1> --overlay <path-to-overlay-file-2> ...arguments to thejuju deploycommand
For example, to deploy the COS Lite bundle, then the Mimir bundle with the cos-relations overlay, you would do the following:
curl -L https://raw.githubusercontent.com/canonical/mimir-bundle/main/overlays/cos-relations-overlay.yaml -O
juju deploy cos-lite-bundle --channel=edge --trust
juju deploy mimir-bundle --channel=edge --trust --overlay ./cos-relations-overlay.yaml./render_bundle.py bundle.yaml --channel=edge
charmcraft pack
charmcraft upload mimir-bundle.zip
charmcraft release mimir-bundle --channel=edge --revision=1