DEV Community

Cover image for Setup Prometheus monitoring on k8s :
Rahul Kumar
Rahul Kumar

Posted on • Edited on

Setup Prometheus monitoring on k8s :

What is Prometheus :

Prometheus is an open source application monitoring software which is used to achieve the continuous monitoring of our application state .

Let's set up a sample monitoring in our k8s cluster with Prometheus and Grafana :

prom and graph

  • Instead of creating all the configuration files we are going to use Prometheus Helm charts
  • And Internally Kubernetes operators are going to manage all the configurations .

  • Install the Prometheus Helm Chart :

$helm install --name prometheus stable/prometheus

  • Have a look at some default files that we are going to need in the future using these commands .

$kubectl get pod

$kubectl get service

$kubectl get configmap

$kubectl get cidr

$kuctktl get statefulsets

  • Two things we need to take care of when we add a new configuration to our cluster .
  1. About the configuration settings
  2. About the Alert manager
  • Access the grafana dashboard by using the port-forward command .
  • Check in which port Grafana dashboard is running

$kubectl logs prometheus-grafana-5c5885d488-b9mlj

$ kubectl port-forward -n prometheus prometheus-grafana-5c5885d488-b9mlj 3000

  • Then open the browser and visit to

http://localhost:3000

  • On the login page, enter admin for username and password.

Top comments (0)