renovator 799dfe0f83
ci/woodpecker/push/build-package Pipeline was successful
ci/woodpecker/push/build-container Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
build(deps): update ghcr.io/aquasecurity/trivy docker tag to v0.74.0 (#23)
2026-08-17 00:31:59 +00:00
2025-08-08 23:29:07 +02:00
2025-05-10 21:15:49 +02:00
2025-05-10 21:15:49 +02:00
2025-08-08 23:29:07 +02:00
2025-05-10 21:15:49 +02:00
2025-05-10 21:15:49 +02:00

mimirtool

Mimir ruler sidecar

Build Status Docker Hub Quay.io Source: Gitea License: MIT

Mimir ruler sidecar to monitor a mounted rules file and syncing the rules to a configured Mimir instance.

How it works

This container runs as a sidecar to monitor rule and alertmanager configuration files. When changes are detected by inotify, it validates and syncs the rules to a configured Mimir instance.

Kubernetes

I'm using the official distributed helm chart for Mimir. Add required extra containers to the mimir-ruler pod:

spec:
  [...]
  ruler:
    [...]
    extraContainers:
      - name: sidecar
        image: quay.io/kiwigrid/k8s-sidecar:latest
        env:
          - name: LABEL
            value: "app.kubernetes.io/managed-by"
          - name: LABEL_VALUE
            value: "k8s-sidecar"
          - name: RESOURCE
            value: both
          - name: FOLDER
            value: /mimirtool/
        volumeMounts:
          - name: mimirtool-data
            mountPath: /mimirtool
      - name: mimirtool
        image: quay.io/thegeeklab/mimirtool:latest
        command:
          - "/usr/local/bin/entrypoint"
          - "watch"
        env:
          - name: MIMIRTOOL_CONF
            value: /mimirtool
          - name: MIMIRTOOL_RULES_PREFIX
            value: mimir-rules
        envFrom:
          - secretRef:
              name: mimir-ruler-secret
        volumeMounts:
          - name: mimirtool-data
            mountPath: /mimirtool
      extraVolumes:
        - name: mimirtool-data
          emptyDir:
            sizeLimit: 10Mi

Create a dedicated service account for the mimir ruler:

spec:
  [...]
  values:
    [...]
    ruler:
      enabled: True
      serviceAccount:
      create: True
      name: mimir-ruler

Create a role with the required permissions for kiwigrid/k8s-sidecar to watch secrets and config maps:

---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: mimir-ruler
rules:
  - apiGroups:
      - ""
    resources:
      - configmaps
      - secrets
    verbs:
      - get
      - list
      - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: mimir-ruler
subjects:
  - kind: ServiceAccount
    name: mimir-ruler
roleRef:
  kind: Role
  name: mimir-ruler
  apiGroup: rbac.authorization.k8s.io

Create config maps and/or secrets for your mimir rules and alertmanager config and ensure to add the configured k8s-sidecar label, in the example above app.kubernetes.io/managed-by: "k8s-sidecar".

Environment Variables

The following environment variables can be used to configure the mimirtool:

  • MIMIRTOOL_CONF: Path to configuration directory (default: /tmp/mimir)
  • MIMIRTOOL_DRYRUN: Run in dry-run mode without making changes (default: false)
  • MIMIRTOOL_RULES_PREFIX: Prefix for rule files in the configuration directory (default: none, uses rules.yaml)

License

This project is licensed under the MIT License - see the LICENSE file for details.

S
Description
No description provided
Readme MIT
96 KiB
v3.0.4
Latest
2026-06-17 17:20:07 +00:00
Languages
Shell 100%