Launch Prometheus and Grafana on Kubernetes

  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

Firstly we need to create Docker image for Prometheus and Grafanan

Dockerfile for Prometheus:

Dockerfile for Grafana:

Now we need to build image from these Dockerfile and then push them on Docker hub.

Now we need to launch two pods with these image but before that we need to create PVC for both the pods, one for Prometheus and the other for Grafana.

File to create Prometheus PVC:

File to craete Grafana PVC:

After running these two file two PVC will be craeted one for Prometheus and the other for Grafana

In this step we need to launch two pods from Promethes and Grafana image and also we will attach the PVC created.

Deployment file for Prometheus pod:

Deployment file for Grafana pod:

After running these two file two Pods will be craeted one with Prometheus image and the other with Grafana image.

In this step we will expose the pods to the outside world. Againg to expose the pods I have craeted to expose file that will expose the pods to the outside world.

Expose file for Prometheus pod:

Expose file for Grafana pod:

After running these two file both the Pods will be expose to the outside world.

Thank You!!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aditya Raj

Aditya Raj

I'm passionate learner diving into the concepts of computing 💻