kube-state-metrics have the same grade of stability as the Kubernetes API objects themselves. In turn, this means that kube-state-metrics in certain situations may not show the exact same values as kubectl as kubectl applies certain heuristics to display comprehensible messages. kube-state-metrics exposes the unmodified raw data from the Kubernetes API. Therefore, the users have all the data they require and perform heuristics as required.
The metrics are exported on the HTTP endpoint /metrics on the listening port (default 8080) and are served as plaintext. The metrics are designed to be consumed either by Prometheus itself or by a scraper that is compatible with scraping a Prometheus client endpoint. You can also open /metrics in a browser to see the raw metrics. Note that the metrics exposed on the /metrics endpoint reflect the current state of the Kubernetes cluster. When Kubernetes objects are deleted they are no longer visible on the /metrics endpoint.
Prerequisite
Use of the following service for kube-state so that the agent can discover kube-state.
Note: Ensure that clusterIP is not None.
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/version: 2.0.0-alpha.3
name: kube-state-metrics
namespace: kube-system
spec:
ports:
- name: http-metrics
port: 8080
targetPort: http-metrics
- name: telemetry
port: 8081
targetPort: telemetry
selector:
app.kubernetes.io/name: kube-state-metrics
Validate
Go to Resources under the Infrastructure tab to check if your resources are onboarded and the metrics are collected.
Metrics
OpsRamp Metric | Metric Display Name | Unit | Description |
---|---|---|---|
kube_state_daemonset_desired | Daemonset Desired | Number of nodes that should be running the daemon POD | |
kube_state_daemonset_misscheduled | Daemonset Misscheduled | Number of nodes running a daemon POD but are not supposed to | |
kube_state_daemonset_ready | Daemonset Ready | Number of nodes that should be running the daemon POD and have one or more of the daemon pod running and ready | |
kube_state_daemonset_scheduled | Daemonset Currently Scheduled | Number of nodes running at least one daemon POD and are supposed to | |
kube_state_daemonset_updated | Daemonset Updated Spec Scheduled | The total number of nodes that are running updated daemon POD | |
kube_state_deployment_paused | Deployment Paused | The deployment is paused and will not be processed by the deployment controller | |
kube_state_deployment_replicas | Deployment Replicas | Number of replicas per deployment | |
kube_state_deployment_replicas_available | Deployment Replicas Available | Number of available replicas per deployment | |
kube_state_deployment_replicas_desired | Deployment Replicas Desired | Number of desired replicas per deployment | |
kube_state_deployment_replicas_unavailable | Deployment Replicas Unavailable | Number of unavailable replicas per deployment | |
kube_state_deployment_replicas_updated | Deployment Replicas Updated | Number of updated replicas per deployment | |
kube_state_deployment_rollingupdate_max_unavailable | Deployment Rollingupdate Max Unavailable | Maximum number of unavailable replicas during a rolling update of a deployment | |
kube_state_deployment_rollingupdate_max_surge | Deployment Rollingupdate Max Surge | Maximum number of replicas that can be scheduled above the desired number of replicas during a rolling update of a deployment | |
kube_state_endpoint_address_available | Addresses Available In Endpoint | Number of addresses available in endpoint | |
kube_state_endpoint_address_not_ready | Addresses Not Ready In Endpoint | Number of addresses not ready in endpoint | |
kube_state_endpoint_created | Enpoint Creation Timestamp | Timestamp of UNIX creation | |
kube_state_job_status_failed | Jobs Failed Per POD | Number of PODs that reached the phase failed for a job | |
kube_state_job_status_succeeded | Jobs Succeeded Per POD | Number of PODs that reached the phase succeeded for a job | |
kube_state_node_cpu_capacity | Node Cpu Capacity | Total CPU resources of the node | |
kube_state_node_cpu_allocatable | Node Cpu Allocatable | CPU resources of a node that are available for scheduling | |
kube_state_node_memory_capacity | Node Memory Capacity | Total memory resources of the node | |
kube_state_node_memory_allocatable | Node Memory Allocatable | Memory resources of a node that are available for scheduling | |
kube_state_node_pods_allocatable | Node Pods Allocatable | POD resources of a node that are available for scheduling | |
kube_state_node_pods_capacity | Node Pods Capacity | Total POD resources of the node | |
kube_state_node_status | Node Status | Condition of a cluster node. Sum this metric by either status to get the number of nodes in that status | |
kube_state_nodes_by_condition | Node Status By Condition | Sum by `condition` and `status` to get number of nodes in a given condition | |
kube_state_pod_ready | POD Ready | Describes whether the POD is ready to serve requests. In association with the `condition` tag, whether the POD is ready to serve requests, for example, `condition:true` keeps the pods that are in a ready state | |
kube_state_pod_scheduled | POD Scheduled | Describes the status of the scheduling process for the POD | |
kube_state_container_cpu_limit | Container Cpu Limit | Limit on CPU cores to be used by a container | |
kube_state_container_cpu_requested | Container Cpu Requested | Number of requested CPU cores by a container | |
kube_state_container_memory_limit | Container Memory Limit | bytes | Limit on memory to be used by a container |
kube_state_container_memory_requested | Container Memory Requested | Number of requested memory bytes by a container | |
kube_state_container_ready | Container Ready | Ckeck the readiness of the container | |
kube_state_container_restarts | Container Restarts | Number of restarts per container | |
kube_state_container_running | Container Running | Checks if the container is running | |
kube_state_container_terminated | Container Terminated | Checks if the container is currently in terminated state | |
kube_state_container_waiting | Container Waiting | Checks if the container is currently in waiting state | |
kube_state_pdb_pods_desired | PDB Desired Healthy Pods | Minimum desired number of healthy pods | |
kube_state_pdb_disruptions_allowed | PDB Disruptions Allowed | Number of POD disruptions that are currently allowed | |
kube_state_pdb_pods_healthy | PDB Healthy Pods | Current number of healthy pods | |
kube_state_pdb_pods_total | PDB Pods Total | Total number of pods counted by this disruption budget | |
kube_state_replicaset_fully_labeled_replicas | Replicaset Fully Labeled Replicas | Number of fully labeled replicas per ReplicaSet | |
kube_state_replicaset_replicas | Replicaset Replicas | Number of replicas per ReplicaSet | |
kube_state_replicaset_replicas_desired | Replicaset Replicas Desired | Number of desired pods for a ReplicaSet | |
kube_state_replicaset_replicas_ready | Replicaset Replicas Ready | Number of ready replicas per ReplicaSet | |
kube_state_replicationcontroller_replicas | ReplicationController Replicas | Number of replicas per ReplicationController | |
kube_state_replicationcontroller_fully_labeled_replicas | ReplicationController Fully Labeled | Number of fully labeled replicas per ReplicationController | |
kube_state_replicationcontroller_replicas_ready | ReplicationController Ready | Number of ready replicas per ReplicationController | |
kube_state_replicationcontroller_replicas_desired | ReplicationController Desired | Number of desired pods for a ReplicationController | |
kube_state_replicationcontroller_replicas_available | ReplicationController Available | Number of available replicas per ReplicationController | |
kube_state_statefulset_replicas | StatefulSet Replicas | Number of replicas per StatefulSet | |
kube_state_statefulset_replicas_desired | StatefulSet Desired Pods | Number of desired PODs for a StatefulSet | |
kube_state_statefulset_replicas_current | StatefulSet Current Replicas | Number of current replicas per StatefulSet | |
kube_state_statefulset_replicas_ready | StatefulSet Ready Replicas | Number of ready replicas per StatefulSet | |
kube_state_statefulset_replicas_updated | StatefulSet Updated Replicas | Number of updated replicas per StatefulSet | |
kube_state_resourcequota_limits_cpu_limit | Resourcequota Limits Cpu Limit | Hard limit on the sum of CPU core limits for a resource quota | |
kube_state_resourcequota_limits_cpu_used | Resourcequota Limits Cpu Used | Observed sum of limits for CPU cores for a resource quota | |
kube_state_resourcequota_limits_memory_limit | Resourcequota Limits Memory Limit | Hard limit on the sum of memory bytes limits for a resource quota | |
kube_state_resourcequota_limits_memory_used | Resourcequota Limits Memory Used | Observed sum of limits for memory bytes for a resource quota | |
kube_state_resourcequota_persistentvolumeclaims_limit | Resourcequota Persistentvolumeclaims Limit | Hard limit of the number of PVC for a resource quota | |
kube_state_resourcequota_persistentvolumeclaims_used | Resourcequota Persistentvolumeclaims Used | Observed number of persistent volume claims used for a resource quota | |
kube_state_resourcequota_pods_limit | Resourcequota Pods Limit | Hard limit of the number of pods for a resource quota | |
kube_state_resourcequota_pods_used | Resourcequota Pods Used | Observed number of pods used for a resource quota | |
kube_state_resourcequota_requests_cpu_limit | Resourcequota Requests Cpu Limit | Hard limit on the total of CPU core requested for a resource quota | |
kube_state_resourcequota_requests_cpu_used | Resourcequota Requests Cpu Used | Observed sum of CPU cores requested for a resource quota | |
kube_state_resourcequota_requests_memory_limit | Resourcequota Requests Memory Limit | Hard limit on the total of memory bytes requested for a resource quota | |
kube_state_resourcequota_requests_memory_used | Resourcequota Requests Memory Used | Observed sum of memory bytes requested for a resource quota | |
kube_state_resourcequota_requests_storage_limit | Resourcequota Requests Storage Limit | Hard limit on the total of storage bytes requested for a resource quota | |
kube_state_resourcequota_requests_storage_used | Resourcequota Requests Storage Used | Observed sum of storage bytes requested for a resource quota | |
kube_state_resourcequota_services_limit | Resourcequota Services Limit | Hard limit of the number of services for a resource quota | |
kube_state_resourcequota_services_loadbalancers_limit | Resourcequota Services Loadbalancers Limit | Hard limit of the number of loadbalancers for a resource quota | |
kube_state_resourcequota_services_loadbalancers_used | Resourcequota Services Loadbalancers Used | Observed number of loadbalancers used for a resource quota | |
kube_state_resourcequota_services_nodeports_limit | Resourcequota Services Nodeports Limit | Hard limit of the number of node ports for a resource quota | |
kube_state_resourcequota_services_nodeports_used | Resourcequota Services Nodeports Used | Observed number of node ports used for a resource quota | |
kube_state_resourcequota_services_used | Resourcequota Services Used | Observed number of services used for a resource quota | |
kube_state_limitrange_cpu_min | LimitRange CPU Min | Minimum CPU request for this type | |
kube_state_limitrange_cpu_max | LimitRange CPU Max | Maximum CPU limit for this type | |
kube_state_limitrange_cpu_default | LimitRange CPU Default | Default CPU limit if not specified | |
kube_state_limitrange_cpu_default_request | LimitRange CPU Default Request | Default CPU request if not specified | |
kube_state_limitrange_cpu_max_limit_request_ratio | LimitRange CPU Max Limit Request Ratio | Maximum CPU limit / request ratio | |
kube_state_limitrange_memory_min | LimitRange Memory Min | Minimum memory request for this type | |
kube_state_limitrange_memory_max | LimitRange Memory Max | Maximum memory limit for this type | |
kube_state_limitrange_memory_default | LimitRange Memory Default | Default memory limit if not specified | |
kube_state_limitrange_memory_default_request | LimitRange Memory Default Request | Default memory request if not specified | |
kube_state_limitrange_memory_max_limit_request_ratio | LimitRange Memory Max Limit Request Ratio | Maximum memory limit / request ratio | |
kube_state_hpa_min_replicas | HPA Min Replicas | Lower limit for the number of pods that can be set by the autoscaler, default 1 | |
kube_state_hpa_max_replicas | HPA Max Replicas | Upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas | |
kube_state_hpa_desired_replicas | HPA Desired Replicas | Desired number of replicas of pods managed by this autoscaler | |
kube_state_hpa_condition | HPA Condition | Condition of autoscaler |