Loading...
Loading...
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.
npx skill4agent add google/skills gke-workload-troubleshootingproject_idcluster_namecluster_locationworkload_nameworkload_namespaceSETTINGS.mdworkload_namespacedefaultkubectl config current-contextgcloud config get-value projectgcloud container clusters get-credentials {cluster_name} --region/--zone {cluster_location}kubectl{issue_time}{issue_time}{issue_time}{issue_time}start_time{issue_time} - 30mend_time{issue_time} + 30m# 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 yamlkubectl get pod {pod_name} -n {workload_namespace} -o jsonpath='{.status.containerStatuses[*].lastState.terminated}'kubectl get events -n {workload_namespace} --sort-by='.metadata.creationTimestamp'
# Or query Cloud Logging for historical GKE events within the time window:
gcloud logging read "resource.type=\"k8s_cluster\" AND logName=\"projects/{project_id}/logs/events\" AND jsonPayload.involvedObject.namespace=\"{workload_namespace}\"" --start-time="{start_time}" --end-time="{end_time}" --project="{project_id}"{start_time}{end_time}FailedScheduling0/3 nodes are available: 3 Insufficient memory.FailedMountPVCSecret "{secret_name}" not foundConfigMap "{configmap_name}" not foundFailedBackOffgit log -p -S "{image_name}" -- {manifest_file_path}git log# Check current active log stream (handles multi-container pods)
kubectl logs {pod_name} -n {workload_namespace} --all-containers --tail=100
# Check logs from previously terminated container instances (handles multi-container pods)
kubectl logs {pod_name} -n {workload_namespace} --all-containers -p --tail=100spec.containers[*].commandpanic:NullPointerExceptionTraceback (most recent call)Connection timed outdial tcp: i/o timeoutRead-only file systemPermission denied/tmp/var/logemptyDir# Verify target endpoint is active
kubectl get endpoints {target_service_name} -n {target_namespace}
# Query network policies inside namespace
kubectl get networkpolicies -n {workload_namespace} -o yamlkubectl get endpointsNetworkPolicykubectlworker.pyapp.goaccount-db5432kubectl get endpointskubectl get networkpoliciesNetworkPolicy