Skip to main content
skill Claude Code Gemini CLI CX Codex official · Google

gke-ai-troubleshooting-jobset-interruption — Claude Code skill

Diagnoses GKE JobSet restarts and interruptions in AI/ML training workloads. Use it to trace worker crashes, node failures, and spot VM preemptions.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add google/skills --skill gke-ai-troubleshooting-jobset-interruption -a claude-code
Open on GitHub

What gke-ai-troubleshooting-jobset-interruption does

This skill investigates JobSet restart loops, spot VM preemptions, node readiness failures, host VM issues, and coordinator or worker crashes. It targets AI/ML workloads running on GKE. General cluster creation, basic workload deployment, and non-JobSet application issues are outside its scope.

Its workflow checks restart metrics, node pool events, Ready status, and node-to-host VM relationships. It uses MQL, PromQL, and LQL queries to correlate metrics with logs. JobSet metrics must be enabled in kube-state-metrics, and the Google Cloud project needs Cloud Logging and Cloud Monitoring enabled.

Install it when you troubleshoot distributed training failures on GKE. For ordinary Kubernetes applications, choose a narrower troubleshooting skill.

What it helps with

  • trace a JobSet restart loop to its cause
  • connect an AI/ML failure with a spot VM preemption
  • inspect node pool interruption and maintenance events
  • correlate coordinator crashes with node and host VM state

Example prompts for the agent

  • Find out why the GKE JobSet `training-job` keeps restarting.
  • Check for spot VM preemptions and Ready failures affecting `training-job`.
  • Correlate the coordinator crash with the node and host VM during the incident window.

How to install gke-ai-troubleshooting-jobset-interruption

1Skills CLI (Vercel)

npx skills add google/skills --skill gke-ai-troubleshooting-jobset-interruption -a claude-code

2Manually: put the files in place

~/.claude/skills/gke-ai-troubleshooting-jobset-interruption/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/gke-ai-troubleshooting-jobset-interruption/

From the same set172

The whole set →
bigquery-basics official google Manages BigQuery resources and runs SQL queries. Use it to create datasets, tables and views, or handle basic data ingestion and analysis. Claude Code Gemini CLI CX Codex 17,678installs cloud-run-basics official google This skill helps an agent manage Cloud Run services, jobs, and worker pools when a project needs HTTP deployment, scheduled work, or pull-based background processing. Claude Code Gemini CLI CX Codex 17,532installs gemini-api official google Connects Gemini API from Google Cloud Agent Platform to the agent. Gives access to Gemini models, multimodal input, function calling, and context caching. Claude Code Gemini CLI CX Codex 17,116installs google-cloud-recipe-auth official Google LLC This skill explains Google Cloud authentication and permissions. Use it when setting up IAM, ADC, or service accounts for local code and production workloads. Claude Code Gemini CLI CX Codex 15,450installs google-cloud-recipe-onboarding official Google LLC Guides a developer through a first Google Cloud project: CLI checks, sign-in, project setup and billing. It fits a personal first project. Claude Code Gemini CLI CX Codex 15,390installs cloud-sql-basics official google This skill helps create and explain Cloud SQL resources for MySQL, PostgreSQL, and SQL Server. Use it when setting up a database in Google Cloud. Claude Code Gemini CLI CX Codex 14,679installs google-cloud-waf-security official google This skill reviews Google Cloud workloads against the security pillar of the Well-Architected Framework and suggests actions for IAM, networks, data, and operations. Claude Code Gemini CLI CX Codex 14,620installs google-cloud-waf-cost-optimization official google Reviews Google Cloud workloads through the Well-Architected Cost Optimization pillar. Use it to inspect spending, resize resources, assess discounts, or find idle capacity. Claude Code Gemini CLI CX Codex 14,266installs

Similar

