gke-ai-troubleshooting-tpu-dynamic-slices-monitoring
Monitors, troubleshoots, and manages GKE TPU Dynamic Slices custom resources. Use when checking TPU slice lifecycle states, troubleshooting slice provisioning failures, validating single-slice or multi-slice (JobSet) workload manifests, or safely patching stuck finalizers and disabling the slice con
- 0
- Installs
- —
- Rating
- —
- Success rate
- 3
- Files scanned
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 5fd5d0132d129ec2… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
GKE TPU Dynamic Slices Monitoring & Management
Monitors the status of TPU Slice custom resources, troubleshoots provisioning failures, validates workload manifests on dynamic slices, and performs cleanups.
Prerequisites
- Cloud Logging enabled for the project.
kubectlandgcloudCLIs configured to access the GKE cluster.
Diagnostic Workflow
Step 0: Context Acquisition & Time Window Definition
Gather project, cluster, and slice context using cluster tools or the following parameters:
- Project ID:
{project_id}(e.g.,my-gcp-project) - Cluster Name:
{cluster_name}(e.g.,tpu-cluster) - Region/Zone:
{location}(e.g.,us-central1-a) - Slice Name:
{slice_name}(e.g.,test-slice) - Issue Time:
{timestamp}(Optional; default to the last 30 minutes window[T - 30m]to[T + 30m])
Step 1: Describe the Slice Custom Resource [Low Risk]
When asked to inspect, troubleshoot, or check a slice status, immediately execute kubectl describe slice {slice_name} using available cluster tools to perform the inspection. Parse the resulting Status.Conditions output against the condition table below to diagnose the exact state and provide concrete recommendations.
-
Command:
kubectl describe slice {slice_name}
State & Reason Analysis
Analyze the Status.Conditions (especially Type: Ready and its Reason and
Status):
| Lifecycle State / Reason | Meaning | Recommended Action |
|---|---|---|
SliceNotCreated | GKE Slice Controller is initializing the slice and performing resource checks. | Wait a few minutes and re-check slice status. |
SliceCreationFailed | Prerequisites validation failed (e.g., selected nodes don't exist, nodes are already used by another slice, or the topology doesn't match the number of partitions). | Verify selected nodes exist, are unallocated, and topology matches partition count. |
ACTIVATING | GKE is actively forming and provisioning the TPU slice. | Monitor node provisioning. |
ACTIVE | The TPU slice is successfully formed and ready to host workloads. | Proceed to deploy or check workloads. |
ACTIVE_DEGRADED | The slice is usable, but one or more sub-blocks are degraded. | Monitor workload logs for interconnect or device errors. Check faulty node VMs. |
FAILED | GKE failed to form the TPU slice (e.g., selected nodes are not part of the same reservation block). | Ensure all selected nodes belong to the same reservation block. |
DEACTIVATING | The slice is dismantling (triggered by user deletion or a critical systemic failure). | Wait for dismantling to finish, or patch finalizers if stuck. |
INCOMPLETE | The terminal phase before the Slice CR is deleted from the cluster. | No action required; the resource will be removed shortly. |
Provisioning Failure Troubleshooting Checklist
When investigating slice creation or provisioning failures (SliceCreationFailed or FAILED), perform the following verification steps:
- Node Existence & Allocation Check: Verify that the selected TPU nodes exist in the cluster and are not already allocated to another slice (
kubectl get nodes -l cloud.google.com/gke-tpu-slice,kubectl get slice -A). - Topology Alignment: Confirm that the partition count matches the requested topology dimensions (e.g. topology
2x2requires 4 nodes). - Reservation Block Alignment Check: Confirm that all selected TPU nodes belong to the same reservation and reservation block.
Step 2: Verify Workload Specification [Low Risk]
Ensure workload manifests are configured correctly to target the dynamic slice.
1. Single-Slice Workload Requirements
Check that the Pod template contains the following annotations and selectors:
- Annotations:
cloud.google.com/gke-tpu-slice-topology: "{topology}"(e.g.,"4x4x4")
- NodeSelector:
cloud.google.com/gke-tpu-topology: "{topology}"(e.g.,"4x4x4")cloud.google.com/gke-tpu-accelerator: "{accelerator_type}"(e.g.,"tpu7x")cloud.google.com/gke-tpu-slice: "{slice_name}"(e.g.,"test-slice")
2. Multi-Slice (JobSet) Workload Requirements
If deploying a multi-slice JobSet, verify:
- JobSet Annotation:
alpha.jobset.sigs.k8s.io/exclusive-topology: cloud.google.com/gke-tpu-slice
- Pod Template Annotations:
cloud.google.com/gke-tpu-slice-topology: "{topology}"
- Pod Template NodeSelector:
cloud.google.com/gke-tpu-topology: "{topology}"cloud.google.com/gke-tpu-accelerator: "{accelerator_type}"- Note: Do NOT manually specify
cloud.google.com/gke-tpu-slicein the nodeSelector; JobSet handles slice assignment automatically.
Resolution & Management Workflow
Resolution 1: Force Delete a Stuck Slice [High Risk]
If a slice is stuck in DEACTIVATING or deletion hangs indefinitely due to stuck finalizers:
-
Identify Cause: Explain that finalizers on the slice resource (
metadata.finalizers) are preventing Kubernetes from completing resource deletion. -
Propose Resolution: Propose removing finalizers from the metadata path (
/metadata/finalizers) using a JSON patch operation:kubectl patch slice {slice_name} --type json -p='[{"op": "remove", "path": "/metadata/finalizers"}]' -
Provide Warning: Explicitly warn the user that removing finalizers bypasses standard controller dismantling and may leave underlying VM, network, or accelerator resources uncleaned or orphaned.
-
CRITICAL SAFETY MANDATE: The response MUST explicitly ask the user for confirmation (e.g. "Removing finalizers on
/metadata/finalizersvia JSON patch is a high-risk operation that may leave orphaned resources. Do you confirm you want to apply this patch to slice{slice_name}?") and pause for user confirmation before applying or executing the patch.
Resolution 2: Disable and Clean Up Slice Controller [High Risk]
If dynamic slicing needs to be disabled:
-
Check for existing Slices:
kubectl get slice -AEnsure all slices are deleted before disabling the controller.
-
Disable Slice Controller via gcloud:
gcloud container clusters update {cluster_name} \ --location={location} \ --no-enable-slice-controller -
Delete the Slice CRD:
kubectl delete crd slices.accelerator.gke.io -
Clean up Node Labels: Remove GKE TPU Slice labels from all nodes in the cluster:
kubectl label nodes --all cloud.google.com/gke-tpu-slice- cloud.google.com/gke-tpu-slice-topology-
- Safety Rule: Propose the exact commands and confirm before executing disabling or destructive cleanup steps.
Files
3- SKILL.md
06d43f48af7.6 KB - references/failure_signatures.md
be8afcbaf11.6 KB - scripts/validate_queries.sh
13dfa4fe97537 B
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from google/skills8
Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for st
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available model
Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for run
Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when generating synthetic user scenarios, evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results be
Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate c
Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry
Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.
Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.
Related devops skillsscan passed
Run repeated rollouts ("Prime Gauss" style recursive prompting) while keeping an append-only decision ledger of trials, marks, coherence checks, and promotion gates, so recursive confidence never auto-approves live trading, deploy, or destructive actions. Use when the user asks for repeated rollouts
Post-deploy canary monitoring. (gstack)
Build or maintain Cloudflare Sandbox apps on the stable @cloudflare/sandbox package. Use sandbox-next for preview apps and sandbox-migrate-to-next for stable-to-preview migrations.
Deploy tRPC on AWS Lambda with awsLambdaRequestHandler() from @trpc/server/adapters/aws-lambda for API Gateway v1 (REST, APIGatewayProxyEvent) and v2 (HTTP, APIGatewayProxyEventV2), and Lambda Function URLs. Enable response streaming with awsLambdaStreamingRequestHandler() wrapped in awslambda.strea
Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the availabl
Deploys and manages full-stack web applications (Next.js, Angular) with Server-Side Rendering (SSR) using Firebase App Hosting. Use when deploying Next.js/Angular apps, configuring apphosting.yaml or firebase.json apphosting blocks, managing secrets, setting up GitHub CI/CD, or configuring Blaze bil