When configuring kube-state-metrics, other than all the required RBAC permissions, there are also several runtime flags to be aware of. We will provide an overview of the more relevant ones for our test case in the following table:
Flag |
Description |
--host |
IP to bind and expose Kubernetes metrics on, defaults to 0.0.0.0 |
--port |
Port to expose Kubernetes metrics, defaults to 80 |
--telemetry-host |
IP to expose internal metrics, defaults to 0.0.0.0 |
--telemetry-port |
Port to expose internal metrics, defaults to 80 |
--collectors |
Comma-separated list of metrics groups to enable, defaults to ConfigMap, CronJobs, DaemonSets, Deployments, endpoints, horizontalpodautoscalers, Jobs, LimitRanges, namespaces, Nodes, PersistentVolumeClaims, PersistentVolumes, PodDisruptionBudgets, pods, ReplicaSets, ReplicationControllers, resource quotas, Secrets, services, StatefulSets |
--metric-blacklist |
Comma-separated list of metrics to disable, mutually exclusive with the whitelist |
--metric-whitelist |
Comma-separated list of metrics to enable, mutually exclusive with the blacklist |