1
---
2
name: gke-node-notready
3
metadata:
4
version: "1.0.1"
5
category: Containers
6
description: >-
7
Diagnoses GKE nodes reporting NotReady or Unknown status by inspecting node conditions, events, kubelet/containerd logs, and node metrics, then proposing safe remediations. Use when nodes show NotReady, when the kubelet stops posting node status, or when workloads are evicted or stuck Pending due to node health. Don't use for pod-level application failures (use gke-workload-troubleshooting), autoscaler scale-up/scale-down decisions (use gke-cluster-autoscaler), or non-GKE compute.
8
---
9
10
# GKE Node NotReady Troubleshooting Skill
11
12
Use this skill to systematically diagnose why one or more GKE nodes report a
13
`NotReady` (or `Ready: Unknown`) status and to propose safe remediations. A
14
`NotReady` status means the node's kubelet is not reporting to the control plane
15
correctly, so Kubernetes stops scheduling new Pods on the node, which can reduce
16
application capacity and cause downtime.
17
18
This skill operates **non-interactively** and enforces a **read-only diagnostics
19
boundary**: gather evidence first, then propose a fix (a `kubectl`/`gcloud`
20
command or a GitOps manifest change) for a human to apply. **Never** mutate the
21
cluster, drain, delete, or recreate nodes automatically.
22
23
> [!IMPORTANT]
24
> First rule out an **expected** `NotReady`: a node that is newly provisioning,
25
> upgrading, being repaired, cordoned, or scaling down will transiently report
26
> `NotReady`. Only treat it as a fault if it persists beyond the expected window.
27
28
## Attribution
29
30
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
31
MUST read [Usage Attribution](references/attribution.md). For commands executed
32
directly in the terminal (never in generated scripts, Terraform, or user code),
33
prefix `gcloud` with
34
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-node-notready)"`
35
and append `agent-skills/1.0 (skill:gke-node-notready)` to `User-Agent` headers.
36
37
## 🔍 Diagnostic Workflow
38
39
### Step 0: Context discovery & time window
40
41
1. **Parameter extraction** — obtain `project_id`, `cluster_name`,
42
`cluster_location`, and `node_name` non-interactively from the user prompt,
43
active `SETTINGS.md`, or environment defaults (`kubectl config current-context`,
44
`gcloud config get-value project`).
45
2. **Credentials & fallback** — attempt
46
`gcloud container clusters get-credentials {cluster_name} --location {cluster_location} --project {project_id}`.
47
If the cluster is unreachable or commands fail (sandbox/dry-run/offline),
48
present the exact diagnostic commands for a human to run and continue the
49
analysis from the reported symptoms.
50
3. **Time window** — determine `{issue_time}` (explicit, relative, or now) and
51
center a 1-hour window around it (`start = issue_time - 30m`,
52
`end = issue_time + 30m`) for all log/metric queries.
53
54
--------------------------------------------------------------------------------
55
56
### Step 1: Identify NotReady nodes and gather initial status
57
58
```bash
59
# List nodes and spot NotReady status, node IPs, and container-runtime version.
60
kubectl get nodes -o wide
61
62
# Inspect the affected node's Conditions and Events (the primary clues).
63
kubectl describe node "{node_name}"
64
```
65
66
Equivalent via Cloud Logging (preferred when kubectl access is limited or for
67
historical events). Open it as a **Logs Explorer deep link** — URL-encode the
68
query and append the project and Step 0 time window:
69
`https://console.cloud.google.com/logs/query;query={URL_ENCODED_QUERY};timeRange={start}%2F{end}?project={project_id}`
70
(encode `/` as `%2F`, or use `;duration=PT1H` for a rolling hour):
71
72
```
73
resource.type="k8s_node"
74
log_id("events")
75
resource.labels.node_name="{node_name}"
76
resource.labels.cluster_name="{cluster_name}"
77
resource.labels.location="{cluster_location}"
78
```
79
80
**Interpret the `Conditions` table:**
81
82
- `Ready: False` / `Ready: Unknown` with reason `KubeletNotReady` /
83
`NodeStatusUnknown` ("Kubelet stopped posting node status") → kubelet or
84
runtime problem; continue to Step 2.
85
- `MemoryPressure: True`, `DiskPressure: True`, `PIDPressure: True` → resource
86
exhaustion; go to Step 4b.
87
- `NetworkUnavailable: True` → networking/CNI problem; go to Step 4d.
88
89
--------------------------------------------------------------------------------
90
91
### Step 2: Scan kubelet logs for error signatures
92
93
Open these kubelet logs as a **Logs Explorer deep link** using the same
94
`logs/query;query={URL_ENCODED_QUERY};timeRange=...?project=...` pattern as Step 1.
95
96
```
97
resource.type="k8s_node"
98
resource.labels.node_name="{node_name}"
99
resource.labels.cluster_name="{cluster_name}"
100
resource.labels.location="{cluster_location}"
101
log_id("kubelet")
102
severity>=WARNING
103
```
104
105
Also review the node's serial-console logs (`log_id("serialconsole.googleapis.com/serial_port_1_output")`
106
or the `resource.type="gce_instance"` serial logs) for kernel `TaskHung`,
107
OOM-killer, or disk I/O errors that correlate with the kubelet failures.
108
109
--------------------------------------------------------------------------------
110
111
### Step 3: Map the signature to a root cause (decision table)
112
113
| Kubelet / event signature | Likely root cause | Go to |
114
| --- | --- | --- |
115
| `runtime is down`, `Container runtime not ready`, errors on `/run/containerd/containerd.sock` (connection refused / DeadlineExceeded) | Container runtime (`containerd`) down or unresponsive | Step 4a |
116
| `Got sys oom event from cadvisor` / kernel OOM-killer in serial logs | System (node-level) OOM killed critical processes | Step 4b |
117
| `PLEG is not healthy` | PLEG stalled, usually node overload (CPU/disk) | Step 4c |
118
| `TaskHung` for `containerd`/`kubelet`, high disk latency | Disk throttling / I/O starvation | Step 4b |
119
| `failed to ensure lease`, `leases.coordination.k8s.io ... namespace kube-node-lease ... terminating` | `kube-node-lease` termination → NotReady flapping | Step 4f |
120
| Kubelet cannot reach API server, TLS/dial timeouts | Kubelet ↔ control-plane connectivity | Step 4d |
121
| `NetworkPluginNotReady`, `cni plugin not initialized`, `NetworkUnavailable` | CNI plugin failure | Step 4d |
122
| Node-critical DaemonSet Pods (CNI, kube-proxy, metadata) blocked from admission | Admission webhook interference | Step 4e |
123
| Only generic `NodeNotReady`, no other signature | Cause unclear — widen to Step 4d, then escalate | Escalation |
124
125
--------------------------------------------------------------------------------
126
127
### Step 4: Branch investigations
128
129
#### 4a. Container runtime (`containerd`) down
130
131
Confirm the kubelet cannot talk to containerd (socket errors above). Check for
132
`containerd` restarts/crashes in serial logs. **Remediation (propose, don't run):**
133
recreate/repair the node (`kubectl drain` then let the node pool recreate it, or
134
`gcloud container clusters upgrade`/node auto-repair); if it recurs across nodes,
135
suspect a node image or custom DaemonSet interfering with containerd.
136
137
#### 4b. Resource pressure & OOM
138
139
```bash
140
# Node allocatable vs. usage.
141
kubectl describe node "{node_name}" | sed -n '/Allocated resources/,/Events/p'
142
```
143
Cloud Monitoring metrics to inspect (read-only): `kubernetes.io/node/memory/used_bytes`,
144
`kubernetes.io/node/cpu/core_usage_time`, `kubernetes.io/node/ephemeral_storage/used_bytes`.
145
- **DiskPressure / disk throttling**: full boot disk or slow PD → increase disk
146
size / use a faster PD type; reduce image/log churn.
147
- **System OOM**: node memory exhausted → set/raise Pod memory `requests`/`limits`,
148
reduce over-commit, or use larger machine types. Distinguish **system OOM**
149
(node-wide, kills kubelet/runtime) from **cgroup OOM** (single container).
150
- **PIDPressure**: too many processes → cap Pod PIDs / reduce workload density.
151
152
#### 4c. PLEG is not healthy
153
154
`PLEG is not healthy` almost always means the node is overloaded (CPU saturation,
155
disk latency, or too many Pods/containers per node) so the runtime can't relist
156
in time. Correlate with 4b metrics. **Remediation:** reduce node density, add
157
CPU/disk headroom, or spread workloads.
158
159
#### 4d. Networking
160
161
```bash
162
# Are node-critical networking Pods healthy on this node?
163
kubectl get pods -n kube-system -o wide --field-selector spec.nodeName={node_name}
164
```
165
- **Kubelet ↔ control-plane**: dial/TLS timeouts to the API server → check
166
firewall rules, Private Google Access, authorized networks, and route/NAT
167
changes.
168
- **CNI failure** (`NetworkPluginNotReady`): the CNI DaemonSet
169
(`netd`/`calico`/dataplane) is not running on the node → inspect those Pods'
170
logs/events.
171
172
#### 4e. Admission webhook interference
173
174
A misconfigured/failing validating or mutating webhook with a broad scope can
175
block node-critical system Pods from being admitted, keeping the node NotReady.
176
177
```bash
178
kubectl get validatingwebhookconfigurations,mutatingwebhookconfigurations
179
```
180
Look for webhooks that intercept `kube-system` / node-critical objects with
181
`failurePolicy: Fail`. **Remediation (propose):** scope the webhook out of
182
`kube-system`/node-critical namespaces or set an appropriate `namespaceSelector`.
183
184
#### 4f. `kube-node-lease` termination flapping
185
186
If the node flaps NotReady with `leases.coordination.k8s.io ... namespace
187
kube-node-lease ... is being terminated`, the `kube-node-lease` namespace was
188
deleted/terminating. **Remediation (propose):** do not delete the
189
`kube-node-lease` namespace; if terminating, identify the finalizer/actor holding
190
it and restore the namespace.
191
192
--------------------------------------------------------------------------------
193
194
### Step 5: Remediation boundary & escalation
195
196
- Present the **root cause + evidence** (the exact conditions, events, log lines,
197
or metrics observed). Provide **Cloud Logging deep links** (and Cloud Monitoring
198
links for the Step 4b metrics) to the supporting entries — using the deep-link
199
pattern from Steps 1-2 — so a human can open the evidence directly.
200
- Propose the fix as a **command or GitOps manifest change** for a human to apply
201
— never apply, drain, or recreate nodes automatically.
202
**When to escalate (do this instead of proposing more self-service diagnostics):**
203
204
Escalate when either:
205
206
- the relevant logs are **unavailable** — excluded by a logging filter, or older
207
than the log bucket's retention (the `_Default` bucket defaults to 30 days, so
208
incidents older than that are permanently deleted); or
209
- the kubelet/event signature is **not in the Step 3 table** and the root cause
210
remains **undetermined** after the branch investigations.
211
212
In those cases, do all three:
213
214
1. **State the limitation plainly** (for example, "kubelet logs for that date are
215
past the 30-day `_Default` retention window and are permanently deleted").
216
2. **Summarize the findings you did gather** (node conditions, events, metrics,
217
and any Admin Activity audit logs still in the `_Required` bucket, default
218
400-day retention).
219
3. **Route to GKE support / engineering escalation with those findings.** Do
220
**not** keep proposing further self-service investigation, and do **not**
221
fabricate a diagnosis when the evidence is missing.
222
223
--------------------------------------------------------------------------------
224
225
## References
226
227
This skill is derived from public Google Cloud documentation:
228
229
- [Troubleshoot nodes with the NotReady status](https://cloud.google.com/kubernetes-engine/docs/troubleshooting/node-notready)
230
— node conditions and the kubelet / PLEG / system-OOM / containerd /
231
`kube-node-lease` / CNI / admission-webhook signatures and their remediations.
232
- [Troubleshoot node registration](https://cloud.google.com/kubernetes-engine/docs/troubleshooting/node-registration)
233
— Node Registration Checker for nodes that never finish registering.
234
- [View GKE logs](https://cloud.google.com/kubernetes-engine/docs/how-to/view-logs)
235
and [Cloud Logging routing overview](https://cloud.google.com/logging/docs/routing/overview)
236
— log queries (`resource.type="k8s_node"`, `log_id("kubelet")`) and log-bucket
237
retention (`_Default` 30 days, `_Required` 400 days).
238
- [Logs Explorer interface](https://cloud.google.com/logging/docs/view/logs-explorer-interface)
239
— building and sharing a query by URL (the `logs/query;query=...` deep-link
240
format used above).
241