What is Kube State Metrics?Important metrics you can get from Kube state metrics.Kube State Metrics SetupStep 1: Clone the Github repoStep 2: Create all the objects by pointing to the cloned directory.Step 3: Check the deployment status using the following command.
What is Kube State Metrics?
- a service that talks to the Kubernetes API server to get all the details about all the API objects like
deployments
,pods
,daemonsets
,Statefulsets
, etc.
- Kube state metrics service exposes all the metrics on
/metrics
URI. Prometheus can scrape all the metrics exposed by Kube state metrics.
Important metrics you can get from Kube state metrics.
- Node status, node capacity (CPU and memory)
- Replica-set compliance (desired/available/unavailable/updated status of replicas per deployment)
- Pod status (waiting, running, ready, etc)
- Ingress metrics
- PV, PVC metrics
- Daemonset & Statefulset metrics.
- Resource requests and limits.
- Job & Cronjob metrics
Kube State Metrics Setup
Step 1: Clone the Github repo
git clone https://github.com/devopscube/kube-state-metrics-configs.git
Step 2: Create all the objects by pointing to the cloned directory.
microk8s kubectl apply -f kube-state-metrics-configs/
Step 3: Check the deployment status using the following command.
microk8s kubectl get deployments kube-state-metrics -n kube-system
再來就可以來看 Grafana 的設置了!