Prometheus and Grafana setup in Minikube

Hey, I'm a postgraduate in Cyber Security with practical experience in Software Engineering and DevOps Operations. The top player on TryHackMe platform, multilingual speaker (Kazakh, Russian, English, Spanish, and Turkish), curios person, bookworm, geek, sports lover, and just a good guy to speak with!
This article shows how to deploy Prometheus and Grafana into your Minikube cluster using Helm charts. Prometheus is used to monitor Kubernetes Cluster and other resources running on it. Grafana helps to visualize metrics recorded by Prometheus and display them in dashboards.
All installation is done in 'default' namespace.
Start Minikube
minikube start
Install Prometheus
- Add prometheus repository
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts - Install provided Helm chart for Prometheus
helm install prometheus prometheus-community/prometheus - Expose the prometheus-server service via NodePort
kubectl expose service prometheus-server --type=NodePort --target-port=9090 --name=prometheus-server-np - Check services:
kubectl get svc
Access Prometheus UI
- Expose service URL:
minikube service prometheus-server-np --url - Prometheus UI:

Install Grafana
- Add Grafana Helm repo:
helm repo add grafana https://grafana.github.io/helm-charts - Install Grafana chart:
helm install grafana grafana/grafana - Expose Grafana service via NodePort in order to access Grafana UI:
kubectl expose service grafana --type=NodePort --target-port=3000 --name=grafana-np - Check exposed service:
kubectl get servicesGet Grafana admin credentials
kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
Access Grafana Web UI
- Expose Grafana service in minikube:
minikube service grafana-np --url - Access UI and enter admin credentials:

- Add Prometheus data source (use http://prometheus-server:80 URL):

- Import default Prometheus dashboards:

- You can also import community based Grafana dashboards. For example you can use dashboard with
6417id:





