DEV Community

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

Posted on • Edited on

1 2

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.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more