monorepo-management Seth Hobson This skill guides monorepo setup with Turborepo, Nx, and pnpm workspaces. Use it for builds, shared dependencies, CI/CD, and package releases. Claude Code CX Codex Cursor 14,548installs golang-project-layout samber Skill organizes a Go project by convention: cmd/, internal/, pkg/ directories, module naming, go.work for monorepos. Asks about architecture and dependency injection approach, then scaffolds files and config. Claude Code CX Codex Cursor +1 40,300installs runbook official anthropics This skill turns a recurring operation into a step-by-step runbook with verification, failure handling, rollback, and escalation guidance. Claude Code CX Codex Cursor +1 3,100installs firebase-remote-config-basics Google LLC Manages Firebase Remote Config templates, loading strategies, and feature flags for Android and iOS. Helps tweak app behavior without pushing a release to app stores. Claude Code CX Codex Cursor +1 120,800installs version-bump thedotmack This skill runs a plugin release from version selection to npm publishing. Use it when manifests, builds, tags, changelog, and release checks must follow one workflow. Claude Code CX Codex Cursor +1 1,800installs wizard Matt Pocock This skill creates an interactive bash wizard for manual setup steps, CI secrets, third-party dashboards, and one-off migrations. Claude Code 553,369installs hyperframes-cli heygen-com Controls HyperFrames video workflows from the CLI: audits layouts and contrast, edits timeline clips, captures snapshots, and renders locally or in cloud runtimes. Claude Code CX Codex Cursor +1 1,200,000installs setup-pre-commit Matt Pocock This skill configures pre-commit checks for a JavaScript repository, running Prettier, type checking, and tests before each commit. Claude Code 489,289installs

Questions about gke-ai-troubleshooting-jobset-interruption

How do I install gke-ai-troubleshooting-jobset-interruption in Claude Code?

Run npx skills add google/skills --skill gke-ai-troubleshooting-jobset-interruption -a claude-code. The skill file is placed at ~/.claude/skills/gke-ai-troubleshooting-jobset-interruption/SKILL.md.

What does gke-ai-troubleshooting-jobset-interruption do?

It walks through JobSet restarts, node pool interruptions, node readiness, and host VM issues to identify why an AI/ML workload is failing on GKE.

What does the skill require before it can run?

JobSet metrics must be enabled in kube-state-metrics. Cloud Logging and Cloud Monitoring must also be enabled for the Google Cloud project.

Source text

SKILL.md · Apache-2.0
---
name: gke-ai-troubleshooting-jobset-interruption
metadata:
  version: "1.0.1"
  category: Containers
description: >-
  Diagnoses GKE JobSet interruptions, restarts, and preemptions for AI/ML training workloads autonomously.
  Use when troubleshooting JobSet restart loops, spot VM preemptions, node readiness failures, host VM issues, or coordinator worker crashes.
  Don't use for general GKE cluster creation, basic workload deployment, or non-JobSet application issues.
---

# GKE JobSet Interruption Troubleshooting

Use this skill to systematically diagnose and resolve JobSet interruptions,
restarts, and preemptions on GKE clusters hosting large-scale AI/ML workloads.

## Attribution

**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
MUST read [Usage Attribution](references/attribution.md). 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-jobset-interruption)"`
and append `agent-skills/1.0 (skill:gke-ai-troubleshooting-jobset-interruption)` to `User-Agent` headers.

## ⚠️ Prerequisites & Sandbox Rules

-   JobSet metrics package must be enabled in `kube-state-metrics` for your
    cluster.
-   Cloud Logging and Cloud Monitoring enabled for the Google Cloud Project.
-   **Autonomous & Sandbox Execution Rule**: If API queries, tools, or commands
    encounter `403 Permission Denied`, authentication errors, or network
    isolation, **do NOT enter authentication or credential troubleshooting
    loops**. Populate the query templates with the acquired variables
    (`{project_id}`, `{cluster_name}`, `{workload_name}`, `{start_time}`,
    `{end_time}`), inspect any locally staged telemetry or mock data files if
    available, and complete the diagnostic workflow and resolution
    recommendations autonomously.

## 🔍 Diagnostic Workflow

### Step 0: Context Acquisition & Time Window Definition

Independently gather context using tools, workspace files, environment details,
or user prompt context:

-   **Project ID** (`{project_id}`)
-   **Cluster Name** (`{cluster_name}`)
-   **Workload Name (JobSet Name)** (`{workload_name}`)
-   **Workload Namespace** (`{namespace}`)
-   **Issue Time** (`{issue_time}`)

If specific variables are not explicitly provided by the user, inspect cluster
resources or logs to determine them, or use the `{variable}` placeholders
provided.

#### Time Handling Rules

1.  **Autonomous Time Window**: If a relative time (e.g., "X minutes ago") or no
    exact timestamp is provided, calculate the query window based on current
    time or available log timestamps.
2.  **Window Calculation**: If a timestamp `{issue_time}` is available (or
    calculated as `T`), set `{start_time}` = `T - 30m` and `{end_time}` = `T +
    30m`.

--------------------------------------------------------------------------------

