Install the "gke-workload-identity" agent skill from https://github.com/google/skills/tree/main/skills/cloud/gke-workload-identity into .claude/skills/gke-workload-identity/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gke-workload-identity", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add google/skills --skill gke-workload-identity -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "gke-workload-identity" agent skill from https://github.com/google/skills/tree/main/skills/cloud/gke-workload-identity into .agents/skills/gke-workload-identity/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gke-workload-identity", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add google/skills --skill gke-workload-identity -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "gke-workload-identity" agent skill from https://github.com/google/skills/tree/main/skills/cloud/gke-workload-identity into .cursor/skills/gke-workload-identity/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gke-workload-identity", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add google/skills --skill gke-workload-identity -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "gke-workload-identity" agent skill from https://github.com/google/skills/tree/main/skills/cloud/gke-workload-identity into .gemini/skills/gke-workload-identity/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gke-workload-identity", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add google/skills --skill gke-workload-identity -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "gke-workload-identity" agent skill from https://github.com/google/skills/tree/main/skills/cloud/gke-workload-identity into .github/skills/gke-workload-identity/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gke-workload-identity", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add google/skills --skill gke-workload-identity -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "gke-workload-identity" agent skill from https://github.com/google/skills/tree/main/skills/cloud/gke-workload-identity into .opencode/skills/gke-workload-identity/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gke-workload-identity", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
gke-workload-identity
GitHub stars
21k
Token cost
~4.4k tokens
SKILL.md length
1,542 words
Files
1
Skills in repo
150
Repo updated
First seen
Licence
Apache-2.0
At a glance
Configures and diagnoses Workload Identity Federation for GKE authentication failures for Pods (403 "iam.serviceAccounts.getAccessToken" / permission denied, "could not find default credentials", or…
Works in 8 steps: Context discovery & time window → Capture the exact error signature → Verify Workload Identity is enabled… → …
Setting up KSA/GSA bindings (roles/iam.workloadIdentityUser
Calls kubectl, gcloud and curl; reaches console.cloud.google.com
What it does
Gke Workload Identity is an agent skill from google/skills, published by the product's own GitHub organization. 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…
Its SKILL.md is about 4.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Backend & APIs, covering Authorization and RBAC and Container orchestration. It works with Google Kubernetes Engine, Google Cloud and Kubernetes. The repository describes itself as: Agent Skills for Google products and technologies. The licence is Apache-2.0.
When your agent uses it
Setting up KSA/GSA bindings (roles/iam.workloadIdentityUser
Read from SKILL.md and the folder at commit 4b940dd. It shows what the files ask for, not the result of running them.
Tool permissions
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Runs code
Shell commands in SKILL.md call:
kubectl
gcloud
curl
From the folder's file list and the shell code blocks in SKILL.md.
Network
Hosts in commands or code, which the agent is likely to contact:
console.cloud.google.com
Also links to:
docs.cloud.google.com
cloud.google.com
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context cost
Gke Workload Identity loads about 4.4k tokens when it runs. Until then it costs about 220 tokens; SKILL.md has 1,542 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~220
When it runs· the whole SKILL.md, loaded when a task matches
~4.4k
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
Safety
Auto-check passed
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
Download SKILL.mdSave it as .claude/skills/gke-workload-identity/SKILL.md (or your agent's skills folder).
name
gke-workload-identity
description
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).
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 resource
google.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.
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
gcloud command (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.
bash
# 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.
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):
iam.serviceAccounts.getAccessToken denied / 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 leftover iam.gke.io/gcp-service-account annotation (or the client SDK is
configured to impersonate) and is unintentionally impersonating a GSA; go to
Step 3.
403 PERMISSION_DENIED on the target API/resource (no getAccessToken
in the error) → the resolved identity lacks the required IAM role on that
resource; go to Step 4.
could not find default credentials / cannot find the metadata server →
metadata-server connectivity or a startup race; go to Step 5.
Calls succeed but as the node default service account → Workload
Identity is not in effect for this node pool; go to Step 2.
Both the cluster and the node pool the Pod runs on must have Workload
Identity enabled. A node pool with GCE_METADATA (instead of GKE_METADATA)
causes Pods to fall back to the node's default Compute Engine service account.
bash
# Cluster must have a workload identity pool (PROJECT_ID.svc.id.goog).
gcloud container clusters describe "{cluster}" --location "{location}" \
--format="value(workloadIdentityConfig.workloadPool)"
# Node pool must have workloadMetadataConfig.mode = GKE_METADATA.
gcloud container node-pools describe "{node_pool}" --cluster "{cluster}" \
--location "{location}" \
--format="value(config.workloadMetadataConfig.mode)"
Empty workload pool → Workload Identity is not enabled on the cluster.
Node-pool mode is GCE_METADATA (or empty) → the node pool is not using
the GKE metadata server; this is the usual cause of "runs as the node
default service account". Remediation: enable
--workload-metadata=GKE_METADATA on the node pool (propose to a human;
recreates nodes). This is a node-pool configuration problem — not a KSA
annotation or IAM binding problem — so do not change KSA annotations or IAM
bindings to fix it. When the symptom is "runs as the node default service
account", say so explicitly: the root cause is the node pool's
workloadMetadataConfig.mode, and the KSA annotation and IAM bindings are
ruled out as the cause. Propose the exact fix, e.g.:
There are two supported models. Prefer direct binding (current default);
treat GSA impersonation as the legacy path.
How the two models fail differently: with direct binding the KSA
principal accesses resources directly, so failures show up as a plain 403 PERMISSION_DENIED on the target API (fix in Step 4). A 403 iam.serviceAccounts.getAccessToken instead means an impersonation attempt
— intended under the legacy path, or unintended if a leftover
iam.gke.io/gcp-service-account annotation remains on a KSA that was meant to
use direct binding.
(a) Direct KSA binding (no GSA impersonation). The KSA principal is granted
roles directly. Construct the principal identifier and search for its bindings:
(b) Legacy: KSA + GSA impersonation. The KSA must be annotated to point at a
GSA, and the KSA must hold roles/iam.workloadIdentityUser on that GSA.
bash
# The KSA annotation must reference the intended GSA.
kubectl get serviceaccount "{ksa_name}" -n "{namespace}" \
-o jsonpath='{.metadata.annotations.iam\.gke\.io/gcp-service-account}'
# The GSA's IAM policy must bind the KSA member to workloadIdentityUser.
gcloud iam service-accounts get-iam-policy \
"{gsa_name}@{project_id}.iam.gserviceaccount.com" \
--format=json
# Expect a binding: role roles/iam.workloadIdentityUser,
# member serviceAccount:{PROJECT_ID}.svc.id.goog[{NAMESPACE}/{KSA_NAME}]
If the annotation is present but the binding is missing, the binding was
likely removed — check the setIamPolicy audit logs around the failure time
to find the responsible principal.
Step 4: Verify IAM permissions on the target resource
Even with a correct binding, the identity (the KSA principal for direct binding,
or the GSA for legacy) must hold the role required by the API call (for example
roles/storage.objectViewer). The standard IAM Policy Troubleshooter has
limited support for Workload Identity principals; use Cloud Asset Inventory to
search all IAM policies for the principal instead.
bash
# Direct binding: search for the KSA principal's bindings across the project.
gcloud asset search-all-iam-policies \
--scope="projects/{PROJECT_ID}" \
--query='policy:"{PROJECT_ID}.svc.id.goog"'
# Legacy: search for the GSA's bindings on the target resource's project.
gcloud asset search-all-iam-policies \
--scope="projects/{TARGET_PROJECT_ID}" \
--query='policy:"{gsa_name}@{project_id}.iam.gserviceaccount.com"'
If no binding grants the required role on the target resource, that missing
role is the root cause (and Workload Identity itself is not
misconfigured). Present the fix as a proposed change for a human to apply —
the exact add-iam-policy-binding with the real principal and role — never
applying it automatically. For example, for direct binding on a project-level
resource:
Applies when the signature is could not find the metadata server, cannot find the metadata server, or a connection/timeout error. The gke-metadata-server
DaemonSet (in kube-system) brokers the token exchange on each node; requests
to 169.254.169.254 are redirected to it, so a Pod fails closed if it cannot
reach a healthy metadata-server Pod on its node.
(a) Check gke-metadata-server Pod health on the workload's node.
bash
# The DaemonSet Pods must be healthy on the workload's node.
kubectl get pods -n kube-system -l k8s-app=gke-metadata-server -o wide
# A gke-metadata-server Pod can be OOM-evicted when the cluster has many
# (>3,000) Kubernetes service accounts. Look for CrashLoopBackOff, then confirm
# the eviction was OOMKilled.
kubectl get pods -n kube-system | grep CrashLoopBackOff
kubectl describe pod {gke_metadata_server_pod} --namespace=kube-system | grep OOMKilled
(b) Inspect the gke-metadata-server logs (historical, via Cloud Logging;
open as a Logs Explorer deep link, see Step 1):
(c) Connectivity test from the affected Pod — it must reach the metadata
server and (for some client libraries) resolve its DNS name:
bash
# Token endpoint via the hardcoded metadata IP (a healthy path returns a token).
kubectl exec {pod_name} -n {namespace} -- \
curl -sS -H 'Metadata-Flavor: Google' \
'http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token'
Possible causes:
Startup race: the metadata server needs a few seconds after a Pod
starts. Applications that authenticate immediately may fail; the fix is
application-side retries or an initContainer that waits for the metadata
server, not a cluster change.
DNS: some client libraries resolve metadata.google.internal; broken
in-cluster DNS surfaces as cannot find the metadata server. As a
workaround, set GCE_METADATA_HOST=169.254.169.254 to skip DNS resolution.
Network policy / egress: a cluster network policy must allow egress to
169.254.169.254/32 on port 80 (GKE Dataplane V2), or
169.254.169.252/32 on port 988. A default-deny egress rule that blocks
HTTPS to the public Security Token Service (sts.googleapis.com:443)
produces 504 Gateway Timeout or context deadline exceeded.
gke-metadata-server crashing / high restarts: see (a) — reduce the
number of Kubernetes service accounts (<3,000) to restore functionality.
Step 6: "Invalid form of account ID" edge case (legacy GSA impersonation)
Applies only to the legacy GSA impersonation setup (a KSA annotated with
iam.gke.io/gcp-service-account), not to direct principal binding.
Signature: an operation that requires an IAM service account email (for
example, manually creating a Cloud Storage signed URL) fails with:
ERROR: Invalid form of account ID SERVICEACCOUNT_NAME.svc.id.goog.
Should be [Gaia ID | Email | Unique ID | ] of the account
Cause: for a KSA linked to a GSA via annotation, the GKE metadata server by
default returns SERVICEACCOUNT_NAME.svc.id.goog as the identifier, which is
not a valid IAM service account email. This is not a missing IAM binding and
does not require reverting the setup.
Fix (propose to a human): add the
iam.gke.io/return-principal-id-as-email="true" annotation to the Pod's KSA so
the metadata server returns the identity in the expected form:
Present the root cause + evidence (the exact error, the missing binding
/ annotation / node-pool mode, or the metadata-server state). Include a
Cloud Logging deep link (see Step 1) to the supporting entries.
Propose the fix as a command or GitOps manifest change for a human to
apply — never modify IAM, KSAs, or node pools automatically.
Escalate (instead of proposing more self-service diagnostics) when either:
the relevant logs are unavailable (excluded by a filter, or past the log
bucket's retention); or
the identity/binding is correct, the target-resource IAM is correct, and the
metadata server is healthy, yet the failure persists (undetermined root
cause).
In those cases: state the limitation plainly, summarize the findings gathered
(cluster/node-pool config, bindings, annotations, metadata-server state, and any
setIamPolicy audit logs), and route to GKE support / engineering escalation.
Do not fabricate a diagnosis when evidence is missing.
References
This skill is derived from public Google Cloud documentation:
Troubleshoot GKE authentication issues
— the Workload Identity Federation section: WI-enabled check, KSA
annotation, roles/iam.workloadIdentityUser,
iam.serviceAccounts.getAccessToken 403,
iam.gke.io/return-principal-id-as-email, metadata-server DNS and the
gke-metadata-server Pod is crashing
guidance.
Gke Workload Identity next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
Gke Workload Identity compared with similar skills
Hardens managed Kubernetes clusters on EKS, AKS, and GKE by implementing Pod Security Standards, network policies, workload identity (IRSA for EKS, Workload Identity for GKE, Managed Identities for…
Harden and monitor a Kubernetes cluster against the attacks that actually happen — RBAC least privilege and escalation paths, Pod Security Admission enforcement, network policy default-deny, secrets…
Query Cloud Trace spans, filter by latency thresholds or error status, correlate distributed traces with Cloud Logging, and diagnose latency bottlenecks across Google Cloud services.
Manages Google Cloud Privileged Access Manager entitlements and grants: create and edit entitlements, request temporary access, and approve or deny pending grants.
Writes Terraform alerting policies for AI agents that emit OpenTelemetry metrics, covering reliability, cost, safety, security and quality signals on Google Cloud.
Deploys open models or custom weights from Model Garden to Agent Platform endpoints, checks deployment status and cleans up endpoints, confirming before any change.
Searches, manages and scaffolds skills in the Gemini Enterprise Agent Platform Skill Registry using bundled Python scripts and Google Cloud credentials.
Designs GCP infrastructure as local Terraform, validates and scans it against best practices, then imports it to Application Design Center for deployment and troubleshooting.
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 Workload Identity is an agent skill from google/skills, published by the product's own GitHub organization.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.
When should I use Gke Workload Identity?
Gke Workload Identity fits situations like: setting up KSA/GSA bindings (roles/iam.workloadIdentityUser; iam.gke.io/gcp-service-account); A Pod cannot authenticate to Google Cloud APIs; in-cluster Kubernetes RBAC errors (API-server authorization).
How do I install Gke Workload Identity in Claude Code?
Run `npx skills add google/skills --skill gke-workload-identity -a claude-code`. Or copy the skill folder (skills/cloud/gke-workload-identity in google/skills) into .claude/skills/gke-workload-identity in your project. Claude Code loads it when a task matches its description.
How do I install Gke Workload Identity in Codex?
Run `npx skills add google/skills --skill gke-workload-identity -a codex`. Or copy the skill folder (skills/cloud/gke-workload-identity in google/skills) into .agents/skills/gke-workload-identity in your project. Codex loads it when a task matches its description.
Can I use Gke Workload Identity in Cursor, Gemini CLI or GitHub Copilot?
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google/skills --skill gke-workload-identity -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gke-workload-identity, .gemini/skills/gke-workload-identity, .github/skills/gke-workload-identity and .opencode/skills/gke-workload-identity in your project.
What does Gke Workload Identity need to run?
Going by SKILL.md and its folder, Gke Workload Identity needs the command-line tools its instructions call (kubectl, gcloud and curl).
Does Gke Workload Identity access the network?
SKILL.md names 3 domains. In commands or code: console.cloud.google.com; the agent is likely to contact it when it follows the instructions. As links in the text: docs.cloud.google.com and cloud.google.com. This is read from the text; nothing was executed.
Is Gke Workload Identity safe to install?
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
What licence does Gke Workload Identity use?
Gke Workload Identity is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does Gke Workload Identity use?
About 4.4k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
What are the alternatives to Gke Workload Identity?
Skills that share tags, products or a category with Gke Workload Identity: Securing Kubernetes On Cloud (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Dt Obs GCP (Dynatrace/dynatrace-for-ai, 163 stars), Defending Kubernetes (trilwu/secskills, 157 stars) and Mirrord Operator (aiskillstore/marketplace, 433 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Gke Workload Identity?
google (a GitHub organization, an official publisher) maintains it in google/skills, which has 21,097 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on October 9, 2026.
Source: google/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.