loki-rule-operator

command module
v0.6.0 Latest Latest
Warning

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

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

README

loki-rule-operator

Loki-rule-operator is light-weight Kubernetes Operator that adds the LokiRule and GlobalLokiRule Custom Resource Definitions to a cluster. These resources helps configuring Alert rules for your Loki setup.

Example

apiVersion: logging.opsgy.com/v1beta1
kind: LokiRule
metadata:
  name: credentials-leak
  namespace: prod
spec:
  groups:
  - name: credentials_leak
    rules:
    - alert: http-credentials-leaked
      annotations:
        message: '{{ $labels.job }} is leaking http basic auth credentials.'
      expr: sum by (cluster, job, pod) (count_over_time({namespace="prod"} |~ "http(s?)://(\\w+):(\\w+)@" [5m]) > 0)
      for: 10m
      labels:
        severity: critical

Difference between GlobalLokiRule and LokiRule

LokiRule is a namespaced resource and will will enforce the selector {namespace="<namespace>"} on the LogQL expression. The GlobalLokiRule is cluster wide and doesn't enforce the namespace selector.

Setup the loki-rule-operator

See the deploy folder.

License

Apache License 2.0, see LICENSE.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1beta1
Package v1beta1 contains API Schema definitions for the logging v1beta1 API group +kubebuilder:object:generate=true +groupName=logging.opsgy.com
Package v1beta1 contains API Schema definitions for the logging v1beta1 API group +kubebuilder:object:generate=true +groupName=logging.opsgy.com

Jump to

Keyboard shortcuts

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