DevOps Assembly Lines Task #5

DevOps Assembly Lines Task #5

Task Description:

Integrate Prometheus and Grafana in following way: 

  1. Deploy them as pods on top of Kubernetes using the concepts of resources, PVCs, deployments, Replica Set, Pods or Services.
  2. Make their data to be remain persistent.
  3. Both of them should be exposed to outside world.
No alt text provided for this image

Creating Docker images for Prometheus and Grafana:

Docker file for Prometheus:

No alt text provided for this image

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:

No alt text provided for this image

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:

No alt text provided for this image
>> kubectl create -f prometheus-pv.yml

Creating persistent volumes for Grafana:

No alt text provided for this image
>> kubectl create -f grafana-pv.yml

Creating persistence volume claim for Prometheus:

No alt text provided for this image
>> kubectl create -f prometheus-pvc.yml

Creating persistence volume claim for Grafana:

No alt text provided for this image
>> kubectl create -f grafana-pvc.yml

Creating deployment for Prometheus:

No alt text provided for this image
>> kubectl create -f prometheus-deployment.yml

Creating deployemnt for Grafana:

No alt text provided for this image
>> 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:

No alt text provided for this image
No alt text provided for this image

The task is completed successfully. Thank you for reading! Feel free to leave your reviews and suggestions for improving this setup.

Gaurav Pratap Singh

React Native Developer

4 年

Can you tell me why you have created pv here as when we create pvc, pv is created automatically

回复

要查看或添加评论,请登录

Suchitra Saksena的更多文章

  • DevOps Assembly Lines Task #6

    DevOps Assembly Lines Task #6

    Task Description: Deploy your website on kubernetes with the help of Jenkins coding file as follows: 1. Create…

    2 条评论
  • DevOps Assembly Lines Task #4

    DevOps Assembly Lines Task #4

    Task Description: Create A dynamic Jenkins cluster to achieve this setup: Create container image that’s has Linux and…

  • DevOps Assembly Lines Task #3

    DevOps Assembly Lines Task #3

    Task Description: Create container image that’s has Jenkins installed using docker file. When we launch this image, it…

  • DevOps Assesmbly Lines Task #2

    DevOps Assesmbly Lines Task #2

    Task Discription: Create container image that has Jenkins installed using dockerfile. When we launch this image, it…

  • DevOps Assembly Lines Task #1

    DevOps Assembly Lines Task #1

    Task Description : JOB 1 If Developer push to master branch then Jenkins will fetch from master and deploy on "Deploy"…

    4 条评论

社区洞察

其他会员也浏览了