Monitor Kubernetes Cluster With Prometheus and Grafana
This LAB has following parts
Promethus
Prometheus is a highly scalable, open-source monitoring framework that offers built-in monitoring capabilities for the Kubernetes container orchestration platform. In the field of observability, it is becoming increasingly popular due to its effective metrics and alerting features.
Key Point of Prometheus
Lets deploy Prometheus on Kubernetes Cluster
Clone the following github repository. This repo has all necessary file that you need to deploy Promethus. This deployment use namespace as monitoring.
kubectl create namespace monitoring
git clone https://github.com/techiescamp/kubernetes-prometheus
kubectl apply -f kubernetes-prometheus
Kube State Metrics
Kube State Metrics is a service that interacts with the Kubernetes API server to gather detailed information about all API objects such as deployments, pods, daemonsets, and statefulsets. It primarily produces metrics in Prometheus format, maintaining the same stability as the Kubernetes API. This service provides metrics for Kubernetes objects and resources that are not directly available from native Kubernetes monitoring components.
Step 1: Clone the Github repo
领英推荐
git clone https://github.com/devopscube/kube-state-metrics-configs.git
kubectl apply -f kube-state-metrics-configs/
kubectl get deployments kube-state-metrics -n kube-system
Need to confirm that the following part is in the promethus config part
- job_name: 'kube-state-metrics'
static_configs:
- targets: ['kube-state-metrics.kube-system.svc.cluster.local:8080']
Grafana
Grafana is an open-source lightweight dashboard tool. It can be integrated with many data sources like Prometheus, AWS cloud watch, Stackdriver, etc. Running Grafana on Kubernetes
Clone Grafana Git repository
git clone https://github.com/bibinwilson/kubernetes-grafana.git
kubectl apply -f kubernetes-grafana/
Now Import Grafana Dashboard
IT System Administrator, Network and Firewall Administrator, Windows and Linux Server Administrator, Hardware Engineer, and Cloud Systems Engineer with DevOps. Lectra Pattern Making Software Solution Engineer.
2 个月Thanks Vaiya