Introduction
kube-state-metrics (KSM) is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects. It is focused on the health of the various objects inside, such as deployments, nodes and pods.
The metrics are exported on the HTTP endpoint /metrics on the listening port (default 8080). They are served as plaintext. They are designed to be consumed either by Prometheus itself or by a scraper that is compatible with scraping a Prometheus client endpoint.
Global Template
Assign following template to Microk8s Master or Microk8s integration resource under Infrastructure > Resources > Microk8s page.
Collector Type: Agent
Category: Application Monitors
G2 Monitor Name: Agent G2 - Linux - Kubernetes State
Global Template Name: Agent G2 - Linux - Kubernetes State
Collected Metrics
Metric Name | Display Name | Description | Units | |
---|---|---|---|---|
kubernetes_state.container.cpu_limit | Container Cpu Limit | The limit on CPU cores to be used by a container. | cpu | |
kubernetes_state.container.cpu_requested | Container Cpu Requested | The number of requested cpu cores by a container. | cpu | |
kubernetes_state.container.memory_limit | Container Memory Limit | The limit on memory to be used by a container. | bytes | |
kubernetes_state.container.memory_requested | Container Memory Requested | The number of requested memory bytes by a container. | ||
kubernetes_state.container.ready | Container Ready | Describes whether the containers readiness check succeeded. | ||
kubernetes_state.container.ready.total | Total Containers Ready | Total containers whose readiness check succeeded. | ||
kubernetes_state.container.restarts | Container Restarts | The number of restarts per container. | ||
kubernetes_state.container.restarts.total | Total Containers Restarts Count | Total containers restarts count . | ||
kubernetes_state.container.running | Container Running | Describes whether the container is currently in running state. | ||
kubernetes_state.container.running.total | Total Containers Running | Total containers currently in running state. | ||
kubernetes_state.container.terminated | Container Terminated | Describes whether the container is currently in terminated state. | ||
kubernetes_state.container.terminated.total | Total Containers Terminated | Total containers currently in terminated state. | ||
kubernetes_state.container.waiting | Container Waiting | Whether the container is currently in waiting state. | ||
kubernetes_state.container.waiting.total | Total Containers Waiting | Total containers currently in waiting state. | ||
kubernetes_state.daemonset.desired | Daemonset Desired | The number of nodes that should be running the daemon pod. | ||
kubernetes_state.daemonset.misscheduled | Daemonset Misscheduled | The number of nodes running a daemon pod but are not supposed to. | ||
kubernetes_state.daemonset.ready | Daemonset Ready | The number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready. | ||
kubernetes_state.daemonset.scheduled | Daemonset Scheduled | The number of nodes running at least one daemon pod and are supposed to. | ||
kubernetes_state.deployment.paused | Deployment Paused | Whether the deployment is paused and will not be processed by the deployment controller. | ||
kubernetes_state.deployment.replicas | Deployment Replicas | The number of replicas per deployment. | ||
kubernetes_state.deployment.replicas_available | Deployment Replicas Available | The number of available replicas per deployment. | ||
kubernetes_state.deployment.replicas_desired | Deployment Replicas Desired | The number of desired replicas per deployment wrong help in kube-state-metrics.cross check. | ||
kubernetes_state.deployment.replicas_unavailable | Deployment Replicas Unavailable | The number of unavailable replicas per deployment. | ||
kubernetes_state.deployment.replicas_updated | Deployment Replicas Updated | The number of updated replicas per deployment. | ||
kubernetes_state.deployment.rollingupdate.max_unavailable | Deployment Rollingupdate Max Unavailable | Maximum number of unavailable replicas during a rolling update of a deployment. | ||
kubernetes_state.node.cpu_allocatable | Node Cpu Allocatable | The CPU resources of a node that are available for scheduling. | ||
kubernetes_state.node.cpu_capacity | Node Cpu Capacity | The total CPU resources of the node. | cpu | |
kubernetes_state.node.memory_allocatable | Node Memory Allocatable | The memory resources of a node that are available for scheduling. | bytes | |
kubernetes_state.node.memory_capacity | Node Memory Capacity | The total memory resources of the node. | bytes | |
kubernetes_state.node.pods_allocatable | Node Pods Allocatable | The pod resources of a node that are available for scheduling. | ||
kubernetes_state.node.pods_capacity | Node Pods Capacity | The total pod resources of the node. | ||
kubernetes_state.node.status | Node Status | The condition of a cluster node.Sum this metric by either status to get the number of nodes in that status. | ||
kubernetes_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, e.g. `condition:true` keeps the pods that are in a ready state. | ||
kubernetes_state.pod.scheduled | Pod Scheduled | Describes the status of the scheduling process for the pod. | ||
kubernetes_state.replicaset.fully_labeled_replicas | Replicaset Fully Labeled Replicas | The number of fully labeled replicas per ReplicaSet. | ||
kubernetes_state.replicaset.replicas | Replicaset Replicas | The number of replicas per ReplicaSet. | ||
kubernetes_state.replicaset.replicas_desired | Replicaset Replicas Desired | Number of desired pods for a ReplicaSet. | ||
kubernetes_state.replicaset.replicas_ready | AuthentReplicaset Replicas Ready | The number of ready replicas per ReplicaSet. | ||
kubernetes_state.resourcequota.limits.cpu.limit | Resourcequota Limits Cpu Limit | Hard limit on the sum of CPU core limits for a resource quota. | cpu | |
kubernetes_state.resourcequota.limits.cpu.used | Resourcequota Limits Cpu Used | Observed sum of limits for CPU cores for a resource quota. | cpu | |
kubernetes_state.resourcequota.limits.memory.limit | Resourcequota Limits Memory Limit | Hard limit on the sum of memory bytes limits for a resource quota. | bytes | |
kubernetes_state.resourcequota.limits.memory.used | Resourcequota Limits Memory Used | Observed sum of limits for memory bytes for a resource quota. | bytes | |
kubernetes_state.resourcequota.persistentvolumeclaims.limit | Resourcequota Persistentvolumeclaims Limit | Hard limit of the number of PVC for a resource quota. | ||
kubernetes_state.resourcequota.persistentvolumeclaims.used | Resourcequota Persistentvolumeclaims Used | Observed number of persistent volume claims used for a resource quota. | ||
kubernetes_state.resourcequota.pods.limit | Resourcequota Pods Limit | Hard limit of the number of pods for a resource quota. | ||
kubernetes_state.resourcequota.pods.used | Resourcequota Pods Used | Observed number of pods used for a resource quota. | ||
kubernetes_state.resourcequota.requests.cpu.limit | Resourcequota Requests Cpu Limit | Hard limit on the total of CPU core requested for a resource quota. | cpu | |
kubernetes_state.resourcequota.requests.cpu.used | Resourcequota Requests Cpu Used | Observed sum of CPU cores requested for a resource quota. | cpu | |
kubernetes_state.resourcequota.requests.memory.limit | Resourcequota Requests Memory Limit | Hard limit on the total of memory bytes requested for a resource quota. | bytes | |
kubernetes_state.resourcequota.requests.memory.used | Resourcequota Requests Memory Used | Observed sum of memory bytes requested for a resource quota. | bytes | |
kubernetes_state.resourcequota.requests.storage.limit | Resourcequota Requests Storage Limit | Hard limit on the total of storage bytes requested for a resource quota. | bytes | |
kubernetes_state.resourcequota.requests.storage.used | Resourcequota Requests Storage Used | Observed sum of storage bytes requested for a resource quota. | bytes | |
kubernetes_state.resourcequota.services.limit | Resourcequota Services Limit | Hard limit of the number of services for a resource quota. | ||
kubernetes_state.resourcequota.services.loadbalancers.limit | Resourcequota Services Loadbalancers Limit | Hard limit of the number of loadbalancers for a resource quota. | ||
kubernetes_state.resourcequota.services.loadbalancers.used | Resourcequota Services Loadbalancers Used | Observed number of loadbalancers used for a resource quota. | ||
kubernetes_state.resourcequota.services.nodeports.limit | Resourcequota Services Nodeports Limit | Hard limit of the number of node ports for a resource quota. | ||
kubernetes_state.resourcequota.services.nodeports.used | Resourcequota Services Nodeports Used | Observed number of node ports used for a resource quota. | ||
kubernetes_state.resourcequota.services.used | Resourcequota Services Used | Observed number of services used for a resource quota. |
Validate
Navigate to Infrastructure > Resources tab to check if your resources are onboarded and the metrics are collected.