GKE interview question · Most asked

How does Workload Identity Federation for GKE work?

How it works

Members can save this page, take notes and track progress. See membership · Sign in

Summary

It lets a Kubernetes ServiceAccount act as a Google Cloud identity without keys: the GKE metadata server exchanges the Pod's Kubernetes token for short-lived Google credentials. You grant IAM roles directly to the Kubernetes ServiceAccount's principal (or bind it to impersonate a Google service account).

Longer Answer

  • Principal format: principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/PROJECT_ID.svc.id.goog/subject/ns/NAMESPACE/sa/KSA_NAME.
  • Enabled by default on Autopilot; enable it on Standard clusters and node pools.
  • One Kubernetes ServiceAccount per workload, least-privilege roles.
  • Replaces mounting JSON keys as Secrets, which leak easily.

Key Points

  • Pods get Google credentials without keys.
  • Grant roles to the Kubernetes ServiceAccount principal.
  • On by default in Autopilot.
  • Per-workload ServiceAccounts.

Explanation

What interviewers look for

Keyless workload authentication and least privilege per workload.

More GKE questions

← All GKE questions

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake