gke-workload-identity
Was er macht
Dieser Skill findet heraus, warum eine App in einem GKE-Pod sich nicht bei Google-Cloud-APIs anmelden kann. Gedacht ist das für Entwickler, die Berechtigungs- oder Anmeldefehler in ihrem Cluster sehen.
Wann du ihn nutzt
- ✓Wenn ein Pod einen 403-Fehler zu iam.serviceAccounts.getAccessToken oder Permission denied erhält.
- ✓Wenn ein Pod meldet, dass keine Standard-Anmeldedaten gefunden wurden oder der Metadatenserver nicht erreichbar ist.
- ✓Wenn ein API-Aufruf aus einem Pod das Dienstkonto des Knotens statt der Identität des Workloads verwendet.
Link zum Skill
https://github.com/google/skills/blob/main/skills/cloud/gke-workload-identity/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Mein GKE-Pod bekommt einen Fehler Permission denied, wenn er Cloud Storage aufruft. Finde heraus, warum, und sag mir die Lösung.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Er prüft die Workload-Identity-Einstellungen von Cluster und Knotenpool sowie die Verknüpfung zwischen dem Kubernetes-Dienstkonto und dem Google-Cloud-Dienstkonto. Er meldet die Lücke und schlägt eine Korrektur vor, die eine Person anwendet.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
GKE Workload Identity Federation Troubleshooting Skill
Use this skill to systematically diagnose why a Pod using Workload Identity Federation for GKE cannot authenticate to Google Cloud APIs. Typical symptoms:
HTTP/403 ... Permission 'iam.serviceAccounts.getAccessToken' denied on resourcegoogle.auth.exceptions ... could not find default credentials/ComputeEngineCredentials cannot find the metadata server- API calls that unexpectedly use the node's default Compute Engine service account instead of the workload's identity.
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-identity)"
and append agent-skills/1.0 (skill:gke-workload-identity) to User-Agent headers.
Read-only boundary
This skill is diagnostic and non-interactive. It only reads cluster, IAM, and logging state and proposes fixes as commands or GitOps manifest changes for a human to apply. It must never create or modify IAM bindings, KSA annotations, node pools, or clusters automatically. When evidence is missing or the fix requires a privileged change, summarize findings and hand off to a human (see Step 7).
Output discipline (apply to every conclusion)
When you report a diagnosis, always:
- Name the single most-likely root cause (not an open-ended list of possibilities).
- Explicitly rule out the other plausible causes, citing the evidence that excludes them. In particular, when the cause is node-pool configuration, state plainly that it is not a KSA annotation or IAM binding problem; when the cause is a missing role on a target resource, state that Workload Identity itself is not misconfigured.
- Give the exact remediation as a proposed change for a human — a concrete
gcloudcommand (or GitOps manifest edit) with the real identifiers filled in — and never apply it automatically.
Diagnostic Workflow
Step 0: Context discovery & time window
Collect (from the user or the failing resource): PROJECT_ID, PROJECT_NUMBER,
CLUSTER, cluster LOCATION, NAMESPACE, the KSA the Pod runs as, the
node and node pool the Pod is scheduled on (used in Step 2), the target
resource / API being called, and the exact error string. Define a time
window around the first observed failure for log queries.
# Resolve the project number (used in the direct-binding principal identifier).
gcloud projects describe "{PROJECT_ID}" --format="value(projectNumber)"
# Confirm which KSA the workload runs as.
kubectl get pod "{pod_name}" -n "{namespace}" \
-o jsonpath='{.spec.serviceAccountName}'
# Identify the node the Pod runs on, then the node pool that node belongs to
# (Step 2 checks the node pool's Workload Identity mode).
NODE=$(kubectl get pod "{pod_name}" -n "{namespace}" -o jsonpath='{.spec.nodeName}')
kubectl get node "$NODE" \
-o jsonpath='{.metadata.labels.cloud\.google\.com/gke-nodepool}'
Step 1: Capture the exact error signature
Read the workload's own logs and the gke-metadata-server logs to classify the
failure.
kubectl logs "{pod_name}" -n "{namespace}" --all-containers --prefix
kubectl describe pod "{pod_name}" -n "{namespace}"
Equivalent via Cloud Logging (preferred for historical events). Open it as a
Logs Explorer deep link — URL-encode the query and append the project and
time window:
https://console.cloud.google.com/logs/query;query={URL_ENCODED_QUERY};timeRange={start}%2F{end}?project={project_id}
(encode / as %2F, or use ;duration=PT1H for a rolling hour):
resource.type="k8s_container"
resource.labels.namespace_name="{namespace}"
resource.labels.pod_name="{pod_name}"
severity>=WARNING
Classify the signature:
iam.serviceAccounts.getAccessTokendenied /HTTP/403→ the workload is using the GSA impersonation path. This is expected for the legacy setup, but if you intend to use direct binding, it means the KSA still carries a leftoveriam.gke.io/gcp-service-account
Häufige Fragen
Ändert er meine IAM-Bindungen?
Nein. Er liest nur die Einrichtung und schlägt Korrekturen vor, die eine Person anwendet.
Welche Arten von Fehlern behandelt er?
Permission denied beim Token-Zugriff, fehlende Standard-Anmeldedaten und nicht erreichbare Metadatenserver.
Was macht er nicht?
Er erstellt oder ändert keine IAM-Bindungen, Annotationen von Dienstkonten, Knotenpools oder Cluster.
Details
Originalbeschreibung des Autors
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
repo: google/skills
Beliebtheit
- GitHub-Sterne
- 22k
- Platz im Ranking
- #10301
- Lizenz
- Apache-2.0
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
finding-google-skills
22kHilft deinem Agenten, die richtigen Google-Anleitungen für eine Einrichtungsaufgabe zu finden, etwa für Hosting, Datenbanken, Speicher, Anmeldung oder das Bereitstellen von KI-Modellen.
gcloud
22kHilft deinem Agenten, gcloud-Befehle für Google Cloud zu schreiben und zu prüfen, und schlägt die genaue Syntax nach, bevor etwas ausgeführt wird, damit keine Flags geraten werden.
google-cloud-recipe-auth
22kFührt deinen Agenten durch Identität und Zugriff in Google Cloud, einschließlich Anmeldung von Personen und Diensten und der Berechtigungen, die sie erhalten.
google-cloud-recipe-onboarding
22kFührt einen neuen Entwickler durch die ersten Schritte in Google Cloud, darunter Projektauswahl, Verknüpfung der Abrechnung und die Bereitstellung einer ersten Ressource.
Ähnliche Skills
reverse-engineer-anything
422kHilft deinem Agenten, fertige Apps und Pakete zu untersuchen, um Funktionen zu erklären, Versionen zu vergleichen oder einen Nachbau zu leiten, mit dem REA-Tool.
1password
394kHilft deinem Agenten, die 1Password-Kommandozeile einzurichten, sich anzumelden und Geheimnisse zu lesen oder einzufügen, ohne deren Werte im Chat auszugeben.
healthcheck
394kHilft deinem Agenten, den Computer oder Server, auf dem OpenClaw läuft, auf Sicherheitsrisiken wie SSH, Firewall, Updates und Backups zu prüfen und sichere Korrekturen vorzuschlagen.