Monitoring container clusters with Prometheus

Perfect Fit

Conclusions

The demo environment shown in this article shows how you can monitor your Kubernetes cluster. Various metrics inform you about what is currently happening in the cluster. More fine tuning helps: You can expand the production monitoring system to include the Alert Manager and the need to think about persistent data storage. The CoreOS Prometheus operator [24] [25] takes an interesting approach; it installs production-ready Kubernetes monitoring with very little effort.

Infos

  1. Kubernetes: https://kubernetes.io
  2. "Prometheus" by Michael Kraus, ADMIN , issue 40, 2017, pg. 20, http://www.admin-magazine.com/Archive/2017/40/Time-series-based-monitoring-with-Prometheus
  3. Example from the Kubernetes documentation: https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml
  4. More about relabeling: https://www.robustperception.io/life-of-a-label/
  5. PromQL: https://prometheus.io/docs/querying/basics/
  6. Prometheus 2.0: https://coreos.com/blog/prometheus-2.0-storage-layer-optimization
  7. Persistent volumes: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
  8. Stateful sets: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
  9. Minikube: https://github.com/kubernetes/minikube
  10. Installing Minikube: https://github.com/kubernetes/minikube#installation
  11. Listings for the article: ftp://ftp.linux-magazine.com/pub/listings/admin-magazine.com/41/
  12. RBAC: https://github.com/prometheus/prometheus/blob/master/documentation/examples/rbac-setup.yml
  13. Prometheus Docker image: https://hub.docker.com/r/prom/prometheus/
  14. ConfigMap: https://kubernetes.io/docs/tasks/configure-pod-container/configmap/
  15. Deployments: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
  16. Node exporter image: https://hub.docker.com/r/prom/node-exporter/
  17. DaemonSet: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
  18. Grafana: https://grafana.com
  19. Node exporter dashboard: https://grafana.com/dashboards/22
  20. Kubernetes pod dashboard: https://grafana.com/dashboards/737
  21. Kubernetes dashboards: https://grafana.com/dashboards?dataSource=prometheus&search=Kubernetes
  22. kube-state-metrics: https://github.com/kubernetes/kube-state-metrics
  23. kube-state-metrics documentation: https://github.com/kubernetes/kube-state-metrics/tree/master/Documentation
  24. Prometheus Operator: https://github.com/coreos/prometheus-operator
  25. Prometheus Operator documentation: https://coreos.com/operators/prometheus/docs/latest/

The Author

Michael Kraus is a senior consultant for open source monitoring at ConSol in Munich, Germany. Since 2005, he has developed and managed the monitoring environments with Nagios and its successors. His main focus is integrating new components in a meaningful monitoring environment based exclusively on open source software.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus