Helm chartv0.3.0App 2.15.0

Grafana Mimir - horizontally scalable, highly available, long-term storage for Prometheus metrics

About this chart

Mimir Helm Chart

Grafana Mimir is a horizontally scalable, highly available, multi-tenant, long-term storage solution for Prometheus metrics.

Overview

This chart deploys Mimir in monolithic mode, suitable for small to medium deployments. For large-scale deployments, consider using the microservices mode with the official Grafana Mimir Helm chart.

Prerequisites

  • Kubernetes 1.24+
  • Helm 3.8+
  • PV provisioner support (if persistence enabled)
  • S3-compatible storage (recommended for production)

Installation

# Add repository
helm repo add sb-charts https://scriptonbasestar-containers.github.io/sb-helm-charts
helm repo update

# Install with default values (filesystem storage)
helm install mimir sb-charts/mimir -n monitoring --create-namespace

# Install with S3/MinIO storage (recommended)
helm install mimir sb-charts/mimir -n monitoring \
  --set mimir.storage.backend=s3 \
  --set mimir.storage.s3.endpoint=minio.monitoring.svc:9000 \
  --set mimir.storage.s3.bucket=mimir-blocks \
  --set mimir.storage.s3.accessKeyId=admin \
  --set mimir.storage.s3.secretAccessKey=secretpassword \
  --set mimir.storage.s3.insecure=true

Configuration

Storage Backends

BackendDescriptionProduction
filesystemLocal PVC storageNo
s3S3 or S3-compatible (MinIO)Yes
gcsGoogle Cloud StorageYes
azureAzure Blob StorageYes

Key Parameters

ParameterDescriptionDefault
replicaCountNumber of Mimir instances1
mimir.targetMimir target modeall
mimir.multitenancy.enabledEnable multi-tenancyfalse
mimir.storage.backendStorage backendfilesystem
mimir.blocks.retentionPeriodBlock retention2w
mimir.limits.ingestionRateIngestion rate limit10000
mimir.limits.maxGlobalSeriesPerUserMax series per tenant150000
persistence.enabledEnable persistencetrue
persistence.sizePVC size50Gi

S3/MinIO Configuration

mimir:
  storage:
    backend: "s3"
    s3:
      endpoint: "minio.monitoring.svc.cluster.local:9000"
      bucket: "mimir-blocks"
      region: "us-east-1"
      accessKeyId: "admin"
      secretAccessKey: "secretpassword"
      insecure: true  # Set to false for HTTPS

Multi-tenancy

Enable multi-tenancy for isolating metrics by tenant:

mimir:
  multitenancy:
    enabled: true

When multi-tenancy is enabled, clients must include the X-Scope-OrgID header:

# Prometheus remote_write
remote_write:
  - url: http://mimir:8080/api/v1/push
    headers:
      X-Scope-OrgID: tenant-1

Limits Configuration

mimir:
  limits:
    ingestionRate: 50000
    ingestionBurstSize: 500000
    maxGlobalSeriesPerUser: 500000
    maxQueryLength: "2160h"  # 90 days

Usage

Configure Prometheus Remote Write

Add to your Prometheus configuration:

remote_write:
  - url: http://mimir.monitoring.svc.cluster.local:8080/api/v1/push

Configure Grafana Datasource

Add Mimir as a Prometheus datasource:

datasources:
  - name: Mimir
    type: prometheus
    url: http://mimir.monitoring.svc.cluster.local:8080/prometheus
    access: proxy

Query Metrics

Use the Prometheus query API:

# PromQL query
curl -G http://mimir:8080/prometheus/api/v1/query \
  --data-urlencode 'query=up'

# Range query
curl -G http://mimir:8080/prometheus/api/v1/query_range \
  --data-urlencode 'query=rate(http_requests_total[5m])' \
  --data-urlencode 'start=2024-01-01T00:00:00Z' \
  --data-urlencode 'end=2024-01-02T00:00:00Z' \
  --data-urlencode 'step=1h'

Production Recommendations

Storage

  • Always use object storage (S3/MinIO/GCS/Azure) for production
  • Filesystem storage is only suitable for testing

Resources

resources:
  limits:
    cpu: 4000m
    memory: 8Gi
  requests:
    cpu: 1000m
    memory: 2Gi

High Availability

For HA deployments, increase replication:

replicaCount: 3
mimir:
  ingester:
    ring:
      replicationFactor: 3

Monitoring

Enable ServiceMonitor for Prometheus Operator:

serviceMonitor:
  enabled: true
  namespace: monitoring
  labels:
    release: prometheus

Upgrading

helm upgrade mimir sb-charts/mimir -n monitoring -f values.yaml

Uninstalling

helm uninstall mimir -n monitoring

Note: PVCs are not automatically deleted. Remove manually if needed:

kubectl delete pvc -n monitoring -l app.kubernetes.io/name=mimir

Troubleshooting

Check Mimir Status

# Pod status
kubectl get pods -n monitoring -l app.kubernetes.io/name=mimir

# Logs
kubectl logs -n monitoring -l app.kubernetes.io/name=mimir -f

# Ready check
kubectl exec -n monitoring mimir-0 -- wget -qO- http://localhost:8080/ready

Common Issues

  1. OOMKilled: Increase memory limits
  2. Slow queries: Check maxQueryLength limits
  3. Ingestion failures: Check ingestionRate limits
  4. Storage errors: Verify S3 credentials and bucket permissions

Related Charts

  • prometheus - Metrics collection
  • grafana - Visualization
  • alertmanager - Alert routing

Resources

Deploy mimir with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mimir on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmimir is pinned at v0.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply