gke-workload-identity
Configures and diagnoses Workload Identity Federation for GKE authentication failures for Pods (403 "iam.serviceAccounts.getAccessToken" / permission denied…
Skill by googleOfficial
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/google-gke-workload-identity
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, devops, cloud, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/gke-workload-identity
What's inside
- Skill 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).
- License
- Apache-2.0
- Metadata
- version: 1.0.2 · category: Security
- Instructions
- 365 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (2)
- SKILL.md
- attribution.md · references/
SKILL.md (first lines)
# 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
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.
## Attribution
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
MUST read [Usage Attribution](references/attribution.md). 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:
1. **Name the single most-likely root cause** (not an open-ended list of
possibilities).
2. **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.
3. **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.
```bash
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.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.
--------------------------------------------------------------------------------
### Step 2: Verify Workload Identity is enabled (cluster + node pool)
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`)From google/skills, Apache-2.0.
More from google/skills
- 0.865score
google-ads-api-account-diagnostics
google-ads-api-teamOfficial
Diagnoses Google Ads account performance issues such as conversion loss (value or volume), low lead flow/volume, and lost impression share (opportunities) due…
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-triage
Google LLCOfficial
Expert guidance for security alert triage in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-detection-engineering
Google LLCOfficial
Author, validate, test, and deploy YARA-L 2.0 detection rules and evaluate end-to-end detection coverage gaps in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-hunt
Google LLCOfficial
Expert guidance for proactive threat hunting in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-cases
Google LLCOfficial
Manage Google Security Operations (SecOps) SOAR cases throughout their lifecycle.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.861score
secops-investigate
Google LLCOfficial
Expert guidance for deep security incident and entity investigations in Google SecOps.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.824score
google-ads-api-quickstart
google-ads-api-teamOfficial
Guides developers through Google Ads API quickstart: credential setup, choosing from 6 client libraries/REST, configuring environments, and running a…
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.819score
google-ads-api-mcp-setup
google-ads-api-teamOfficial
Guides developers through downloading, configuring, and installing the official open-source Google Ads MCP Server.
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.815score
ima-dai-sdk
Google LLCOfficial
Integrates the Google Interactive Media Ads (IMA) Dynamic Ad Insertion (DAI) SDK into websites, web apps, mobile apps, or TV apps.
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.815score
ima-sdk-client-side
Google LLCOfficial
Supports Interactive Media Ads (IMA) SDK.
SkillBFreshness: B★ 21.5KClaude Code +9 - 0.699score
gcloud
googleOfficial
Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
agent-platform-deploy
googleOfficial
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up…
SkillAFreshness: A★ 21.5KClaude Code +9
Signals
- Stars
- 21,542
- Forks
- 1,821
- Open issues
- 21
- Last commit (this folder)
- Oct 19, 2026 (9 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0.2
- License
- Apache-2.0
- Repository
- github.com/google/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from google
- 0.699score
retrieving-developer-knowledge
googleOfficial
Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI/Gemini, Android, Chrome, Web, Flutter, Go, Firebase, and…
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
data-manager-api-setup
googleOfficial
Guides developers through client library installation and authentication setup steps for the Data Manager API.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
agent-platform-migrate-from-ai-studio
googleOfficial
Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI).
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
gcloud
googleOfficial
Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
google-cloud-recipe-onboarding
googleOfficial
Guides a developer's first steps on Google Cloud, covering account creation, billing setup, project management, and deploying a first resource.
SkillAFreshness: A★ 21.5KClaude Code +9 - 0.699score
agent-platform-deploy
googleOfficial
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up…
SkillAFreshness: A★ 21.5KClaude Code +9
Cite this page
gke-workload-identity skill. Agent Mart. https://agentmart.dev/skills/google-gke-workload-identity (last updated 2026-10-24)