Diagnose and resolve cluster-wide GKE TPU node pool creation or scale-up failures caused by Compute Engine reservation stockouts (GCE_STOCKOUT, ZONE_RESOURCE_POOL_EXHAUSTED) when existing unhealthy or NotReady TPU node pools in the cluster have node auto-repair disabled and hold reserved TPU capacity. Use when TPU node pool creation or scale-up fails with GCE_STOCKOUT, ZONE_RESOURCE_POOL_EXHAUSTED, or ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS despite having a specific Compute Engine TPU reservation. Don't use for general pod scheduling without a TPU reservation or workload-level container crashes.
Written by Google and published in google/skills under the Apache-2.0 license. Treq shows it unchanged except for heading levels and links to files on GitHub.
Use this skill to diagnose and resolve GKE TPU node pool creation or scale-up
failures that fail with GCE_STOCKOUT, ZONE_RESOURCE_POOL_EXHAUSTED, or
ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS (or queue due to lack of capacity)
even though they target a specific Compute Engine TPU reservation.
If node auto-repair is disabled on an existing TPU node pool, GKE doesn't repair
its nodes when they become NotReady. While their VMs are still running, they
keep consuming slots in the reservation (inUseCount is the number of running
instances that consume the reservation). Per
Ensure reservation availability,
the reservation must have sufficient available TPU chips at the time of node
pool creation, and per
Multi-host TPU slice node pools,
if GKE is unable to deploy one node in a slice, no nodes in the TPU slice node
pool are deployed. When the free slots in the reservation
(specificReservation.count - specificReservation.inUseCount; see
Consumable instances in a reservation)
are fewer than the number of nodes that the new TPU node pool needs, creation
fails with GCE_STOCKOUT or ZONE_RESOURCE_POOL_EXHAUSTED (or queues due to
lack of capacity).
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-reservation-stockout)"
and append agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-reservation-stockout) to User-Agent headers.
roles/logging.viewer): Query Cloud Audit Logs in Cloud
Logging.roles/monitoring.viewer): Query GKE node readiness
metrics in Cloud Monitoring.roles/container.viewer): Inspect GKE node pools
(management.autoRepair), cluster operations, and node conditions.roles/compute.viewer): Inspect Compute Engine reservation
utilization (specificReservation.inUseCount vs
specificReservation.count), consuming instances, and VM labels (including
in the reservation's owner project if using a shared reservation).[High Risk] steps): Kubernetes Engine Cluster Admin
(roles/container.clusterAdmin)gcloud billing projects describe {project_id}.container.googleapis.com, compute.googleapis.com,
logging.googleapis.com, and monitoring.googleapis.com.gcloud) and kubectl:
https://cloud.google.com/sdk/docs/install.Read-only rule: Run read-only diagnostic commands only. Never drain, delete, or re-create nodes, or run any other command that changes the cluster. Give the user any fix to apply themselves.
When you recommend a fix, link the doc section that describes it.
Identify the following environment parameters from the user prompt or cluster context:
{project_id}, {cluster_name}, {location}, {failing_nodepool_name},
{reservation_name}, {reservation_project_id} (the project that owns
{reservation_name}, which defaults to {project_id} for a single-project
reservation or is the owner project for a shared reservation; see
Consuming a specific shared reservation),
{zone} (the zone of the reservation), and {issue_time}.[{issue_time} - 30m, {issue_time} + 30m] ({start_time} to {end_time}).[Low Risk][{start_time}, {end_time}] and look for the documented error
messages, such as ZONE_RESOURCE_POOL_EXHAUSTED or
ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS.GCE_STOCKOUT.... cannot be created ... due to lack of capacity message instead of GCE_STOCKOUT. List the node pool creation
operation with gcloud container operations list
(--filter="operationType=CREATE_NODE_POOL").{reservation_project_id}).gcloud compute reservations describe {reservation_name} --zone={zone} --project={reservation_project_id} or gcloud compute reservations list --project={reservation_project_id}, and compare
specificReservation.inUseCount against specificReservation.count.specificReservation.count - specificReservation.inUseCount; see
Consumable instances in a reservation)
are fewer than the number of nodes that {failing_nodepool_name} needs,
proceed to Step 2.[Low Risk]{reservation_name}:
{reservation_project_id}) or, for a shared reservation, in any
project that it's shared with.{reservation_name}.goog-k8s-cluster-name, goog-k8s-cluster-location, and
goog-k8s-node-pool-name) to find each VM's cluster and node pool.{cluster_name}:
kubernetes_io:node_status_condition
(monitored_resource="k8s_node", cluster_name="{cluster_name}",
condition="Ready") described in
Monitor health metrics for TPU nodes and node pools.
The status label value is True, False, or Unknown (capitalized);
use status!="True" to find nodes whose Ready condition is False or
Unknown.kubectl get nodes -l cloud.google.com/gke-tpu-accelerator -L cloud.google.com/gke-nodepool.{failing_nodepool_name} out of the
unhealthy list. It's the node pool that couldn't get capacity, not the one
holding it.{cluster_name}: If some of the VMs consuming
{reservation_name} aren't nodes in {cluster_name} (for example, their
labels show another GKE cluster or they are Compute Engine VMs without GKE
labels), tell the user which VMs or other clusters hold those reservation
slots.specificReservation.inUseCount: Per
View a list of instances that are consuming a reservation,
the list only includes VMs in one project. If the list has fewer VMs than
specificReservation.inUseCount, tell the user that VMs in other projects
that share {reservation_name} are consuming the remaining slots.{cluster_name} ({leaking_nodepool_name}): If
the VMs consuming {reservation_name} belong to an existing NotReady node
pool in {cluster_name} ({leaking_nodepool_name}), proceed to Step 3.{failing_nodepool_name}. Tell the user not to delete or restart those
healthy node pools, and point the user to the consumption options in
Insufficient TPU resources to satisfy the TPU request.[Low Risk]Follow
Verify node auto-repair is enabled for a Standard node pool
for {leaking_nodepool_name}:
management.autoRepair: false): GKE doesn't
repair the NotReady nodes in {leaking_nodepool_name}. Their running VMs
keep counting toward specificReservation.inUseCount in {reservation_name},
so {failing_nodepool_name} can't get reserved capacity. Proceed to Step 4.management.autoRepair: true), but nodes are still
NotReady:
NotReady for less than the repair time
threshold (approximately 10 minutes), per
Repair criteria.[High Risk]Guardrail: Don't modify GKE-managed instance groups or VMs directly through Compute Engine. Manage node pools through GKE. Never delete healthy node pools that run active jobs.
{leaking_nodepool_name} in place, enable node
auto-repair (doesn't free slots for {failing_nodepool_name}):
{reservation_name}, so
specificReservation.inUseCount doesn't drop: enabling auto-repair makes
the nodes in {leaking_nodepool_name} healthy again, but
{failing_nodepool_name} still can't get their slots.{leaking_nodepool_name}.{leaking_nodepool_name} is stale or the user wants to free its slots
for {failing_nodepool_name}, delete it through GKE: Link the user to
Delete a node pool
to delete {leaking_nodepool_name}, which frees the reserved slots its VMs
use.{leaking_nodepool_name}, verify that enough
reservation slots are free: Follow
View reservations
to run gcloud compute reservations describe {reservation_name} --zone={zone} --project={reservation_project_id} and confirm that
specificReservation.inUseCount drops so the free slots
(specificReservation.count - specificReservation.inUseCount) are at least
the number of nodes that {failing_nodepool_name} needs before retrying
{failing_nodepool_name}.Claude Code and Codex keep each installed skill's name and description in context. When a request matches the description, the agent loads the full SKILL.md. You can also run it yourself: type /gke-ai-troubleshooting-tpu-reservation-stockout in Claude Code or $gke-ai-troubleshooting-tpu-reservation-stockout in Codex.
The description says when to use it:
Use when TPU node pool creation or scale-up fails with GCE_STOCKOUT, ZONE_RESOURCE_POOL_EXHAUSTED, or ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS despite having a specific Compute Engine TPU reservation.
Copy the gke-ai-troubleshooting-tpu-reservation-stockout folder into .claude/skills/ in your project. To use it in every project, copy it into ~/.claude/skills/ instead.
git clone --depth 1 https://github.com/google/skills.git /tmp/google-skills
mkdir -p .claude/skills
cp -r /tmp/google-skills/skills/cloud/gke-ai-troubleshooting-tpu-reservation-stockout .claude/skills/
Codex reads skills from .agents/skills/ in your repository, and from ~/.agents/skills/ for every repository. It detects new skills on its own. Restart Codex if gke-ai-troubleshooting-tpu-reservation-stockout does not appear.
git clone --depth 1 https://github.com/google/skills.git /tmp/google-skills
mkdir -p .agents/skills
cp -r /tmp/google-skills/skills/cloud/gke-ai-troubleshooting-tpu-reservation-stockout .agents/skills/
Open Settings and select the Skills tab. The tab appears when Skills installation is on under Settings → Feature Preview. Search for gke-ai-troubleshooting-tpu-reservation-stockout and choose Install….
Install for repository writes the skill under .treq/skills/ in the current repository. Install for application makes it available to every repository on this machine. Each new workspace gets a copy in .claude/skills/ and .agents/skills/, so Claude Code and Codex both find it. See Installing Skills from the Library.
gke-ai-troubleshooting-tpu-reservation-stockout ships 2 files, 19.2 KB in total. Select a file to load it from GitHub.