0% found this document useful (0 votes)
131 views3 pages

Monitoring and Logging External Services in Kubernetes - Habr

Uploaded by

max
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views3 pages

Monitoring and Logging External Services in Kubernetes - Habr

Uploaded by

max
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

8/15/2020 Monitoring and Logging external services in Kubernetes / Habr

All streams Development Administrating Design Management Marketing PopSci Log in Sign up

alexovchinnicov June 19, 2020 at 05:51 PM Ads

Monitoring and Logging external services in Kubernetes


DevOps, Kubernetes

Greetings to all!

As a matter of fact I haven't found so far any generalized guide on logging and monitoring of metrics from external systems to
Kubernetes on the web. Here I want to share with you my own version. First of all it is supposed that you have already got working
Prometheus and other services.

As an example I use third-party data for stateful service RDBMS PostgreSQL in a Docker container. In our company we also use the Helm
package manager, and you'll find how it works below. You can see same examples in this article below. You can see same examples in
this article below. For a complete solution we create a nested chart.

Logging
Many companies use ELK stack for centralized logging (Elasticsearch + Logstash + kibana). In our case we don't need to index the
content and I apply lightweight Loki. It is available and can be installed as a Helm package. We added it as subchart having changed
values for ingress & pv.

values.yaml

We use Loki Docker Logging Driver for log sending to instance Loki.
You have to set it up as a Docker plugin on all hosts from which you want to get logs. There are several ways to use plugin. My choice is
to put it in the yaml file of Docker Compose which is a part of Ansible playbook.

postgres.yaml

Metrics
PostgreSQL metrics are collected to Prometheus with a postgres_exporter. See extension of Ansible playbook file below.

postgres.yaml

For better clarity the names of external stateful services are presented with Endpoints.

postgres-service.yaml

https://habr.com/en/post/506278/ 1/3
8/15/2020 Monitoring and Logging external services in Kubernetes / Habr

Prometheus settings for getting data from postgres_exporter are tuned by means of value editing in the subchart.

values.yaml

For visualisation of data install a proper dashboard for Grafana and add datasource. That can be done with values of Grafana subchart.
See how it looks below.

How it looks

I hope my first brief article in English will help you to understand basic ideas of this solution and save your time when adjusting
monitoring and logging procedures of external services in Loki/Prometheus in Kubernetes.

Tags: Prometheus, Grafana, Kubernetes, Loki, monitoring, logging

Hubs: DevOps, Kubernetes

+2 6 865 Comment Share

14.0 0.0
Karma Rating

@ alexovchinnicov
Пользователь

SIMILAR POSTS

January 28, 2019 at 05:52 PM

Monitoring System for Windows servers on pure SQL, and how I had secretly dragged it into the Production
+20 837 1 0

January 27, 2019 at 12:58 PM

Writing yet another Kubernetes templating tool


+20 7k 3 1

January 24, 2019 at 08:07 AM

About monitoring
+12 1.8k 3 3

Ads

Comments 0

Only users with full accounts can post comments. Log in, please.

TOP POSTS
https://habr.com/en/post/506278/ 2/3
8/15/2020 Monitoring and Logging external services in Kubernetes / Habr
TOP POSTS

Day Week Month

Памятка для пострадавшего от слезоточивого газа/перцового баллона


+132 47.2k 251 110

Audio over Bluetooth: most detailed information about profiles, codecs, and devices
+22 112k 10 8

Technical analysis of the checkm8 exploit


+22 59.6k 5 4

Java vs .Net: Who will Reign in the Future?


+3 6.2k 5 2

Your account Sections Info Services

Log in Posts How it works Ads

Sign up Hubs For Authors Subscription plans

Companies For Companies Content

Users Documents Seminars

Sandbox Agreement Megaprojects

Terms of service

© 2006 – 2020 «Habr» Language settings About Support Mobile version

https://habr.com/en/post/506278/ 3/3

You might also like