### Step 1: Identify JobSet Restarts and Attempts [Low Risk]

Verify if the JobSet is experiencing restart loops and determine the frequency
of restarts.

#### Visual Chart / MQL Query - restarts

-   **MQL Query Specification**:

    ```mql
    fetch prometheus_target
    | metric 'prometheus.googleapis.com/kube_jobset_restarts/gauge'
    | filter resource.cluster_name == '{cluster_name}' && metric.jobset_name == '{workload_name}'
    | align next_older(1m)
    | every 1m
    | group_by [metric.jobset_name], [val: max(value)]
    ```

#### PromQL Metric Query - restarts

-   **PromQL Query Specification**:

    ```promql
    kube_jobset_restarts{jobset_name="{workload_name}", cluster="{cluster_name}"}
    ```

-   **Diagnostic Logic**: A non-zero or increasing value for restarts indicates
    that the JobSet is being actively restarted by the controller due to worker
    failure or interruption.

-   **Automation**: Proceed to Step 2 automatically after reporting findings.

--------------------------------------------------------------------------------

### Step 2: Inspect Nodepool Interruptions [Low Risk]

Determine if the JobSet restarts were triggered by physical nodepool-level
events (such as spot preemptions, maintenance, or host terminations).

#### A. Metrics Query (Nodepool Interruption Counts)

##### Visual Chart / MQL Query - interruptions

-   **MQL Query Specification**:

    ```mql
    fetch k8s_node_pool
    | metric 'kubernetes.io/node_pool/interruption_count'
    | filter cluster_name == '{cluster_name}'
    | align next_older(10m)
    | every 10m
    | group_by [metric.interruption_type, metric.interruption_reason, metadata.system.node_pool_name], [val: sum(value)]
    ```

##### PromQL Query - interruptions

-   **PromQL Query Specification**:

    ```promql
    sum by (interruption_type, interruption_reason, node_pool_name, cluster_name) (
      avg_over_time(kubernetes_io:node_pool_interruption_count{cluster_name="{cluster_name}"}[10m])
    )
    ```

#### B. Log Query (Nodepool Life Events)

-   **LQL Log Filter Specification**:

    ```sql
    resource.type="gke_nodepool"
    AND resource.labels.cluster_name="{cluster_name}"
    AND timestamp >= "{start_time}"
    AND timestamp <= "{end_time}"
    ```

-   **Diagnostic Logic**:

    -   **PreemptionEvent**: Spot VMs were preempted, or node was scale-down.
    -   **MaintenanceEvent**: Node pool updated or Google scheduled maintenance.
    -   **TerminationEvent**: Serious host failures. Check `interruption_reason`
        or logs for host issues.
    -   See [Failure Signatures](references/failure_signatures.md) for examples
        of node termination logs and preemption events.

-   **Automation**: Proceed to Step 3 automatically.

--------------------------------------------------------------------------------

### Step 3: Inspect Nodes and Underlying Host VMs [Low Risk]

Correlate node readiness failures with physical host VMs to see if a single
faulty host repeatedly fails coordinator pods.

#### A. Metrics Query (Node Ready Status Check)

##### Visual Chart / MQL Query - node status

-   **MQL Query Specification**:

    ```mql
    fetch k8s_node
    | metric 'kubernetes.io/node/status_condition'
    | filter cluster_name == '{cluster_name}' && metric.condition == 'Ready' && metric.status == 'False'
    | align next_older(1m)
    | every 1m
    | group_by [node_name, metadata.user.gke_nodepool], [val: max(value)]
    ```

##### PromQL Query - node status

-   **PromQL Query Specification**:

    ```promql
    sum by (status, condition, node_pool_name) (
      kubernetes_io:node_status_condition{cluster_name="{cluster_name}", condition="Ready", status="False"}
    )
    ```

#### B. Metrics Query (Node-to-Host Metadata Topology Correlation)

-   **MQL Query Specification**:

    ```mql
    fetch k8s_node
    | metric 'kubernetes.io/node/cpu/total_cores'
    | filter cluster_name == '{cluster_name}'
    | align next_older(1m)
    | every 1m
    | group_by [node_name, metadata.user.gce_topology_host, metadata.user.gke_nodepool], [val: max(value)]
    ```

#### C. Log Query (Node Fault Logs)

