- Deploy them as pods on top of Kubernetes by creating resources Deployment, ReplicaSet, Pods or Services
- And make their data to be remain persistent
- 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.