rpi.carlosedp.cluster-monit.../Readme.md
2019-02-05 17:41:01 -02:00

5.3 KiB

Prometheus Operator for ARM / X86-64 platforms

The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of Prometheus instances.

This have been tested on a hybrid ARM64 / X84-64 Kubernetes cluster deployed as this article.

This repository collects Kubernetes manifests, Grafana dashboards, and Prometheus rules combined with documentation and scripts to provide easy to operate end-to-end Kubernetes cluster monitoring with Prometheus using the Prometheus Operator.

The content of this project is written in jsonnet and is an extension of the fantastic kube-prometheus project.

Components included in this package:

  • The Prometheus Operator
  • Highly available Prometheus
  • Highly available Alertmanager
  • Prometheus node-exporter
  • ARM_exporter to generate temperature metrics
  • MetalLB metrics
  • Traefik metrics
  • kube-state-metrics
  • Grafana

Quickstart

The repository already provides a set of compiled manifests to be applied into the cluster. The deployment can be customized thru the jsonnet files.

To simply deploy the stack, run:

$ kubectl apply -f manifests/

# It can take a few seconds for the above 'create manifests' command to fully create the following resources, so verify the resources are ready before proceeding.
$ until kubectl get customresourcedefinitions servicemonitors.monitoring.coreos.com ; do date; sleep 1; echo ""; done
$ until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done

$ kubectl apply -f manifests/ # This command sometimes may need to be done twice (to workaround a race condition).

Customizing

The content of this project consists of a set of jsonnet files making up a library to be consumed.

Pre-reqs

The project requires json-bundler and the jsonnet compiler. The Makefile does the heavy-lifting of installing:

git clone https://github.com/carlosedp/prometheus-operator-ARM
cd prometheus-operator-ARM
make vendor
# Change the jsonnet files...
make

After this, a new customized set of manifests is built into the manifests dir. To apply to your cluster, run:

make deploy

To uninstall, run:

make teardown

Images

This project depends on the following images:

Alertmanager Blackbox_exporter Node_exporter Snmp_exporter Prometheus

ARM_exporter

Prometheus-operator

Prometheus-adapter

Grafana

Kube-state-metrics

Addon-resizer

Obs. This image is a clone of ARM64 and ARM with a manifest. It's cloned and generated by the build_images.sh script

configmap_reload

prometheus-config-reloader

SMTP-server

Source: https://github.com/carlosedp/docker-smtp Autobuild: https://travis-ci.org/carlosedp/docker-smtp Images: https://hub.docker.com/r/carlosedp/docker-smtp

Kube-rbac-proxy

Source: https://github.com/brancz/kube-rbac-proxy Autobuild: No autobuild yet. Use provided build_images.sh script. Images: https://hub.docker.com/r/carlosedp/kube-rbac-proxy