GKE identity network and storage
Three independent identities
A Kubernetes ServiceAccount identifies a workload in Kubernetes. Kubernetes RBAC authorizes Kubernetes API operations; Google Cloud IAM authorizes Google Cloud resource access. Node service accounts perform infrastructure tasks such as pulling private images. If a Pod cannot pull an image from Artifact Registry, first review the appropriate node identity and repository permissions; giving the application a broad Cloud Storage role does not fix a registry pull.
Kubernetes API -> Kubernetes authentication and authorizationCloud API -> workload identity and IAMimage pull -> node identity and repository authorizationWorkload Identity Federation for GKE
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.
principal://iam.googleapis.com/projects/123456789012/locations/global/workloadIdentityPools/bytemind-demo.svc.id.goog/subject/ns/bookstore/sa/catalogAttach the workload identity
This Pod fragment is an offline full object with a deliberately unusable image. A ServiceAccount name is not itself an IAM grant. For direct federation, no IAM service account annotation is required; the actual IAM policy and metadata service configuration must be checked separately. Do not copy Azure workload identity annotations into GKE. A successful token exchange also does not prove the workload is allowed to perform a given action on a resource.
apiVersion: v1kind: Podmetadata: name: catalog namespace: bookstorespec: serviceAccountName: catalog containers: - name: app image: registry.invalid/catalog:offline resources: requests: cpu: 250m memory: 256MiVPC-native Pod IP capacity
For an IPv4 VPC-native Standard cluster configured for 110 Pods per node, use the documented /24 per-node Pod address allocation. A /20 secondary Pod range contains sixteen /24 blocks. With twelve nodes and three planned surge nodes, one block remains. This is only the Pod address-range gate, not a guarantee of node capacity. Node primary subnet space, Service addresses, other pools, quotas and actual allocation must be checked separately. Smaller maximum-Pod settings can change the block size.
10.44.0.0/20 -> 16 /24 blocks12 current + 3 surge = 15 blocksremaining = 1 blockNetwork policy and persistent storage
GKE Dataplane V2 uses eBPF-based networking and integrates Kubernetes NetworkPolicy. Do not use Pod or Service IPs as ipBlock selectors in Dataplane V2; use the supported label selectors for Pod traffic and verify intended allow and deny flows. Persistent Disk CSI is a block-storage option; access modes and zone placement depend on the disk type and driver. Filestore CSI is an option for shared file storage with ReadWriteMany where supported. Neither storage choice replaces backups. Inspect the StorageClass, driver, access mode, topology and recovery plan before provisioning.
single-writer zonal disk -> review Persistent Disk CSIshared file access -> review Filestore CSIbackup and restore -> verify independentlyPractice and next steps
Use network-cases.json and identity-cases.json to calculate Pod IP headroom and distinguish failed identity gates. Explain why registry and workload permissions differ. Run python validate_offline.py from lab-fixtures/google-gke/. No network requests are made. Next: GKE lifecycle and cost plan.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
GKE identity network and storage — knowledge check
Map workload identity and network choices
Which identity normally needs private Artifact Registry pull access?
What is a benefit of Workload Identity Federation for GKE?
For a /20 range split into /24 blocks, how many blocks exist?
Which selector is suitable for Pod-to-Pod rules on Dataplane V2?
Which storage candidate fits shared file access by multiple nodes?