A logo showing the text blog.marcnuri.com
Español
Home»Operations»Prometheus and Grafana setup in Minikube

Recent Posts

  • Fabric8 Kubernetes Client 7.2 is now available!
  • Connecting to an MCP Server from JavaScript using AI SDK
  • Connecting to an MCP Server from JavaScript using LangChain.js
  • The Future of Developer Tools: Adapting to Machine-Based Developers
  • Connecting to a Model Context Protocol (MCP) Server from Java using LangChain4j

Categories

  • Artificial Intelligence
  • Front-end
  • Go
  • Industry and business
  • Java
  • JavaScript
  • Legacy
  • Operations
  • Personal
  • Pet projects
  • Tools

Archives

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • August 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • September 2019
  • July 2019
  • March 2019
  • November 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • December 2017
  • July 2017
  • January 2017
  • December 2015
  • November 2015
  • December 2014
  • March 2014
  • February 2011
  • November 2008
  • June 2008
  • May 2008
  • April 2008
  • January 2008
  • November 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007

Prometheus and Grafana setup in Minikube

2020-10-13 in Operations tagged Grafana / Helm / Kubernetes / Metrics / Monitoring / Prometheus by Marc Nuri | Last updated: 2023-09-20
Versión en Español

Introduction

In this post, I will show you how to deploy Prometheus and Grafana into your Minikube cluster using their provided Helm charts. Prometheus will help us monitor our Kubernetes Cluster and other resources running on it. Grafana will help us visualize metrics recorded by Prometheus and display them in fancy dashboards.

Note

Post last updated on 2023-09-20, thanks to Dennis Eller for his input.

Requirements

  • Minikube
  • Helm

Install Prometheus

The stable channel Prometheus charts have been deprecated in favor of the Prometheus Community Kubernetes Helm Charts.

We'll start by adding the repository to our helm configuration:

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

Once the repo is ready, we can install the provided charts by running the following commands:

helm install prometheus prometheus-community/prometheus
kubectl expose service prometheus-server --type=NodePort --target-port=9090 --name=prometheus-server-np

The first command installs the charts. It will take a while until everything gets deployed, we can check the status by running:

kubectl get pods -l app.kubernetes.io/instance=prometheus

Since we are using Minikube, the second command exposes the prometheus-server Service using a NodePort. This way we can now easily access the Prometheus web interface when the Pod is ready:

minikube service prometheus-server-np

This will open a browser window with the Prometheus web interface.

Prometheus Web Interface in Minikube
Prometheus Web Interface in Minikube

Install Grafana

As with Prometheus, the stable channel official Helm charts for Grafana have been deprecated. The recommended charts are the ones hosted by the Grafana Community Kubernetes Helm Charts repository.

Same as before, we'll start by adding the repository to our helm configuration:

helm repo add grafana https://grafana.github.io/helm-charts

Next, we install Grafana by using the provided charts:

helm install grafana grafana/grafana
kubectl expose service grafana --type=NodePort --target-port=3000 --name=grafana-np

Again, since we are using Minikube, in order to easily access Grafana's Web interface we expose the service as a NodePort.

Note: Grafana is password protected by default, in order to retrieve the admin user password we can run the following command:

kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo

We can now load the Grafana web interface using the admin user and the password retrieved:

minikube service grafana-np
Grafana Login Web Interface in Minikube
Grafana Login Web Interface in Minikube

Configure Prometheus Datasource

Once we're logged in to the admin interface, it's time to configure the Prometheus Datasource.

We need to head to Connections > Datasources and add a new Prometheus instance.

Grafana Add Prometheus Datasource
Grafana Add Prometheus Datasource

The URL for our Prometheus instance is the name of the service http://prometheus-server:80.

Kubernetes Dashboard bootstrap

Next, we'll set up one of the many already available community provided Kubernetes Dashboards.

For this blog post I will be using this one https://grafana.com/grafana/dashboards/6417, but you can use any other Dashboard. You can even create your own very easily, but this will be covered in another post.

We head to Create (+) > Import section to Import via grafana.com and we set 6417 into the id field and click Load.

Grafana Import Dashboard from grafana.com
Grafana Import Dashboard from grafana.com

In the dashboard configuration we need to select the Prometheus Datasource we created in the earlier step.

Grafana import dashboard - configure Datasource
Grafana import dashboard - configure Datasource

Once we confirm the Import dialog, we'll be redirected to the new Dashboard.

Kubernetes Cluster (Prometheus)
Kubernetes Cluster (Prometheus)

If everything went well, you'll be able to see your cluster's information in the Dashboard.

Conclusion

In this post, I've shown you how to install both Prometheus and Grafana into a Minikube cluster. You can use the same procedure to do the same in any Kubernetes flavored cluster. I've also explained how to deploy one of the grafana.com community dashboards simply by using its ID.

Hopefully this article will help you get started with Prometheus and Grafana and you’ll soon be able to create your own Dashboards and Panels.

If you're interested in dashboards and other ways to visualize your Kubernetes cluster resources, be sure to check out YAKC – Kubernetes Dashboard.

Twitter iconFacebook iconLinkedIn iconPinterest iconEmail icon

Comments in "Prometheus and Grafana setup in Minikube"

  • Avatar for Guy Cole
    Guy Cole
    2021-02-10 04:02
    Thank you for the clear post w/working examples and nice screenshots.
  • Avatar for SUJIT GANGADHARAN
    SUJIT GANGADHARAN
    2021-05-09 17:25
    Thank you for this setup instructions. Really helpful.

Post navigation
Eclipse JKube introduction: Java tools and plugins for Kubernetes and OpenShiftRollout Restart Kubernetes Deployment from Java using YAKC
© 2007 - 2025 Marc Nuri