DevOps Assembly Lines Task #5
Task Description:
Integrate Prometheus and Grafana in following way:
- Deploy them as pods on top of Kubernetes using the concepts of resources, PVCs, deployments, Replica Set, Pods or Services.
- Make their data to be remain persistent.
- Both of them should be exposed to outside world.
Creating Docker images for Prometheus and Grafana:
Docker file for Prometheus:
To create the image using this Docker file:
>> docker build -t suchitrasaksena:prometheus-env:v1 ws/ >> docker push suchitrasaksena:prometheus-env:v1
Docker file for grafana:
To create the image using this Docker file:
>> docker build -t suchitrasaksena:grafana-env:v1 ws/ >> docker push suchitrasaksena:grafana-env:v1
Configuring Kubernetes:
Creating persistent volumes for Prometheus:
>> kubectl create -f prometheus-pv.yml
Creating persistent volumes for Grafana:
>> kubectl create -f grafana-pv.yml
Creating persistence volume claim for Prometheus:
>> kubectl create -f prometheus-pvc.yml
Creating persistence volume claim for Grafana:
>> kubectl create -f grafana-pvc.yml
Creating deployment for Prometheus:
>> kubectl create -f prometheus-deployment.yml
Creating deployemnt for Grafana:
>> kubectl create -f grafana-deployment.yml
Exposing the Prometheus and Grafana pods:
>> kubectl expose deployment prometheus-pod --port=9090 --type=NodePort >> kubectl expose deployment grafana-pod --port=3000 --type=Nodeport
The pods are deployed and exposed successfully:
The task is completed successfully. Thank you for reading! Feel free to leave your reviews and suggestions for improving this setup.
React Native Developer
4 年Can you tell me why you have created pv here as when we create pvc, pv is created automatically