concept

GKE identity network and storage

Use federation to obtain short-lived access without distributing service account key files. On eligible GKE workloads, grant a narrow resource role to the Kubernetes identity directly when the target API supports it. An alternative is impersonation of an IAM service account, which needs its own permissions and linkage. Autopilot enables federation; Standard needs appropriate cluster and node pool configuration. The example principal is fictional: the numeric project number and project ID are different fields, and namespace and ServiceAccount name identify the subject. Beware of identity sameness across clusters sharing the same workload identity pool; design isolation accordingly.

Formal Syntax & Structure

kubernetes syntaxkubernetes
principal://iam.googleapis.com/projects/123456789012/locations/global/workloadIdentityPools/bytemind-demo.svc.id.goog/subject/ns/bookstore/sa/catalog

Working Example

Example Snippetkubernetes
apiVersion: v1kind: Podmetadata:  name: catalog  namespace: bookstorespec:  serviceAccountName: catalog  containers:    - name: app      image: registry.invalid/catalog:offline      resources:        requests:          cpu: 250m          memory: 256Mi
Kubernetes Reference