github.com/netdata/go.d.plugin@v0.58.1/modules/k8s_state/integrations/kubernetes_cluster_state.md (about) 1 <!--startmeta 2 custom_edit_url: "https://github.com/netdata/go.d.plugin/edit/master/modules/k8s_state/README.md" 3 meta_yaml: "https://github.com/netdata/go.d.plugin/edit/master/modules/k8s_state/metadata.yaml" 4 sidebar_label: "Kubernetes Cluster State" 5 learn_status: "Published" 6 learn_rel_path: "Data Collection/Kubernetes" 7 most_popular: True 8 message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE" 9 endmeta--> 10 11 # Kubernetes Cluster State 12 13 14 <img src="https://netdata.cloud/img/kubernetes.svg" width="150"/> 15 16 17 Plugin: go.d.plugin 18 Module: k8s_state 19 20 <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" /> 21 22 ## Overview 23 24 This collector monitors Kubernetes Nodes, Pods and Containers. 25 26 27 28 29 This collector is supported on all platforms. 30 31 This collector only supports collecting metrics from a single instance of this integration. 32 33 34 ### Default Behavior 35 36 #### Auto-Detection 37 38 This integration doesn't support auto-detection. 39 40 #### Limits 41 42 The default configuration for this integration does not impose any limits on data collection. 43 44 #### Performance Impact 45 46 The default configuration for this integration is not expected to impose a significant performance impact on the system. 47 48 49 ## Metrics 50 51 Metrics grouped by *scope*. 52 53 The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels. 54 55 56 57 ### Per node 58 59 These metrics refer to the Node. 60 61 Labels: 62 63 | Label | Description | 64 |:-----------|:----------------| 65 | k8s_cluster_id | Cluster ID. This is equal to the kube-system namespace UID. | 66 | k8s_cluster_name | Cluster name. Cluster name discovery only works in GKE. | 67 | k8s_node_name | Node name. | 68 69 Metrics: 70 71 | Metric | Dimensions | Unit | 72 |:------|:----------|:----| 73 | k8s_state.node_allocatable_cpu_requests_utilization | requests | % | 74 | k8s_state.node_allocatable_cpu_requests_used | requests | millicpu | 75 | k8s_state.node_allocatable_cpu_limits_utilization | limits | % | 76 | k8s_state.node_allocatable_cpu_limits_used | limits | millicpu | 77 | k8s_state.node_allocatable_mem_requests_utilization | requests | % | 78 | k8s_state.node_allocatable_mem_requests_used | requests | bytes | 79 | k8s_state.node_allocatable_mem_limits_utilization | limits | % | 80 | k8s_state.node_allocatable_mem_limits_used | limits | bytes | 81 | k8s_state.node_allocatable_pods_utilization | allocated | % | 82 | k8s_state.node_allocatable_pods_usage | available, allocated | pods | 83 | k8s_state.node_condition | a dimension per condition | status | 84 | k8s_state.node_schedulability | schedulable, unschedulable | state | 85 | k8s_state.node_pods_readiness | ready | % | 86 | k8s_state.node_pods_readiness_state | ready, unready | pods | 87 | k8s_state.node_pods_condition | pod_ready, pod_scheduled, pod_initialized, containers_ready | pods | 88 | k8s_state.node_pods_phase | running, failed, succeeded, pending | pods | 89 | k8s_state.node_containers | containers, init_containers | containers | 90 | k8s_state.node_containers_state | running, waiting, terminated | containers | 91 | k8s_state.node_init_containers_state | running, waiting, terminated | containers | 92 | k8s_state.node_age | age | seconds | 93 94 ### Per pod 95 96 These metrics refer to the Pod. 97 98 Labels: 99 100 | Label | Description | 101 |:-----------|:----------------| 102 | k8s_cluster_id | Cluster ID. This is equal to the kube-system namespace UID. | 103 | k8s_cluster_name | Cluster name. Cluster name discovery only works in GKE. | 104 | k8s_node_name | Node name. | 105 | k8s_namespace | Namespace. | 106 | k8s_controller_kind | Controller kind (ReplicaSet, DaemonSet, StatefulSet, Job, etc.). | 107 | k8s_controller_name | Controller name. | 108 | k8s_pod_name | Pod name. | 109 | k8s_qos_class | Pod QOS class (burstable, guaranteed, besteffort). | 110 111 Metrics: 112 113 | Metric | Dimensions | Unit | 114 |:------|:----------|:----| 115 | k8s_state.pod_cpu_requests_used | requests | millicpu | 116 | k8s_state.pod_cpu_limits_used | limits | millicpu | 117 | k8s_state.pod_mem_requests_used | requests | bytes | 118 | k8s_state.pod_mem_limits_used | limits | bytes | 119 | k8s_state.pod_condition | pod_ready, pod_scheduled, pod_initialized, containers_ready | state | 120 | k8s_state.pod_phase | running, failed, succeeded, pending | state | 121 | k8s_state.pod_age | age | seconds | 122 | k8s_state.pod_containers | containers, init_containers | containers | 123 | k8s_state.pod_containers_state | running, waiting, terminated | containers | 124 | k8s_state.pod_init_containers_state | running, waiting, terminated | containers | 125 126 ### Per container 127 128 These metrics refer to the Pod container. 129 130 Labels: 131 132 | Label | Description | 133 |:-----------|:----------------| 134 | k8s_cluster_id | Cluster ID. This is equal to the kube-system namespace UID. | 135 | k8s_cluster_name | Cluster name. Cluster name discovery only works in GKE. | 136 | k8s_node_name | Node name. | 137 | k8s_namespace | Namespace. | 138 | k8s_controller_kind | Controller kind (ReplicaSet, DaemonSet, StatefulSet, Job, etc.). | 139 | k8s_controller_name | Controller name. | 140 | k8s_pod_name | Pod name. | 141 | k8s_qos_class | Pod QOS class (burstable, guaranteed, besteffort). | 142 | k8s_container_name | Container name. | 143 144 Metrics: 145 146 | Metric | Dimensions | Unit | 147 |:------|:----------|:----| 148 | k8s_state.pod_container_readiness_state | ready | state | 149 | k8s_state.pod_container_restarts | restarts | restarts | 150 | k8s_state.pod_container_state | running, waiting, terminated | state | 151 | k8s_state.pod_container_waiting_state_reason | a dimension per reason | state | 152 | k8s_state.pod_container_terminated_state_reason | a dimension per reason | state | 153 154 155 156 ## Alerts 157 158 There are no alerts configured by default for this integration. 159 160 161 ## Setup 162 163 ### Prerequisites 164 165 No action required. 166 167 ### Configuration 168 169 #### File 170 171 The configuration file name for this integration is `go.d/k8s_state.conf`. 172 173 174 You can edit the configuration file using the `edit-config` script from the 175 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/configure/nodes.md#the-netdata-config-directory). 176 177 ```bash 178 cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata 179 sudo ./edit-config go.d/k8s_state.conf 180 ``` 181 #### Options 182 183 184 185 There are no configuration options. 186 187 #### Examples 188 There are no configuration examples. 189 190 191 192 ## Troubleshooting 193 194 ### Debug Mode 195 196 To troubleshoot issues with the `k8s_state` collector, run the `go.d.plugin` with the debug option enabled. The output 197 should give you clues as to why the collector isn't working. 198 199 - Navigate to the `plugins.d` directory, usually at `/usr/libexec/netdata/plugins.d/`. If that's not the case on 200 your system, open `netdata.conf` and look for the `plugins` setting under `[directories]`. 201 202 ```bash 203 cd /usr/libexec/netdata/plugins.d/ 204 ``` 205 206 - Switch to the `netdata` user. 207 208 ```bash 209 sudo -u netdata -s 210 ``` 211 212 - Run the `go.d.plugin` to debug the collector: 213 214 ```bash 215 ./go.d.plugin -d -m k8s_state 216 ``` 217 218