This guide will help you set up Prometheus and Grafana in your Minikube cluster using Helm.
Make sure you have the following prerequisites installed:
- Minikube
- Helm 3
If you already have Docker installed and want to remove it, you can use the following commands:
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
-
Install
yum-utils
package:sudo yum install -y yum-utils
-
Add Docker repository:
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
-
Install Docker packages:
sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
-
Start Docker service:
sudo systemctl start docker
-
Download Minikube binary:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
-
Install Minikube:
sudo rpm -Uvh minikube-latest.x86_64.rpm
-
Start Minikube cluster:
minikube start
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
1.Download the latest release with the command:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
2.Install kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install prometheus prometheus-community/prometheus
kubectl expose service prometheus-server --type=NodePort --target-port=9090 --name=prometheus-server-np
helm repo add grafana https://grafana.github.io/helm-charts
helm install grafana grafana/grafana
kubectl expose service grafana --type=NodePort --target-port=3000 --name=grafana-np