After pulling the files and folders to the local pc /server;
#Install kubectl with --classic flag
sudo snap install kubectl --classic
#Verify installation
kubectl version --client
#Download and install Minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
#Remove the downloaded file
rm minikube-linux-amd64
#Verify installation
minikube version
#Check if Docker is installed
docker --version
#If not installed:
sudo apt update
sudo apt install docker.io -y
#Add your user to docker group (to run without sudo)
sudo usermod -aG docker $USER
#Apply the group change (logout/login or run):
newgrp docker
#Verify Docker works
docker ps
#Start Minikube with Docker driver
minikube start --driver=docker --cpus=4 --memory=8192
#If you get permission errors, try:
minikube start --driver=docker --cpus=4 --memory=8192 --force
#Verify it's running
kubectl get nodes
minikube status
#Navigate to your project
cd /home/thusitha/Documents/github/cms-monitoring # this is my file path, change it to yours.
#Deploy to Kubernetes
kubectl apply -f kubernetes/namespace.yaml
kubectl apply -f kubernetes/monitoring/
#Check status
kubectl get pods -n monitoring -w
#This will automatically open Prometheus in the browser
minikube service prometheus -n monitoring
#In another terminal, open Grafana
minikube service grafana -n monitoring
#or can use port forwarding method
#Terminal 1: Forward Prometheus to localhost
kubectl port-forward -n monitoring svc/prometheus 9090:9090
#Terminal 2: Forward Grafana to localhost
kubectl port-forward -n monitoring svc/grafana 3000:3000
Then open in your browser:
Prometheus: http://localhost:9090
Grafana: http://localhost:3000
Username: admin
Password: admin
go to dashboard> new>import> type this template ID number on space bar 1860 > load