AGENT SKILL

pod-pending-scheduling

Finds why a pod stays Pending and cannot be scheduled. Use for Pending pods, FailedScheduling events, "Insufficient cpu" or "Insufficient memory", untolerated taints, node affinity or nodeSelector mismatches, unbound PersistentVolumeClaims at scheduling, ResourceQuota limits and Autopilot ComputeClass placement. Proposes the manifest or capacity fix.

License 许可
Apache-2.0
最近更新
2026-11-14
Stars
★ 126
Forks
44

01 前言 Front Matter

name
pod-pending-scheduling
description
Finds why a pod stays Pending and cannot be scheduled. Use for Pending pods, FailedScheduling events, "Insufficient cpu" or "Insufficient memory", untolerated taints, node affinity or nodeSelector mismatches, unbound PersistentVolumeClaims at scheduling, ResourceQuota limits and Autopilot ComputeClass placement. Proposes the manifest or capacity fix.

03 SKILL.md 正文

Task

Name why one pod cannot be placed, quote the scheduler's message, and propose the fix. Replicas of one controller share a cause: read one.

Workflow

  1. Read the pod's placement constraints and scheduling condition in one projected call:

    kubectl get pod <pod> -n <namespace> -o json | jq '{owner: .metadata.ownerReferences, nodeSelector: .spec.nodeSelector, affinity: .spec.affinity, tolerations: .spec.tolerations, priorityClassName: .spec.priorityClassName, requests: [.spec.containers[] | {name, requests: .resources.requests}], volumes: [.spec.volumes[]? | select(.persistentVolumeClaim) | .persistentVolumeClaim.claimName], conditions: .status.conditions}'
    
  2. Read the scheduler's events for the pod:

    kubectl get events -n <namespace> --field-selector involvedObject.name=<pod> -o custom-columns=LAST:.lastTimestamp,REASON:.reason,COUNT:.count,MESSAGE:.message
    
  3. Read the nodes' pools, taints and allocatable capacity, only if the message names resources, taints or affinity:

    kubectl get nodes -o custom-columns='NAME:.metadata.name,POOL:.metadata.labels.cloud\.google\.com/gke-nodepool,CLASS:.metadata.labels.cloud\.google\.com/compute-class,TAINTS:.spec.taints[*].key,CPU:.status.allocatable.cpu,MEMORY:.status.allocatable.memory'
    
  4. Read quota or claims only if the message names them:

    kubectl get resourcequota,pvc -n <namespace> -o wide
    
  5. Record the finding as workload-triage-scan/references/reporting.md describes. Stop once the cause, the evidence and any applicable patch are written. When no manifest fix applies (an active scale-up, or a gone/- warning row whose replacement pod is already running), report the confirming evidence with no proposed patch.

Signatures

Scheduler message Cause Patch
Insufficient cpu, Insufficient memory Requests exceed free allocatable capacity Lower requests to real usage, or enlarge or autoscale the node pool
had untolerated taint(s) Pod lacks the toleration (Spot, GPU, system) Add the matching toleration, or target an untainted pool
didn't match Pod's node affinity/selector Selector or affinity names no existing node Correct the label, or create the pool it names
persistentvolumeclaim "<name>" not found, unbound Missing or unprovisioned claim Create the claim; for a provisioning error load pod-container-creating
exceeded quota Namespace ResourceQuota reached Raise the quota or lower requests
pod triggered scale-up, TriggeredScaleUp Cluster autoscaler or Autopilot adding a node None: report the pod as initializing
max node group size reached, ScaleUpFailed Node pool at its autoscaling ceiling Raise the pool's max nodes, or lower requests

On Autopilot, a ComputeClass the pod selects that cannot be provisioned shows in the events; quote that event.

Rules

  • Budget about five commands.
  • When routed from a WARNING EVENTS row whose pod is gone (deleted after rollback, scale-down or preemption) or whose object is not a pod (STATE -), skip step 1 (kubectl get pod): read step 2's events for that object's involvedObject.name (plus the owning workload's current pods for a gone pod if needed to confirm recovery) and proceed from step 3 or step 4 as the event message requires.
  • A scale-up in progress is reported, never waited on: no sleep, no --watch.
  • Do not run gcloud container clusters get-credentials. Preflight has pinned the kubeconfig.

04 同仓库更多 Skills

gke-labs
gke-labs/kube-agents

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.

★ 126
gke-labs
gke-labs/kube-agents

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).

★ 126
gke-labs
gke-labs/kube-agents

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.

★ 126
gke-labs
gke-labs/kube-agents

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).

★ 126
gke-labs
gke-labs/kube-agents

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).

★ 126
gke-labs
gke-labs/kube-agents

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.

★ 126