gke-workload-troubleshooting
Routes a named workload that is failing for an unknown reason to the focused skill for its symptom. Use when the question names one Deployment, StatefulSet, DaemonSet or pod as broken, down or misbehaving without saying how. For a known symptom load pod-crashloop-oom, pod-pending-scheduling, pod-container-creating or service-connectivity directly; for a cluster-wide health question load workload-triage-scan.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 126
- Forks
- 44
01 前言 Front Matter
- name
- gke-workload-troubleshooting
- description
- Routes a named workload that is failing for an unknown reason to the focused skill for its symptom. Use when the question names one Deployment, StatefulSet, DaemonSet or pod as broken, down or misbehaving without saying how. For a known symptom load pod-crashloop-oom, pod-pending-scheduling, pod-container-creating or service-connectivity directly; for a cluster-wide health question load workload-triage-scan.
03 SKILL.md 正文
Task
Find which symptom a named workload shows, with projected reads, and hand it to the focused skill that owns that symptom.
Workflow
-
Project the controller's selector, replica counts and conditions (skip for a bare pod), then read the workload's pods projected to the fields that decide the symptom:
kubectl get <kind> <name> -n <namespace> -o jsonpath='matchLabels={.spec.selector.matchLabels} specReplicas={.spec.replicas}{.status.desiredNumberScheduled} replicas={.status.replicas} readyReplicas={.status.readyReplicas}{.status.numberReady} conditions={.status.conditions}' kubectl get pods -n <namespace> -l <selector> -o custom-columns='NAME:.metadata.name,PHASE:.status.phase,REASON:.status.reason,READY:.status.containerStatuses[*].ready,WAITING:.status.containerStatuses[*].state.waiting.reason,TERM:.status.containerStatuses[*].state.terminated.reason,TERM_EXIT:.status.containerStatuses[*].state.terminated.exitCode,TERM_FINISHED:.status.containerStatuses[*].state.terminated.finishedAt,LAST:.status.containerStatuses[*].lastState.terminated.reason,EXIT:.status.containerStatuses[*].lastState.terminated.exitCode,RESTARTS:.status.containerStatuses[*].restartCount,FINISHED:.status.containerStatuses[*].lastState.terminated.finishedAt,INIT:.status.initContainerStatuses[*].state.waiting.reason,INIT_TERM:.status.initContainerStatuses[*].state.terminated.reason,INIT_TERM_FINISHED:.status.initContainerStatuses[*].state.terminated.finishedAt,INIT_LAST:.status.initContainerStatuses[*].lastState.terminated.reason,INIT_EXIT:.status.initContainerStatuses[*].lastState.terminated.exitCode,INIT_FINISHED:.status.initContainerStatuses[*].lastState.terminated.finishedAt,COND_TRANSITION:.status.conditions[*].lastTransitionTime,AGE:.metadata.creationTimestamp,DELETING:.metadata.deletionTimestamp,OWNER:.metadata.ownerReferences[*].kind'Here
<kind>isdeployment,statefulsetordaemonset(wheredesiredNumberScheduledandnumberReadysupplyspecReplicasandreadyReplicas, and an omittedreadyReplicasmeans0). For a bare pod, skip the controller read and pass--field-selector metadata.name=<pod>. -
Before matching the table, set aside terminating, startup-grace and retained-history pod rows using the same rules as
workload-triage-scan: a pod withDELETINGset (deletionTimestampother than<none>) is terminating (initializing); a pod under 10 minutes old byAGEthat isPending(with no image-pull, config or crash waiting reason), waiting inContainerCreating/PodInitializing, orRunningnot Ready, with no non-zero termination in the last 60 minutes (TERM_FINISHED,INIT_TERM_FINISHED,FINISHEDandINIT_FINISHED<none>or older than 60 minutes), is initializing; and aPHASE=FailedorREASON=Evictedpod whose failure timestamp (the newest timestamp acrossTERM_FINISHED,INIT_TERM_FINISHED,FINISHEDandINIT_FINISHED, else the newestconditions[].lastTransitionTimeinCOND_TRANSITION, elseAGE) is more than 60 minutes old, whoseOWNERisReplicaSet,StatefulSetorDaemonSet, and whose live siblings satisfyreadyReplicas == specReplicas(withspecReplicas > 0, or at least one live Ready sibling) is retained history — note any of these in context, but do not match them against the failure rows below (if every pod of the workload is initializing, report it as initializing without loading a focused skill). For the remaining pods and the controller, load the skill (or follow the direct action) for the first row that matches:Pod / controller state Skill / action PHASE=Failed,REASON=Evicted,CrashLoopBackOff,RunContainerError,Error,OOMKilled,TERMset to a failure reason (other thanCompleted), non-zeroTERM_EXIT/EXIT, restarts climbing (RESTARTS > 0withTERM_FINISHED,INIT_TERM_FINISHED,FINISHEDorINIT_FINISHEDwithin the last 60 minutes),Runningnot Ready, orPodInitializingwithINIT/INIT_TERM/INIT_LASTshowingCrashLoopBackOff,RunContainerError,Error,OOMKilledor a non-zeroINIT_EXITpod-crashloop-oomPendingwith no container or init-container waiting/terminated statepod-pending-schedulingContainerCreating,PodInitializing,ImagePullBackOff,ErrImagePull,InvalidImageName,ErrImageNeverPull,CreateContainerConfigError,CreateContainerError(inWAITINGorINIT)pod-container-creatingPHASE=Succeeded(all containers exited0), controller or podNotFound, no pods returned,ReplicaFailure=True, orreadyReplicas < specReplicaswith no unhealthy podNo focused skill (follow the direct steps below) At least one live pod returned, all live pods RunningandReady(specReplicas > 0andreadyReplicas == specReplicasfor a controller), callers report timeoutsservice-connectivityAny other non-healthy pod or controller state not matched above pod-crashloop-oomFor the No focused skill row (
PHASE=Succeeded,NotFound, no pods returned,ReplicaFailure=True, orreadyReplicas < specReplicaswith no unhealthy pod):PHASE=Succeeded: report that the pod or Job run completed cleanly (TERM=Completed, exit code0), and record at step 3.NotFound: report that<kind>/<name>or<pod>was not found in<namespace>.specReplicas == 0: report that the workload is scaled to zero.- Otherwise: read
kubectl get events -n <namespace> --field-selector reason=FailedCreate(plus--field-selector involvedObject.name=<name>for the controller or owning ReplicaSet) alongside the controller'sReplicaFailureandProgressingconditions, report the quota, webhook or policy rejection message (or an active rollout when no creation failure exists), and record at step 3.
-
Conclude that the reported fault is not in this workload only when at least one pod is returned, every live (non-
DELETING, non-retained-history) pod isRunningandReadywith no restart in the last 60 minutes (TERM_FINISHED,INIT_TERM_FINISHED,FINISHEDandINIT_FINISHED<none>or older than 60 minutes), and (for a controller)specReplicas > 0,readyReplicas == specReplicasandReplicaFailureis notTrue; cite the controller and pod rows you read (and for a cluster-wide scan routed throughworkload-triage-scan,"No failing workloads."requires bothunhealthy: 0andsystem unhealthy: 0). Record the finding asworkload-triage-scan/references/reporting.mddescribes.
Rules
- Never
sleepor--watch; report the state you read.
04 同仓库更多 Skills
gke-workload-troubleshooting
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.
gke-workload-security
Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running security audits (`audit_cluster.sh`), enforcing Network Policies (default-deny and Dataplane V2 logging), isolating high-risk pods inside GKE Sandbox (`gVisor`), enforcing Pod Security Standards (`restricted` labeling) and pod securityContext, and mounting Secret Manager secrets via CSI (`SecretProviderClass`). Use when auditing workload security posture, isolating namespaces, applying pod security standards, or configuring network policies and secret volume mounts. Don't use for Workload Identity (use gke-workload-identity), cluster-wide control plane security, RBAC hardening, Binary Authorization, Shielded Nodes, or enabling platform-level GKE add-ons (use gke-platform-security instead).
gke-workload-scaling
Manages scaling for GKE workloads using HPA and VPA. Use when configuring Horizontal Pod Autoscaler (HPA), configuring Vertical Pod Autoscaler (VPA), or applying best practices for GKE workload autoscaling. Do not use for cluster-level autoscaling (Cluster Autoscaler), static cluster sizing, or configuring node-level machine styles directly.
gke-workload-identity
Configures and diagnoses Workload Identity Federation for GKE authentication failures for Pods (403 "iam.serviceAccounts.getAccessToken" / permission denied, "could not find default credentials", or GKE metadata server unreachable) by verifying cluster and node-pool Workload Identity configuration, the Kubernetes ServiceAccount (KSA) to IAM binding (direct principal binding and legacy Google ServiceAccount impersonation), target-resource IAM roles, and gke-metadata-server health. Use when setting up KSA/GSA bindings (`roles/iam.workloadIdentityUser`, `iam.gke.io/gcp-service-account`) or when a Pod cannot authenticate to Google Cloud APIs. Don't use for in-cluster Kubernetes RBAC errors (API-server authorization), general workload crashes (use gke-workload-troubleshooting), or Pod Security Standards and NetworkPolicies (use gke-workload-security).
gke-upgrades
Plans, executes, and validates Google Kubernetes Engine (GKE) cluster upgrades and maintenance operations for both Standard and Autopilot clusters. Produces upgrade plans, pre/post-upgrade checklists, maintenance runbooks with gcloud commands, release channel strategy, and troubleshooting guides. Handles node pool upgrade strategies (surge, blue-green), version compatibility, PDB management, and workload-specific concerns (stateful, GPU, operators). Use this skill whenever the user mentions GKE upgrades, Kubernetes version bumps, node pool maintenance, GKE patching, cluster version management, release channel selection, maintenance windows, surge upgrades, stuck upgrades, or any GKE lifecycle management task — even casual mentions like "we need to upgrade our clusters" or "plan our next GKE maintenance" or "our upgrade is stuck." Don't use for GKE cluster creation, application onboarding, general networking/routing setup, or security policy configurations (use gke-basics or relevant GKE skills instead).
gke-tpu-metrics-monitoring
Monitors and troubleshoots GKE TPU workloads, nodes, and node pools using GKE system metrics and PromQL. Use when monitoring TensorCore duty cycle, TPU memory, node readiness, multi-host TPU node pool availability, host maintenance or preemption interruptions, and calculating MTTR or MTBI metrics for GKE TPUs. Don't use for general non-TPU GKE workload monitoring or non-metric TPU debugging.