Prometheus Operator

PrometheusOperator provides CRUD that simplifies creation/configuration/management of Prometheus and AlertManager.

Dependencies

None

Install

You can install prometheus-operator in a few different ways, but we recommend to use the Helmfile.

Install using Helmfile

To install prometheus-operator run

Install prometheus-operator

helmfile --selector chart=prometheus-operator sync

These are some of the environment variables you may want to configure:

Environment variables can be specified in the Geodesic Module’s Dockerfile or using Chamber storage, which is recommended for all secrets.

Install using Custom Helmfile

Add this code to your Kubernetes Backing Services Helmfile:

helmfile

repositories:
- name: "coreos-stable"
  url: "https://s3-eu-west-1.amazonaws.com/coreos-charts/stable"

releases:
- name: "prometheus-operator"
  namespace: "kube-system"
  labels:
    chart: "prometheus-operator"
    component: "monitoring"
    namespace: "kube-system"
    vendor: "coreos"
    default: "true"
  chart: "coreos-stable/prometheus-operator"
  version: "0.0.23"
  set:
    - name: "rbacEnable"
      value: "false"

    - name: "jobLabel"
      value: "prometheus-operator"

    - name: "image.repository"
      value: "quay.io/coreos/prometheus-operator"

    - name: "image.tag"
      value: 'v0.17.0'

    - name: "image.pullPolicy"
      value: "IfNotPresent"

    - name: "resources.limits.cpu"
      value: "10m"

    - name: "resources.limits.memory"
      value: "64Mi"

    - name: "resources.requests.cpu"
      value: "5m"

    - name: "resources.requests.memory"
      value: "32Mi"

    - name: "global.hyperkube.repository"
      value: "quay.io/coreos/hyperkube"

    - name: "global.hyperkube.tag"
      value: 'v1.7.6_coreos.0'

    - name: "global.hyperkube.pullPolicy"
      value: "IfNotPresent"

    - name: "prometheusConfigReloader.repository"
      value: "quay.io/coreos/prometheus-config-reloader"

    - name: "prometheusConfigReloader.tag"
      value: 'v0.0.3'

    - name: "configmapReload.repository"
      value: "quay.io/coreos/configmap-reload"

    - name: "configmapReload.tag"
      value: 'v0.0.1'

    - name: "kubeletService.enable"
      value: "true"

    - name: "kubeletService.namespace"
      value: "kube-system"

    - name: "kubeletService.name"
      value: "kubelet"

Then follow the instructions for running helmfile sync.

Usage

Prometheus operator provides these new Kubernetes resources:

  • Prometheus
  • ServiceMonitor
  • Alertmanager

These resources can be configured to interact with each other.

Tip

We recommend to install kube-prometheus that installs Prometheus, AlertManager and ServiceMonitors+Exporters to collect all required metrics from Kubernetes cluster.

Prometheus

Read More about the Prometheus design.

Alertmanager

Read More about the Alertmanager design.

ServiceMonitor

Read More about the ServiceMonitor design.