cortex-alert-operator

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

README

Cortex Alert Operator

This K8s Operator consumes PrometheusRules as known from using Prometheus with Prometheus Operator. It then applies these Rules against a Cortex environment.

Project state

This project is currently in proof of concept state. It works for our internal test use-case.

We plan on improving configuration of the operator itself. I.e. currently it is not possible to change the naming behavior of the operator. While PrometheusRules in Kubernetes are named in a namespace + name + groupname-scheme, Cortex only supports namespace + groupname. With the current behavior, we map a Cortex namespace to a Kubernetes {namespace}--{name}.

We plan to allow custom namespace prefixes i.e. for use with different Kubernetes clusters and to further investigate into supporting other naming schemes.

Known PoC limitations
  • Removing one or more rule groups without removing the whole PrometheusRule is not supported yet and results in them not being deleted in Cortex.
  • Naming scheme as described above.
Example
# original from: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/alerting.md

# change API Version from monitoring.coreos.com/v1 to monitoring.bolinda.digital/v1
apiVersion: monitoring.bolinda.digital/v1
kind: PrometheusRule
metadata:
  labels:
    prometheus: example
    role: alert-rules
  name: prometheus-example-rules
spec:
  groups:
  - name: ./example.rules
    rules:
    - alert: ExampleAlert
      expr: vector(1)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
Package v1 contains API Schema definitions for the monitoring v1 API group +kubebuilder:object:generate=true +groupName=monitoring.bolinda.digital
Package v1 contains API Schema definitions for the monitoring v1 API group +kubebuilder:object:generate=true +groupName=monitoring.bolinda.digital

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL