Skip to content

G11-Engineering/cms_monitoring_kubernetes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

After pulling the files and folders to the local pc /server;

1.install kubernetes

#Install kubectl with --classic flag

sudo snap install kubectl --classic

#Verify installation

kubectl version --client

2. Install Minikube

#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

3.Install docker

#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

4. start minicube

#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

5.To deploy monitoring stack;

#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

6. to open prometheus and grafana

#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

7. to add monitoring template( node exporter full)

go to dashboard> new>import> type this template ID number on space bar 1860 > load

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors