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!!

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Why do you need performance tests?

Android Support Library 101

Debugging PHP/Laravel with Visual Studio Code

CS373 Spring 2022: Alex Chandler

Persistent AWS access with role chain juggling

A Complete Guide To SAP HANA Implementation

Lodash: Understanding the recent vulnerability and how we can rally behind packages

Hydra Cloud in Action: Preventing a Massive Outage

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 💻

More from Medium

Configure traefik to use your own existing SSL certificate in kubernetes

Deconstructing DevOps — a simple walkthrough of Docker & Kubernetes

From gitlab to kubernetes

Using Nginx Ingress Controller in Kubernetes bare-metal setup

nginx ingress controller