DEV Community

Cover image for Setup Prometheus Monitoring πŸ”₯ in Kubernetes using Prometheus Operator
TechWorld with Nana
TechWorld with Nana

Posted on • Edited on

Setup Prometheus Monitoring πŸ”₯ in Kubernetes using Prometheus Operator

Learn how to setup Prometheus and Grafana to monitor your Kubernetes cluster.

In general there are 3 ways to do the setup:

  1. Create all the configuration files yourself πŸ‘©πŸ»β€πŸ’»
  2. Using Prometheus Operator 😎
  3. Using Helm chart to deploy the Prometheus Operator πŸš€

1. DIY πŸ‘©πŸ»β€πŸ’»

The first option includes creating all the configuration files by yourself, like Prometheus StatefulSet, Alertmanager, Grafana, all the ConfigMaps and Secrets. And then executing them in the right order. I think this way is pretty inefficient, it's a lot of effort. You need to find a good step-by-step guide and hope that each step works, which usually is not the case. πŸ˜‰

2. Prometheus Operator 😎

In this option you would go and find an operator for Prometheus and deploy it in the cluster using the configuration files of the operator. It is more efficient.

Generally, think of an operator as a manager of all Prometheus individual components that you create. Operator will keep an eye and manage the combination of StatefulSet and Deployments and all the other stuff that comes with Prometheus deployment as 1 unit, so that you don’t have to manually manage those separate parts. πŸ™‰

3. Helm chart to deploy Prometheus Operator πŸš€

I think this way is the most efficient. Prometheus Operator has a Helm chart that is maintained by the Helm community. You can use this Helm chart to deploy the operator.
So, Helm will do the initial setup. Operator will then manage the running Prometheus setup

In the demo I show you the third way. We will easily deploy Prometheus and Grafana using Helm and I walk you through the different components, which were created. So that you have a good understanding πŸ’‘ of what they are and what they do.


This is the first part of the demo (Setup). In the second part we will actually configure Prometheus to expose our own /metrics endpoint and configure Prometheus to scrape it. πŸ€“

If you missed the theoretical part, where I explain how Prometheus works and its architecture, you can check it out here: Prometheus Monitoring explained

Watch the demo video here πŸ™ŒπŸΌ


β–Ί Get 30% off - with this code: UDEMY_NANA_OCT2020: Udemy course here
β–Ί Kubernetes 101 Compact and easy-to-read ebook bundle πŸš€
It's a handy way to quickly look something up or refresh your knowledge at work and use it as your cheatsheet 😎

Like, share and follow me 😍 for more content:

Top comments (6)

Collapse
 
jouo profile image
Jashua

Just yesterday I was searching for some Prometheus tutorials, then I woke up to this!

This is the first part of the demo (Setup). In the second part we will actually configure Prometheus to expose our own /metrics endpoint and configure Prometheus to scrape it

Will these two tutorials cover most of the basics? :)

Collapse
 
techworld_with_nana profile image
TechWorld with Nana

Cool, good timing then! :) Yes I try to cover all the basics in these videos. If you need to understand how the Prometheus stack is made up and also how to configure Prometheus then this will definitely be helpful. πŸ™‚
But I'm open to feedback/suggestions, if you have specific topics/use cases

Collapse
 
jouo profile image
Jashua

Looking forward for the second part!

I also watched your video on Terraform and I was wondering if you have any plans on making a tutorial for beginners, I personally really like how you explain things

Thank you :)

Collapse
 
mayankjoshi profile image
mayank joshi

Great post Nana. It's very helpful especially for newbies.

Thank you for such posts

Collapse
 
gelopfalcon profile image
Falcon

Hello Nana. Nice post. What about if I want to send a notification slack based on alert? Where should I do it?

Collapse
 
alexandrusimandi profile image
Alexandru Simandi

Did they fix the performance hog? Last year when I tried it we had all requests slowed down considerably.