General availability (GA) Open source Grafana Cloud

mimir.rules.kubernetes

mimir.rules.kubernetes discovers PrometheusRule Kubernetes resources and loads them into a Mimir instance.

It can also federate rules from different source tenants into a target Mimir tenant by interpreting the monitoring.grafana.com/source_tenants annotation on PrometheusRule resources.

  • You can specify multiple mimir.rules.kubernetes components by giving them different labels.
  • Kubernetes label selectors let you limit the Namespace and PrometheusRule resources the component considers during reconciliation.
  • Compatible with the Ruler APIs of Grafana Mimir, Grafana Cloud, and Grafana Enterprise Metrics.
  • Compatible with the PrometheusRule CRD from the prometheus-operator.
  • This component accesses the Kubernetes REST API from within a Pod.

Note

You must configure Role-based access control (RBAC) in Kubernetes so Alloy can access the Kubernetes REST API.

Note

Alloy version 1.1 and higher supports clustered mode in this component. When you use this component as part of a cluster of Alloy instances, only a single instance from the cluster updates rules using the Mimir API.

Usage

Alloy
mimir.rules.kubernetes "<LABEL>" {
  address = "<MIMIR_RULER_URL>"
}

Arguments

You can use the following arguments with mimir.rules.kubernetes:

NameTypeDescriptionDefaultRequired
addressstringURL of the Mimir ruler.yes
bearer_token_filestringFile containing a bearer token to authenticate with.no
bearer_tokensecretBearer token to authenticate with.no
enable_http2boolWhether to enable HTTP2 for requests.trueno
external_labelsmap(string)Labels to add to each rule.{}no
follow_redirectsboolWhether to follow redirects returned by the server.trueno
http_headersmap(list(secret))Custom HTTP headers to send with each request. The map key is the header name.no
mimir_namespace_prefixstringPrefix used to differentiate multiple Alloy deployments."alloy"no
mimir_namespace_separatorstringSeparator for Mimir namespace segments. Use a character that doesn’t require URL encoding when a reverse proxy drops encoded slashes."/"no
no_proxystringComma-separated list of IP addresses, CIDR notations, and domain names to exclude from proxying.no
prometheus_http_prefixstringPath prefix for the Mimir Prometheus endpoint."/prometheus"no
proxy_connect_headermap(list(secret))Specifies headers to send to proxies during CONNECT requests.no
proxy_from_environmentboolUse the proxy URL indicated by environment variables.falseno