GKE TPU Reservation Stockout Troubleshooting

GKE TPU Reservation Stockout Troubleshooting

Diagnoses GKE TPU node pool creation failures caused by reservation stockouts held by unhealthy node pools with auto-repair disabled, and proposes the fix.

Skill files2 files

references/

SKILL.md291 lines
1
---
2
name: gke-ai-troubleshooting-tpu-reservation-stockout
3
description: >-
4
Diagnose and resolve cluster-wide GKE TPU node pool creation or scale-up
5
failures caused by Compute Engine reservation stockouts (GCE_STOCKOUT,
6
ZONE_RESOURCE_POOL_EXHAUSTED) when existing unhealthy or NotReady TPU node
7
pools in the cluster have node auto-repair disabled and hold reserved TPU
8
capacity. Use when TPU node pool creation or scale-up fails with GCE_STOCKOUT,
9
ZONE_RESOURCE_POOL_EXHAUSTED, or ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS
10
despite having a specific Compute Engine TPU reservation. Don't use for
11
general pod scheduling without a TPU reservation or workload-level container
12
crashes.
13
metadata:
14
version: "1.0.1"
15
category: Containers
16
---
17
18
# Troubleshoot GKE TPU reservation stockouts caused by leaked node pool capacity
19
20
Use this skill to diagnose and resolve GKE TPU node pool creation or scale-up
21
failures that fail with `GCE_STOCKOUT`, `ZONE_RESOURCE_POOL_EXHAUSTED`, or
22
`ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS` (or queue due to lack of capacity)
23
even though they target a specific Compute Engine TPU reservation.
24
25
If node auto-repair is disabled on an existing TPU node pool, GKE doesn't repair
26
its nodes when they become `NotReady`. While their VMs are still running, they
27
keep consuming slots in the reservation (`inUseCount` is the number of running
28
instances that consume the reservation). Per
29
[Ensure reservation availability](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/tpus.md.txt),
30
the reservation must have sufficient available TPU chips at the time of node
31
pool creation, and per
32
[Multi-host TPU slice node pools](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/tpus.md.txt),
33
if GKE is unable to deploy one node in a slice, no nodes in the TPU slice node
34
pool are deployed. When the free slots in the reservation
35
(`specificReservation.count - specificReservation.inUseCount`; see
36
[Consumable instances in a reservation](https://docs.cloud.google.com/compute/docs/instances/reservations-view.md.txt))
37
are fewer than the number of nodes that the new TPU node pool needs, creation
38
fails with `GCE_STOCKOUT` or `ZONE_RESOURCE_POOL_EXHAUSTED` (or queues due to
39
lack of capacity).
40
41
## Attribution
42
43
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
44
MUST read [Usage Attribution](references/attribution.md). For commands executed
45
directly in the terminal (never in generated scripts, Terraform, or user code),
46
prefix `gcloud` with
47
`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-reservation-stockout)"`
48
and append `agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-reservation-stockout)` to `User-Agent` headers.
49
50
## Prerequisites
51
52
- **Required IAM Roles**:
53
- Logs Viewer (`roles/logging.viewer`): Query Cloud Audit Logs in Cloud
54
Logging.
55
- Monitoring Viewer (`roles/monitoring.viewer`): Query GKE node readiness
56
metrics in Cloud Monitoring.
57
- Kubernetes Engine Viewer (`roles/container.viewer`): Inspect GKE node pools
58
(`management.autoRepair`), cluster operations, and node conditions.
59
- Compute Viewer (`roles/compute.viewer`): Inspect Compute Engine reservation
60
utilization (`specificReservation.inUseCount` vs
61
`specificReservation.count`), consuming instances, and VM labels (including
62
in the reservation's owner project if using a shared reservation).
63
- For remediation (`[High Risk]` steps): Kubernetes Engine Cluster Admin
64
(`roles/container.clusterAdmin`)
65
- **API Enablement & Billing**:
66
- Ensure the target project has an active Google Cloud billing account
67
attached: `gcloud billing projects describe {project_id}`.
68
- Enable required APIs: `container.googleapis.com`, `compute.googleapis.com`,
69
`logging.googleapis.com`, and `monitoring.googleapis.com`.
70
- **CLI & Authentication Setup**:
71
- Install Google Cloud SDK (`gcloud`) and `kubectl`:
72
https://cloud.google.com/sdk/docs/install.
73
- **Cluster mode**: This skill applies to Standard clusters. Autopilot clusters
74
always auto-repair nodes, and you can't turn this off (see
75
[Settings for Autopilot and Standard](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair.md.txt)).
76
- **Reference Documentation**:
77
- [Auto-repair nodes](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair.md.txt)
78
(Sections: "Settings for Autopilot and Standard", "Repair criteria", "Node
79
repair process", "Verify node auto-repair is enabled for a Standard node
80
pool", "Node auto repair in TPU slice nodes", "Enable auto-repair for an
81
existing Standard node pool", "Get information about recent automated repair
82
events")
83
- [Troubleshoot GKE Standard node pools](https://docs.cloud.google.com/kubernetes-engine/docs/troubleshooting/node-pools.md.txt)
84
(Sections: "Issue: Node pool creation fails due to insufficient resources")
85
- [Troubleshoot TPUs in GKE](https://docs.cloud.google.com/kubernetes-engine/docs/troubleshooting/tpus.md.txt)
86
(Sections: "How GKE handles capacity issues", "Insufficient TPU resources to
87
satisfy the TPU request")
88
- [About TPUs in GKE](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/tpus.md.txt)
89
(Sections: "Multi-host TPU slice node pools")
90
- [Consuming reserved zonal resources](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/consuming-reservations.md.txt)
91
(Sections: "Consuming a specific shared reservation")
92
- [About reservations](https://docs.cloud.google.com/compute/docs/instances/reservations-overview.md.txt)
93
(Sections: "How reservations work")
94
- [View reservations or future reservation requests](https://docs.cloud.google.com/compute/docs/instances/reservations-view.md.txt)
95
(Sections: "Limitations", "View reservations", "Consumable instances in a
96
reservation", "View a list of instances that are consuming a reservation")
97
- [Organize resources using labels](https://docs.cloud.google.com/compute/docs/labeling-resources.md.txt)
98
(Sections: "View labels")
99
- [Create and manage cluster and node pool labels](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/creating-managing-labels.md.txt)
100
(Sections: "Automatically applied labels")
101
- [Deploy TPU workloads in GKE Standard](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/tpus.md.txt)
102
(Sections: "Ensure reservation availability", "Monitor health metrics for
103
TPU nodes and node pools", "Configure auto repair for TPU slice nodes")
104
- [Add and manage node pools](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-pools.md.txt)
105
(Sections: "Delete a node pool")
106
107
> **Read-only rule**: Run read-only diagnostic commands only. Never drain,
108
> delete, or re-create nodes, or run any other command that changes the cluster.
109
> Give the user any fix to apply themselves.
110
111
When you recommend a fix, link the doc section that describes it.
112
113
---
114
115
## Diagnostic workflow
116
117
### Step 0: Collect context and set the investigation window
118
119
Identify the following environment parameters from the user prompt or cluster
120
context:
121
- `{project_id}`, `{cluster_name}`, `{location}`, `{failing_nodepool_name}`,
122
`{reservation_name}`, `{reservation_project_id}` (the project that owns
123
`{reservation_name}`, which defaults to `{project_id}` for a single-project
124
reservation or is the owner project for a shared reservation; see
125
[Consuming a specific shared reservation](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/consuming-reservations.md.txt)),
126
`{zone}` (the zone of the reservation), and `{issue_time}`.
127
- **Time window**: By default, query a 60-minute window `[{issue_time} - 30m,
128
{issue_time} + 30m]` (`{start_time}` to `{end_time}`).
129
130
---
131
132
### Step 1: Confirm the stockout error and reservation utilization `[Low Risk]`
133
134
1. **Check Cloud Audit Logs and GKE operations for stockout or capacity
135
errors**:
136
- Run the query in
137
[Issue: Node pool creation fails due to insufficient resources](https://docs.cloud.google.com/kubernetes-engine/docs/troubleshooting/node-pools.md.txt)
138
across `[{start_time}, {end_time}]` and look for the documented error
139
messages, such as `ZONE_RESOURCE_POOL_EXHAUSTED` or
140
`ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS`.
141
- Per
142
[Insufficient TPU resources to satisfy the TPU request](https://docs.cloud.google.com/kubernetes-engine/docs/troubleshooting/tpus.md.txt),
143
TPU errors can also contain `GCE_STOCKOUT`.
144
- Per
145
[How GKE handles capacity issues](https://docs.cloud.google.com/kubernetes-engine/docs/troubleshooting/tpus.md.txt),
146
GKE sometimes queues a TPU node pool creation request instead of failing it
147
immediately, surfacing a `... cannot be created ... due to lack of
148
capacity` message instead of `GCE_STOCKOUT`. List the node pool creation
149
operation with `gcloud container operations list`
150
(`--filter="operationType=CREATE_NODE_POOL"`).
151
2. **Check Compute Engine reservation utilization**:
152
- Per
153
[Limitations](https://docs.cloud.google.com/compute/docs/instances/reservations-view.md.txt),
154
query shared reservations in the owner project where they were created
155
(`{reservation_project_id}`).
156
- Follow the
157
[View reservations](https://docs.cloud.google.com/compute/docs/instances/reservations-view.md.txt)
158
section to run `gcloud compute reservations describe {reservation_name}
159
--zone={zone} --project={reservation_project_id}` or `gcloud compute
160
reservations list --project={reservation_project_id}`, and compare
161
`specificReservation.inUseCount` against `specificReservation.count`.
162
163
#### Interpret the results
164
- Don't suggest deleting any node pool until you have identified which existing
165
VMs and node pools hold the reserved capacity (Step 2).
166
- **Stockout confirmed**: Per
167
[Ensure reservation availability](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/tpus.md.txt)
168
and
169
[Multi-host TPU slice node pools](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/tpus.md.txt),
170
if GKE can't deploy one node in a multi-host slice, no nodes in the slice are
171
deployed. If a stockout or lack-of-capacity message is present and the free
172
slots (`specificReservation.count - specificReservation.inUseCount`; see
173
[Consumable instances in a reservation](https://docs.cloud.google.com/compute/docs/instances/reservations-view.md.txt))
174
are fewer than the number of nodes that `{failing_nodepool_name}` needs,
175
proceed to Step 2.
176
177
---
178
179
### Step 2: Find which VMs and node pools hold the reservation `[Low Risk]`
180
181
1. **Check which VMs are consuming `{reservation_name}`**:
182
- Per
183
[How reservations work](https://docs.cloud.google.com/compute/docs/instances/reservations-overview.md.txt),
184
a specifically targeted reservation can be used by VMs in the reservation's
185
project (`{reservation_project_id}`) or, for a shared reservation, in any
186
project that it's shared with.
187
- Follow
188
[View a list of instances that are consuming a reservation](https://docs.cloud.google.com/compute/docs/instances/reservations-view.md.txt)
189
to list the VMs that use `{reservation_name}`.
190
- Follow
191
[View labels](https://docs.cloud.google.com/compute/docs/labeling-resources.md.txt)
192
to view each VM's labels, and check the GKE labels in
193
[Automatically applied labels](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/creating-managing-labels.md.txt)
194
(`goog-k8s-cluster-name`, `goog-k8s-cluster-location`, and
195
`goog-k8s-node-pool-name`) to find each VM's cluster and node pool.
196
2. **Check node readiness in `{cluster_name}`**:
197
- Query the Cloud Monitoring metric `kubernetes_io:node_status_condition`
198
(`monitored_resource="k8s_node"`, `cluster_name="{cluster_name}"`,
199
`condition="Ready"`) described in
200
[Monitor health metrics for TPU nodes and node pools](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/tpus.md.txt).
201
The `status` label value is `True`, `False`, or `Unknown` (capitalized);
202
use `status!="True"` to find nodes whose `Ready` condition is `False` or
203
`Unknown`.
204
- List TPU nodes and their node pool labels with `kubectl get nodes -l
205
cloud.google.com/gke-tpu-accelerator -L cloud.google.com/gke-nodepool`.
206
3. **Exclude the failing node pool**: Leave `{failing_nodepool_name}` out of the
207
unhealthy list. It's the node pool that couldn't get capacity, not the one
208
holding it.
209
210
#### Interpret the results
211
- **VMs outside `{cluster_name}`**: If some of the VMs consuming
212
`{reservation_name}` aren't nodes in `{cluster_name}` (for example, their
213
labels show another GKE cluster or they are Compute Engine VMs without GKE
214
labels), tell the user which VMs or other clusters hold those reservation
215
slots.
216
- **Fewer listed VMs than `specificReservation.inUseCount`**: Per
217
[View a list of instances that are consuming a reservation](https://docs.cloud.google.com/compute/docs/instances/reservations-view.md.txt),
218
the list only includes VMs in one project. If the list has fewer VMs than
219
`specificReservation.inUseCount`, tell the user that VMs in other projects
220
that share `{reservation_name}` are consuming the remaining slots.
221
- **Unhealthy node pool in `{cluster_name}` (`{leaking_nodepool_name}`)**: If
222
the VMs consuming `{reservation_name}` belong to an existing `NotReady` node
223
pool in `{cluster_name}` (`{leaking_nodepool_name}`), proceed to Step 3.
224
- **Healthy reservation (rule out a leak)**: If the reserved slots are held by
225
healthy, in-use node pools, there is no leak. Explain that healthy node pools
226
hold the reserved slots, so too few slots are free for
227
`{failing_nodepool_name}`. Tell the user not to delete or restart those
228
healthy node pools, and point the user to the consumption options in
229
[Insufficient TPU resources to satisfy the TPU request](https://docs.cloud.google.com/kubernetes-engine/docs/troubleshooting/tpus.md.txt).
230
231
---
232
233
### Step 3: Verify node auto-repair on the leaking node pool `[Low Risk]`
234
235
Follow
236
[Verify node auto-repair is enabled for a Standard node pool](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair.md.txt)
237
for `{leaking_nodepool_name}`:
238
- **Auto-repair is disabled (`management.autoRepair: false`)**: GKE doesn't
239
repair the `NotReady` nodes in `{leaking_nodepool_name}`. Their running VMs
240
keep counting toward `specificReservation.inUseCount` in `{reservation_name}`,
241
so `{failing_nodepool_name}` can't get reserved capacity. Proceed to Step 4.
242
- **Auto-repair is enabled (`management.autoRepair: true`), but nodes are still
243
`NotReady`**:
244
- Check whether the nodes have been `NotReady` for less than the repair time
245
threshold (approximately 10 minutes), per
246
[Repair criteria](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair.md.txt).
247
- Check the repair status and the failure reason in the operation history, per
248
[Configure auto repair for TPU slice nodes](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/tpus.md.txt)
249
and
250
[Get information about recent automated repair events](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair.md.txt).
251
252
---
253
254
### Step 4: Recover or release the reservation capacity `[High Risk]`
255
256
> **Guardrail**: Don't modify GKE-managed instance groups or VMs directly
257
> through Compute Engine. Manage node pools through GKE. Never delete healthy
258
> node pools that run active jobs.
259
260
1. **If the user wants to repair `{leaking_nodepool_name}` in place, enable node
261
auto-repair (doesn't free slots for `{failing_nodepool_name}`)**:
262
- Per
263
[Node repair process](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair.md.txt),
264
GKE drains and re-creates an unhealthy node.
265
- Per
266
[Node auto repair in TPU slice nodes](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair.md.txt)
267
and
268
[Configure auto repair for TPU slice nodes](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/tpus.md.txt),
269
GKE re-creates the entire multi-host TPU slice node pool when a node in it
270
needs repair. The re-created VMs still consume `{reservation_name}`, so
271
`specificReservation.inUseCount` doesn't drop: enabling auto-repair makes
272
the nodes in `{leaking_nodepool_name}` healthy again, **but
273
`{failing_nodepool_name}` still can't get their slots**.
274
- Link the user to
275
[Enable auto-repair for an existing Standard node pool](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-auto-repair.md.txt)
276
to turn on auto-repair for `{leaking_nodepool_name}`.
277
2. **If `{leaking_nodepool_name}` is stale or the user wants to free its slots
278
for `{failing_nodepool_name}`, delete it through GKE**: Link the user to
279
[Delete a node pool](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/node-pools.md.txt)
280
to delete `{leaking_nodepool_name}`, which frees the reserved slots its VMs
281
use.
282
3. **After the user deletes `{leaking_nodepool_name}`, verify that enough
283
reservation slots are free**: Follow
284
[View reservations](https://docs.cloud.google.com/compute/docs/instances/reservations-view.md.txt)
285
to run `gcloud compute reservations describe {reservation_name} --zone={zone}
286
--project={reservation_project_id}` and confirm that
287
`specificReservation.inUseCount` drops so the free slots
288
(`specificReservation.count - specificReservation.inUseCount`) are at least
289
the number of nodes that `{failing_nodepool_name}` needs before retrying
290
`{failing_nodepool_name}`.
291

© Google LLC · Apache 2.0 · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,511 prompts

More by @OpenSourceBuffGuy

See all
Anime girl in orange headphones, motion-graphics reveal prompt image

Anime girl in orange headphones, motion-graphics reveal

Directs a 15-second, 13-cut anime character reveal trailer in retro media-player graphics, locking one streetwear girl's design across every frame.

video-prompt, anime, character-consistency, reference-image, motion-graphics, multi-shot, timed-beats, scene-transitions, camera-movement, pixel-art, vibrant-colors, music-video, fashion, woman, character-design, widescreen, trailer, guardrails, hailuo, for-filmmakers, for-designers, for-artists, long-form, advanced, futuristic

Personalised macOS desktop wallpaper from a character image prompt image

Personalised macOS desktop wallpaper from a character image

Builds a 16:9 macOS desktop wallpaper from an uploaded character image, with the subject on the right, a matching background and 18 app icons in a grid on the left.

video-prompt, reference-image, wallpaper, ui-mockup, macos, anime, illustration, pastel, widescreen, character-design, structured-output, guardrails, for-designers, for-content-creators, gpt-image, hailuo, long-form, advanced, graphic-design, vibrant-colors

Toddler learns fruit names in 3D classroom prompt image

Toddler learns fruit names in 3D classroom

Generates a 20-second 3D animated toddler video in a preschool classroom that teaches eight fruit names scene by scene with on-screen words and a friendly voiceover.

video-prompt, animation, pixar-style, 3d-render, multi-shot, vertical-format, short-form-video, voiceover, family-friendly, cozy, pastel, explainer-video, for-young-learners, for-teachers, for-parents, for-content-creators, character-consistency, soft-lighting, vibrant-colors, vocabulary, early-years-education, seedance, text-rendering, step-by-step-guide

Reviews

Loading reviews…

Discussion

Loading comments…