Skip to main content
Version: nightly

Kubernetes cluster state monitoring with Netdata

Kubernetes is an open-source container orchestration system for automating software deployment, scaling, and management.

This module collects health metrics for the following Kubernetes resources:

Requirements

  • Only works when Netdata is running inside a Kubernetes cluster.
  • RBAC: needs list, watch verbs for pod and node resources.
  • RBAC: needs get verb for namespace resource.

Metrics

All metrics have "k8s_state." prefix.

Labels per scope:

  • node: k8s_kind, k8s_cluster_id, k8s_cluster_name, k8s_node_name.
  • pod: all node scope labels + k8s_namespace, k8s_controller_kind, k8s_controller_name, k8s_pod_uid, k8s_pod_name, k8s_qos_class.
  • container: all node/pod scope labels + k8s_container_id, k8s_container_name.

'k8s_cluster_id' value is 'kube-system' namespace UID. 'k8s_cluster_name' currently only appears when running on GKE.

Node

MetricScopeDimensionsUnits
node_allocatable_cpu_requests_utilizationnoderequests%
node_allocatable_cpu_requests_usednoderequestsmillicpu
node_allocatable_cpu_limits_utilizationnodelimits%
node_allocatable_cpu_limits_usednodelimitsmillicpu
node_allocatable_mem_requests_utilizationnoderequests%
node_allocatable_mem_requests_usednoderequestsbytes
node_allocatable_mem_limits_utilizationnodelimits%
node_allocatable_mem_limits_usednodelimitsbytes
node_allocatable_pods_utilizationnodeallocated%
node_allocatable_pods_usagenodeavailable, allocatedpods
node_conditionnodeadded dynamicallystatus
node_schedulabilitynodeschedulable, unschedulablestate
node_pods_readinessnodeready%
node_pods_readiness_statenodeready, unreadypods
node_pods_conditionnodepod_ready, pod_scheduled,
pod_initialized, containers_ready
pods
node_pods_phasenoderunning, failed, succeeded, pendingpods
node_containersnodecontainers, init_containerscontainers
node_containers_statenoderunning, waiting, terminatedcontainers
node_init_containers_statenoderunning, waiting, terminatedcontainers
node_agenodeageseconds
pod_cpu_requests_usedpodrequestsmillicpu
pod_cpu_limits_usedpodlimitsmillicpu
pod_mem_requests_usedpodrequestsbytes
pod_mem_limits_usedpodlimitsbytes
pod_conditionpodpod_ready, pod_scheduled,
pod_initialized, containers_ready
state
pod_phasepodrunning, failed, succeeded, pendingstate
pod_agepodageseconds
pod_containerspodcontainers, init_containerscontainers
pod_containers_statepodrunning, waiting, terminatedcontainers
pod_init_containers_statepodrunning, waiting, terminatedcontainers
pod_container_readiness_statecontainerreadystate
pod_container_restartscontainerrestartsrestarts/s
pod_container_statecontainerrunning, waiting, terminatedstate
pod_container_waiting_state_reasoncontaineradded dynamicallystate
pod_container_terminated_state_reasoncontaineradded dynamicallystate

Configuration

No configuration is needed. This module is enabled when you install Netdata using netdata/helmchart.

Troubleshooting

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].

    cd /usr/libexec/netdata/plugins.d/
  • Switch to the netdata user.

    sudo -u netdata -s
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m k8s_state

Was this page helpful?

Contribute