wiki:k8smonitoring2023

Monitoring

Install helm3 on master node

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

Add the Helm Stable Charts for your local client.

helm repo add stable https://charts.helm.sh/stable

Add prometheus Helm repo

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

Create Prometheus namespace

kubectl create namespace prometheus

Install kube-prometheus-stack

Below is the helm command to install kube-prometheus-stack. This installation formally called prometheus-operator also comes with a grafana deployment embedded.

helm install stable prometheus-community/kube-prometheus-stack -n prometheus

In order to make prometheus and grafana available outside the cluster, use NodePort or LoadBalancer instead of !ClusterIP.

Search type: ClusterIP and change it to type: NodePort on

kubectl edit svc stable-kube-prometheus-sta-prometheus -n prometheus

and kubectl edit svc stable-grafana -n prometheus

kubectl get svc -n prometheus


log into stable-grafana from your PC. Use node port. Username/Password: admin / prom-operator

[OPTIONAL] How to Create Kubernetes Monitoring Dashboard?

For creating a dashboard to monitor the cluster:

Click ‘+’ button on left panel and select ‘Import’.

Enter 12740 dashboard id under Grafana.com Dashboard.

Click ‘Load’.

Select ‘Prometheus’ as the endpoint under prometheus data sources drop down. Click ‘Import’.

This will show monitoring dashboard for all cluster nodes

How to Create Kubernetes Cluster Monitoring Dashboard?

For creating a dashboard to monitor the cluster:

Click ‘+’ button on left panel and select ‘Import’.

Enter 3119 dashboard id under Grafana.com Dashboard.

Click ‘Load’.

Select ‘Prometheus’ as the endpoint under prometheus data sources drop down. Click ‘Import’.

This will show monitoring dashboard for all cluster nodes

Create POD Monitoring Dashboard :-

For creating a dashboard to monitor the cluster:

Click ‘+’ button on left panel and select ‘Import’.

Enter 6417 dashboard id under Grafana.com Dashboard.

Click ‘Load’.

Select ‘Prometheus’ as the endpoint under prometheus data sources drop down. Click ‘Import’.

Last modified 13 months ago Last modified on Dec 8, 2023, 3:49:07 PM
Note: See TracWiki for help on using the wiki.