New to Claude Skills? Learn how to install them โ†’

Ggoogle on GitHub

GKE AI Troubleshooting

Free

Diagnose and mitigate GPU/TPU node disruptions on GKE.

by google17.6k stars on google/skills
1 views
Updated Aug 10, 2026
Get this skill

Free ยท Opens the source repo

What GKE AI Troubleshooting does

The GKE AI Troubleshooting skill is designed specifically for diagnosing and mitigating node disruptions during Compute Engine host maintenance events for GPU and TPU workloads on Google Kubernetes Engine (GKE). This skill is particularly useful for developers and engineers who manage workloads that rely on GPU and TPU resources, ensuring minimal downtime and efficient resource management. By utilizing this skill, users can effectively identify and address issues related to node disruptions, enhancing the reliability of their applications.

The workflow begins with context acquisition, where users must provide essential parameters such as project ID, location, and cluster name to ensure accurate diagnostics. Following this, the skill guides users through a series of low-risk checks, including verifying scheduled maintenance labels on nodes, investigating node interruption metrics using PromQL, and analyzing Cloud Logging for active maintenance events. Each step is designed to provide clear, actionable insights, allowing users to pinpoint the cause of disruptions and take appropriate measures.

In addition to diagnosing issues, the skill emphasizes the importance of implementing workload protection strategies. Users are guided to configure graceful termination, enable opportunistic maintenance, and set up PodDisruptionBudgets to safeguard workloads during disruptions. This comprehensive approach not only helps in identifying the root causes of issues but also prepares the workloads to handle potential interruptions more gracefully.

Overall, this skill is an essential tool for developers and system administrators who need to maintain the stability and performance of their GPU and TPU workloads on GKE, particularly during maintenance events. By leveraging the diagnostic capabilities and recommended mitigation strategies, users can ensure their applications remain resilient and responsive, even in the face of potential disruptions.

When to use it

Use this skill when you need to troubleshoot node disruptions or predict host maintenance events specifically for GPU/TPU workloads on GKE.

When not to use it

This skill is not suitable for general GKE cluster creation, network policy configuration, or non-disruption workload deployments.

What you can build with it

Diagnosing Node Crashes

When a node unexpectedly crashes, use this skill to gather necessary context and diagnose the issue.

Predicting Maintenance Events

Utilize the skill to check for scheduled maintenance events that may affect GPU/TPU workloads.

Implementing Workload Protection

Follow the skill's guidance to set up strategies that protect workloads from disruptions during maintenance.

How to install GKE AI Troubleshooting

View source

1. Install with the skills CLI

npx skills add google/skills/gke-ai-troubleshooting-handle-disruption-gpu-tpu --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by google

Handle Disruption on GPUs and TPUs Troubleshooting

๐Ÿ” Diagnostic Workflow

Step 0: Context Acquisition

  • Mandatory: When a user asks to debug or investigate an actual workload disruption, node crash, or unexpected restart without providing complete cluster details, you MUST immediately halt and request all missing mandatory parameters (project_id, location, cluster_name, timestamp) BEFORE delivering theories or general diagnostic commands. Only skip context acquisition if the user explicitly requests a generic reusable runbook or provides a complete static telemetry/log dump for offline analysis.
  • Optional: node_name, workload_name, workload_namespace, nodepool_name.

Step 1: [Low Risk] Check for Upcoming Scheduled Maintenance

  • Action: Propose running kubectl to check if nodes have the scheduled maintenance label indicating an upcoming disruption.

  • Example Command:

    kubectl get nodes -l cloud.google.com/scheduled-maintenance-time -L cloud.google.com/scheduled-maintenance-time
    
  • Interpretation: The SCHEDULED-MAINTENANCE-TIME column shows the Unix epoch time when the VM is scheduled for maintenance. If this label exists, a disruption is guaranteed to occur.

Step 2: [Low Risk] Investigation via Cloud Monitoring (PromQL)

  • Action: Call any available monitoring tool or provide PromQL for manual verification.

  • Mandatory Monitoring Rule: Whenever recommending follow-up monitoring or interruption tracking over time, you MUST explicitly present a PromQL query using the metric kubernetes_io:node_interruption_count filtered by interruption_reason="HW/SW Maintenance". Do not suggest general Cloud Monitoring dashboards or Metrics Explorer without providing this specific PromQL metric expression.

  • Example Query:

    # Fetch host maintenance events for nodes
    sum by (interruption_type,interruption_reason)( sum_over_time( kubernetes_io:node_interruption_count{monitored_resource="k8s_node", interruption_reason="HW/SW Maintenance"}[${__interval}]))
    
    # See the interruption count aggregated by node pool
    sum by (node_pool_name,interruption_type,interruption_reason)( sum_over_time( kubernetes_io:node_pool_interruption_count{monitored_resource="k8s_node_pool", interruption_reason="HW/SW Maintenance", node_pool_name="{nodepool_name}" }[${__interval}]))
    
  • Interpretation: If kubernetes_io:node_interruption_count shows values > 0 for interruption_reason="HW/SW Maintenance", it indicates the underlying Compute Engine VM was interrupted due to scheduled host maintenance.

Step 3: [Low Risk] Investigation via Cloud Logging & Node Taints

  • Action: Call query_logs or instruct the user to filter their GKE logs for active host maintenance events, and check node taints.
  • Guidance: Look for occurrences in Cloud Logging where cloud.google.com/active-node-maintenance is set to ONGOING. To check if GKE has cordoned the terminating node to prevent new workloads from being scheduled, verify whether the cloud.google.com/impending-node-termination:NoSchedule taint is present (either in GKE event logs or directly via kubectl describe node).
  • Interpretation:
    • cloud.google.com/active-node-maintenance set to ONGOING means workloads are actively being stopped by GKE due to host maintenance.
    • cloud.google.com/impending-node-termination:NoSchedule taint means GKE has cordoned the node to prevent new Pods from being scheduled on the terminating node. DO NOT recommend tolerating this taint.

Step 4: Conclusion and Resolution

  • Action: Provide a summary of findings to the user and suggest appropriate mitigation strategies if host maintenance events were confirmed or scheduled.
  • Reporting Rule: Signal Only. Report high-signal information indicating that the disruption was caused by Compute Engine host maintenance, specifically affecting the underlying GPU/TPU nodes. DO NOT dump raw logs.
  • Negative Findings Rule-Out: If node scheduled-maintenance labels, PromQL interruption counts, and active maintenance logs all return negative/empty results, definitively conclude that Compute Engine host maintenance did NOT cause the disruption. Direct the user to investigate application-level causes (such as OOMKill events, CUDA runtime errors, or resource limits) and do not propose host maintenance mitigations as the primary resolution.
  • Mandatory Workload Protection Triad: Whenever host maintenance is identified or anticipated on GPU/TPU nodes, consistently recommend all three complementary mitigations together:
    1. Configure Graceful Termination: For workloads that need time to save state (e.g., ML frameworks checkpointing via Orbax), follow the guide to Enable disruption handling and set spec.terminationGracePeriodSeconds (up to 60 minutes) to handle the SIGTERM signal before node shutdown.
    2. Enable Opportunistic Maintenance: To automatically trigger maintenance when GKE detects that GPU/TPU nodes are idle, configure Opportunistic Maintenance.
    3. Configure PodDisruptionBudgets (PDBs): Ensure your workload uses a PodDisruptionBudget to maintain minAvailable replicas during evictions and disruptions.

Frequently asked questions about GKE AI Troubleshooting

Similar skills