gke-workload-troubleshooting
What it does
This skill finds out why an app in a Google Kubernetes Engine pod is failing. It is for developers whose pods crash, restart or never start.
When to use it
- ✓When pods keep crashing or go into CrashLoopBackOff on GKE.
- ✓When pods are stuck in Pending or ImagePullBackOff and will not start.
- ✓When a pod was killed for running out of memory on GKE.
Skill link
https://github.com/google/skills/blob/main/skills/cloud/gke-workload-troubleshooting/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“My GKE pod keeps restarting with CrashLoopBackOff. Check the logs and events and tell me what is wrong.”
5 new skills a week. 1 minute to read.
How it works
It reads the workload's logs and events within a time window, works out the most likely cause and proposes a fix. It does not change anything live, so you apply the proposed patches yourself.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
GKE Workload Troubleshooting Skill
Use this skill to systematically diagnose and resolve failures in application
workloads deployed in GKE clusters. This skill operates non-interactively and
enforces a read-only diagnostics boundary: it only proposes fixes — whether
Kubernetes manifest/config patches or Google Cloud changes (for example gcloud
IAM bindings or node-pool recreation) — and never executes live mutations
itself.
Attribution
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-workload-troubleshooting)"
and append agent-skills/1.0 (skill:gke-workload-troubleshooting) to User-Agent headers.
🔍 Diagnostic Workflow
Step 0: Non-Interactive Context Discovery & Time Window Definition
Parameter Extraction: Extract required context (
project_id,cluster_name,cluster_location,workload_name,workload_namespace) non-interactively from the user prompt, activeSETTINGS.md, or active environment defaults:- Default
workload_namespacetodefaultif omitted. - Infer missing cluster parameters from active environment (
kubectl config current-contextorgcloud config get-value project). - Prioritize non-interactive context discovery from prompts and environment defaults to ensure autonomous execution flow.
- Default
Cluster Credentials & Fallback Mode:
- Attempt credential fetch:
gcloud container clusters get-credentials {cluster_name} --region/--zone {cluster_location} - Fallback / Dry-Run Mode: If the cluster is unreachable,
non-existent, or live command execution fails (such as in sandboxed
evaluations, dry-run mode, or offline analysis):
- Limit retry attempts to avoid resource exhaustion and context overflow in unreachable cluster scenarios.
- Immediately present the exact sequence of
kubectldiagnostic commands for the human operator to run. - Synthesize the root cause analysis and output the proposed GitOps manifest fix based on the reported symptoms.
- Attempt credential fetch:
Time Handling & Fallbacks:
- Determine Issue Timestamp ({issue_time}):
- Specific Time Provided: If the user provides a specific
timestamp, use it as
{issue_time}. - Relative Time Provided (e.g., "5 minutes ago"): Dynamically
calculate the corresponding UTC timestamp based on current system
time, and use it as
{issue_time}. - No Time Provided (Default): Use current system time as
{issue_time}.
- Specific Time Provided: If the user provides a specific
timestamp, use it as
- Window Calculation: Center a 1-hour query window around
{issue_time}(start_time={issue_time} - 30m,end_time={issue_time} + 30m).
- Determine Issue Timestamp ({issue_time}):
Step 1: Analyze Pod Status and Conditions
Inspect the workload's active pod states and controller status.
Diagnostic Commands:
# 1. Inspect the deployment's actual selector labels:
kubectl get deployment {workload_name} -n {workload_namespace} -o jsonpath='{.spec.selector.matchLabels}'
# 2. Query the pods using the returned labels, for example:
kubectl get pods -l {selector_labels} -n {workload_namespace}
kubectl get deploy/{workload_name} -n {workload_namespace} -o yaml
Diagnostic Decision Tree:
Phase: Pending:
- The Pod cannot schedule on any node. Proceed directly to Step 2 (Query Namespace Events).
State: CrashLoopBackOff / Error:
- The container boots but exits repeatedly; the
kubeletrestarts it with an increasing back-off delay of up to five minutes. First read the terminated reason and exit code:
kubectl describe pod {pod_name} -n {workload_namespace} kubectl get pod {pod_name} -n {workload_namespace} -o jsonpath='{.status.containerStatuses[*].lastState.terminated}'- Reason: OOMKilled (Exit Code 137): The container's memory limit was reached. Proceed to Step 3 (Inspect Logs) → OOM Analysis to classify container-level vs node-level, then Step 5 to propose fixes.
- **Ex
- The container boots but exits repeatedly; the
FAQ
Does it fix my cluster for me?
No. It proposes manifest or Google Cloud fixes and leaves the changes to you.
What if I do not name a namespace?
It uses the default namespace.
Does it cover cluster creation?
No. Cluster infrastructure and node pool creation are outside its scope.
Details
Original description by the author
Diagnoses GKE workload failures (CrashLoopBackOff, OOMKilled, ImagePullBackOff, Pending, etc.) via logs and events. Use when pods fail to start or crash repeatedly. Don't use for GKE cluster infrastructure provisioning, node pool creation, or non-Kubernetes Google Cloud services.
repo: google/skills
Popularity
- GitHub stars
- 22k
- Ranking position
- #10305
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
finding-google-skills
22kHelps your agent find the right Google guides for a setup task, such as hosting, databases, storage, sign-in or AI model serving.
gcloud
22kHelps your agent write and check Google Cloud gcloud commands, looking up exact syntax before it runs anything so it does not guess flags.
google-cloud-recipe-auth
22kGuides your agent through Google Cloud identity and access, including how people and services sign in and which permissions they get.
google-cloud-recipe-onboarding
22kWalks a new developer through first steps on Google Cloud, including choosing a project, linking billing, and deploying a first resource.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.