-   **LQL Log Filter Specification**:

    ```sql
    resource.type="k8s_node"
    AND resource.labels.cluster_name="{cluster_name}"
    AND (textPayload:"host error" OR textPayload:"kernel panic" OR textPayload:"hardware failure" OR textPayload:"NodeNotReady")
    AND timestamp >= "{start_time}"
    AND timestamp <= "{end_time}"
    ```

-   **Diagnostic Logic**: Identify if specific nodes are unhealthy
    (`Ready=False` or `Unknown`) and correlate them to their GCE physical host
    ID via `metadata.user.gce_topology_host`. Check if the same host is
    repeatedly failing.

-   **Automation**: Proceed to Step 4 automatically.

--------------------------------------------------------------------------------

### Step 4: Inspect Pod and Worker / Container Failures [Low Risk]

Analyze pod status phases and retrieve coordinator worker logs to identify
application-level crashes or network deadlocks.

> **Required Execution Order**: You MUST analyze pod status phases (Section A)
> and unschedulable pod metrics (Section B) to assess overall workload health
> before inspecting specific worker container logs (Section C).

#### A. Metrics Query (Pod Lifecycle Phases)

##### Visual Chart / MQL Query - pod phase

-   **MQL Query Specification**:

    ```mql
    fetch k8s_pod
    | metric 'kubernetes.io/pod/status/phase'
    | filter cluster_name == '{cluster_name}' && pod_name ==~ '{workload_name}.*'
    | align next_older(10m)
    | every 10m
    | group_by [metric.phase], [val: count()]
    ```

##### PromQL Query - pod phase

-   **PromQL Query Specification**:

    ```promql
    sum by (phase) (
      avg_over_time(kube_pod_status_phase{cluster="{cluster_name}", pod=~"{workload_name}.*"}[10m])
    )
    ```

#### B. Metrics Query (Unschedulable Pod Count)

-   **MQL Query Specification**:

    ```mql
    fetch k8s_pod
    | metric 'kubernetes.io/pod/status/unschedulable'
    | filter cluster_name == '{cluster_name}' && pod_name ==~ '{workload_name}.*'
    | align next_older(10m)
    | every 10m
    | group_by [pod_name], [val: max(value)]
    ```

#### C. Log Query (Worker Container Logs)

-   **LQL Log Filter Specification**:

    ```sql
    resource.type="k8s_container"
    AND resource.labels.cluster_name="{cluster_name}"
    AND labels."k8s-pod/jobset_sigs_k8s_io/jobset-name"="{workload_name}"
    AND timestamp >= "{start_time}"
    AND timestamp <= "{end_time}"
    ```

-   **Diagnostic Logic**:

    1.  Check the pod timeline to spot pending or unschedulable pods.
    2.  Use worker container logs to analyze worker 0 in slice 0 (coordinator)
        for NCCL timeouts, collective communication issues, or MegaScale hangs.

-   **Automation**: Proceed to Resolution.

--------------------------------------------------------------------------------

## 🛠️ Resolution Workflow

### Resolution 1: Preemption & Autoscaling Optimizations [Low Risk]

If Step 2 showed high preemption counts on Spot VMs:

-   **Action**: Suggest switching critical long-running training workloads to
    **GKE Reserved/On-Demand VMs** or utilizing **Compact Placement Policies**
    to minimize defragmentation interruptions.
-   **Justification**: Eliminates spot-market preemptions and reduces training
    restarts.

### Resolution 2: Quarantine Faulty Host VMs [High Risk]

If Step 3 identified a specific host ID (`gce-topology-host`) that consistently
fails or triggers restarts across multiple attempts:

-   **Action**: Recommend cordoning/draining the GKE node, deleting the
    underlying GCE VM instance to trigger instance recreation, and opening a
    support ticket with Google Cloud Support specifying the physical host ID.
-   **Justification**: GKE auto-repair will recreate the VM instance on healthy
    physical hardware, preventing infinite restart loops.

--------------------------------------------------------------------------------

## 📋 Copypaste Checklist

-   [ ] Gather context and compute `{start_time}` (`{issue_time} - 30m`) and
    `{end_time}` (`{issue_time} + 30m`) window.
-   [ ] Query JobSet restart attempts.
-   [ ] Check Nodepool interruptions (spot preemptions vs. hardware
    terminations).
-   [ ] Query node-to-host mapping and check node logs for physical host errors.
-   [ ] Inspect pod timeline status and coordinator worker container logs.
-   [ ] Recommend appropriate scheduling strategy (On-demand vs Spot) or host VM
    quarantining.

© google · Apache-2.0 · google/skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor