kube-state-metrics
kube-state-metrics 的作用?
一句话概括,Add-on agent to generate and expose cluster-level metrics.
kube-state-metrics 暴露那些对象的指标?
- CronJob Metrics
- DaemonSet Metrics
- Deployment Metrics
- Job Metrics
- LimitRange Metrics
- ode Metrics
- PersistentVolume Metrics
- PersistentVolumeClaim Metrics
- Pod Metrics
- ReplicaSet Metrics
- ReplicationController Metrics
- ResourceQuota Metrics
- Service Metrics
- StatefulSet Metrics
- Namespace Metrics
- Horizontal Pod Autoscaler Metrics
- Endpoint Metrics
如何CURL手动获取metrics暴露的指标数据?
# APISERVER=$(kubectl config view --minify | grep server | cut -f 2- -d ":" | tr -d " ")
# TOKEN=$(kubectl describe secret -n kube-system $(kubectl get secrets -n kube-system | grep ^dashboard | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d " ")
# curl --header "Authorization: Bearer $TOKEN" --insecure "http://10.111.162.5:8080/metrics"