Project: Netdata (Observability and Analysis / Observability)
File: kubernetes_cluster_state.md

<!--startmeta customediturl: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/k8s_state/README.md" metayaml: "https://github.com/netdata/netdata/edit/master/src/go/collectors/go.d.plugin/modules/k8sstate/metadata.yaml" sidebar_label: "Kubernetes Cluster State" learn_status: "Published" learnrelpath: "Collecting Metrics/Kubernetes" most_popular: True message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" endmeta--> <img src="https://netdata.cloud/img/kubernetes.svg" width="150"/> Plugin: go.d.plugin Module: k8s_state <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> This collector monitors Kubernetes Nodes, Pods and Containers. This collector is supported on all platforms. This collector only supports collecting metrics from a single instance of this integration. This integration doesn't support auto-detection. The default configuration for this integration does not impose any limits on data collection. The default configuration for this integration is not expected to impose a significant performance impact on the system. Metrics grouped by scope. The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. These metrics refer to the Node. Labels: | Label | Description | |:--|:-| | k8sclusterid | Cluster ID. This is equal to the kube-system namespace UID. | | k8sclustername | Cluster name. Cluster name discovery only works in GKE. | | k8snodename | Node name. | Metrics: | Metric | Dimensions | Unit | |:|:-|:-| | k8sstate.nodeallocatablecpurequests_utilization | requests | % | | k8sstate.nodeallocatablecpurequests_used | requests | millicpu | | k8sstate.nodeallocatablecpulimits_utilization | limits | % | | k8sstate.nodeallocatablecpulimits_used | limits | millicpu | | k8sstate.nodeallocatablememrequests_utilization | requests | % | | k8sstate.nodeallocatablememrequests_used | requests | bytes | | k8sstate.nodeallocatablememlimits_utilization | limits | % | | k8sstate.nodeallocatablememlimits_used | limits | bytes | | k8sstate.nodeallocatablepodsutilization | allocated | % | | k8sstate.nodeallocatablepodsusage | available, allocated | pods | | k8sstate.nodecondition | a dimension per condition | status | | k8sstate.nodeschedulability | schedulable, unschedulable | state | | k8sstate.nodepods_readiness | ready | % | | k8sstate.nodepodsreadinessstate | ready, unready | pods | | k8sstate.nodepodscondition | podready, podscheduled, podinitialized, containers_ready | pods | | k8sstate.nodepods_phase | running, failed, succeeded, pending | pods | | k8sstate.nodecontainers | containers, init_containers | containers | | k8sstate.nodecontainers_state | running, waiting, terminated | containers | | k8sstate.nodeinitcontainersstate | running, waiting, terminated | containers | | k8sstate.nodeage | age | seconds | These metrics refer to the Pod. Labels: | Label | Description | |:--|:-| | k8sclusterid | Cluster ID. This is equal to the kube-system namespace UID. | | k8sclustername | Cluster name. Cluster name discovery only works in GKE. | | k8snodename | Node name. | | k8s_namespace |

| | k8scontrollerkind | Controller kind (ReplicaSet, DaemonSet, StatefulSet, Job, etc.). | | k8scontrollername | Controller name. | | k8spodname | Pod name. | | k8sqosclass | Pod QOS class (burstable, guaranteed, besteffort). | Metrics: | Metric | Dimensions | Unit | |:|:-|:-| | k8sstate.podcpurequestsused | requests | millicpu | | k8sstate.podcpulimitsused | limits | millicpu | | k8sstate.podmemrequestsused | requests | bytes | | k8sstate.podmemlimitsused | limits | bytes | | k8sstate.podcondition | podready, podscheduled, podinitialized, containersready | state | | k8sstate.podphase | running, failed, succeeded, pending | state | | k8sstate.podage | age | seconds | | k8sstate.podcontainers | containers, init_containers | containers | | k8sstate.podcontainers_state | running, waiting, terminated | containers | | k8sstate.podinitcontainersstate | running, waiting, terminated | containers | These metrics refer to the Pod container. Labels: | Label | Description | |:--|:-| | k8sclusterid | Cluster ID. This is equal to the kube-system namespace UID. | | k8sclustername | Cluster name. Cluster name discovery only works in GKE. | | k8snodename | Node name. | | k8s_namespace | Namespace. | | k8scontrollerkind | Controller kind (ReplicaSet, DaemonSet, StatefulSet, Job, etc.). | | k8scontrollername | Controller name. | | k8spodname | Pod name. | | k8sqosclass | Pod QOS class (burstable, guaranteed, besteffort). | | k8scontainername | Container name. | Metrics: | Metric | Dimensions | Unit | |:|:-|:-| | k8sstate.podcontainerreadinessstate | ready | state | | k8sstate.podcontainer_restarts | restarts | restarts | | k8sstate.podcontainer_state | running, waiting, terminated | state | | k8sstate.podcontainerwaitingstate_reason | a dimension per reason | state | | k8sstate.podcontainerterminatedstate_reason | a dimension per reason | state | There are no alerts configured by default for this integration. No action required. The configuration file name for this integration is `go.d/k8s_state.conf`. You can edit the configuration file using the `edit-config` script from the Netdata . ```bash cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata sudo ./edit-config go.d/k8s_state.conf ``` There are no configuration options. There are no configuration examples. To troubleshoot issues with the `k8s_state` collector, run the `go.d.plugin` with the debug option enabled. The output should give you clues as to why the collector isn't working. Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. ```bash cd /usr/libexec/netdata/plugins.d/ ``` Switch to the `netdata` user. ```bash sudo -u netdata -s ``` Run the `go.d.plugin` to debug the collector: ```bash ./go.d.plugin -d -m k8s_state ```