| | 1 | '''Monitoring''' |
| | 2 | Install helm3 on master node |
| | 3 | |
| | 4 | {{{ |
| | 5 | curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 |
| | 6 | chmod 700 get_helm.sh |
| | 7 | ./get_helm.sh |
| | 8 | }}} |
| | 9 | |
| | 10 | Add the Helm Stable Charts for your local client. |
| | 11 | |
| | 12 | `helm repo add stable https://charts.helm.sh/stable` |
| | 13 | |
| | 14 | Add prometheus Helm repo |
| | 15 | |
| | 16 | {{{ |
| | 17 | helm repo add prometheus-community https://prometheus-community.github.io/helm-charts |
| | 18 | helm search repo prometheus-community |
| | 19 | }}} |
| | 20 | |
| | 21 | Create Prometheus namespace |
| | 22 | |
| | 23 | `kubectl create namespace Prometheus` |
| | 24 | |
| | 25 | Install kube-prometheus-stack |
| | 26 | |
| | 27 | Below is the helm command to install kube-prometheus-stack. This installation formally called prometheus-operator also comes with a grafana deployment embedded. |
| | 28 | |
| | 29 | `helm install stable prometheus-community/kube-prometheus-stack -n Prometheus` |
| | 30 | |
| | 31 | In order to make prometheus and grafana available outside the cluster, use NodePort instead of ClusterIP. |
| | 32 | {{{ |
| | 33 | kubectl edit svc stable-kube-prometheus-sta-prometheus -n Prometheus |
| | 34 | kubectl edit svc stable-grafana -n Prometheus |
| | 35 | }}} |
| | 36 | |
| | 37 | Search type: LoadBalancer and change it to type: NodePort. |
| | 38 | |
| | 39 | {{{ |
| | 40 | kubectl get svc -n prometheus NAME |
| | 41 | |
| | 42 | |
| | 43 | }}} |
| | 44 | |
| | 45 | log into stable-grafana from your PC. Use node port. Username/Password: admin / prom-operator |
| | 46 | |
| | 47 | How to Create Kubernetes Monitoring Dashboard? |
| | 48 | |
| | 49 | For creating a dashboard to monitor the cluster: |
| | 50 | |
| | 51 | Click ‘+’ button on left panel and select ‘Import’. |
| | 52 | |
| | 53 | Enter 12740 dashboard id under Grafana.com Dashboard. |
| | 54 | |
| | 55 | Click ‘Load’. |
| | 56 | |
| | 57 | Select ‘Prometheus’ as the endpoint under prometheus data sources drop down. Click ‘Import’. |
| | 58 | |
| | 59 | This will show monitoring dashboard for all cluster nodes |
| | 60 | |
| | 61 | How to Create Kubernetes Cluster Monitoring Dashboard? |
| | 62 | |
| | 63 | For creating a dashboard to monitor the cluster: |
| | 64 | |
| | 65 | Click ‘+’ button on left panel and select ‘Import’. |
| | 66 | |
| | 67 | Enter 3119 dashboard id under Grafana.com Dashboard. |
| | 68 | |
| | 69 | Click ‘Load’. |
| | 70 | |
| | 71 | Select ‘Prometheus’ as the endpoint under prometheus data sources drop down. Click ‘Import’. |
| | 72 | |
| | 73 | This will show monitoring dashboard for all cluster nodes |
| | 74 | |
| | 75 | Create POD Monitoring Dashboard :- |
| | 76 | |
| | 77 | For creating a dashboard to monitor the cluster: |
| | 78 | |
| | 79 | Click ‘+’ button on left panel and select ‘Import’. |
| | 80 | |
| | 81 | Enter 6417 dashboard id under Grafana.com Dashboard. |
| | 82 | |
| | 83 | Click ‘Load’. |
| | 84 | |
| | 85 | Select ‘Prometheus’ as the endpoint under prometheus data sources drop down. Click ‘Import’. |
| | 86 | |
| | 87 | |
| | 88 | |
| | 89 | |
| | 90 | |
| | 91 | |
| | 92 | |
| | 93 | |
| | 94 | |
| | 95 | |
| | 96 | |