Prometheus, Grafana and Kubernetes

Prometheus, Grafana and Kubernetes

This is the 5th task of DevOps Assembly Lines. The main objectives of this task are:


Integrate Prometheus and Grafana and perform in following way:

1. Deploy them as pods on top of Kubernetes by creating resources Deployment, ReplicaSet, Pods or Services

2. And make their data to be remain persistent 

3. And both of them should be exposed to outside world


Let us try to follow the steps and complete all the requirements of this task.

The first step is to create the YAML files for the respective services and resources. All the YAML files have been listed below:

Grafana Service:

No alt text provided for this image


Grafana PVC:

No alt text provided for this image


Grafana Deployment:

No alt text provided for this image


Prometheus Service:

No alt text provided for this image


Prometheus PVC:

No alt text provided for this image


I have created this PVC to store the data of Prometheus persistently. But here, we have to create one more resource which is Config Map. The configuration file of Prometheus will be made persistent using Config Map:

Prometheus ConfigMap:

No alt text provided for this image


Prometheus Deployment:

No alt text provided for this image


I have arranged all these files in a Kustomization file so that all these resources and services can be launch in one click only. 

No alt text provided for this image



The second step is to launch all these resources and services using the above command:

“Kubectl create -k .”

And the above services+resources will be launched:

No alt text provided for this image


This is the first screen of Prometheus:

No alt text provided for this image


Here, I am monitoring a different system having IP Address = 192.168.43.93. If we want that Prometheus should scrap data from this node, we have to install and run a “node exporter” program on that node. 

No alt text provided for this image


The first screen of Grafana:

No alt text provided for this image


Here, the default username is “admin” and the password is also “admin”. After entering the username and password, it will ask us to change the password:

No alt text provided for this image


After logging in, this is the first screen of Grafana:

No alt text provided for this image


Thus, we have successfully fulfilled all the requirements for this task.

I hope you liked this article. Thank you :)


要查看或添加评论,请登录

Shubham Mehta的更多文章

社区洞察

其他会员也浏览了