I am Integrating Prometheus and Grafana and perform in the 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 remain persistent
3. And both of them should be exposed to the outside world
Let’s create…..
Setting up Prometheus :
To setup Prometheus, I am using the Official Docker Image of Prometheus. In Kubernetes, we gonna create few YAML scripts to set up the components of the Application. So, let’s start one by one…
Service for Prometheus :
Storage for Prometheus :
ConfigMap for Prometheus :
Deployment for Prometheus :
Setting up Grafana :
Now we gonna see the deployment scripts for Grafana. Here also everything is nearly the same as Prometheus. So, let’s start one by one
Service for Grafana :
Storage for Grafana :
Deployment for Grafana :
To deploy these resource files in Kubernetes we have to create a Kustomization.yml file
kustomization:
then I start node exporter in RedHat virtual machine:-
To check Node Exporter is working fine or not, I browse 192.168.99.101:9100 ….
After starting node_exporter I deploy the resource which i made about by running the following commands..
kubectl create -k .kubectl get all
after I run WebUI of Prometheus and Grafana
Grafana setup:-
then I import the dashboard in Grafana:-