Workload Identity
Create Service Accounts
Create a Kubernetes Service Account (KSA)
kubectl create serviceaccount helloworld \
--dry-run -oyaml > k8s/helloworld-sa.yaml
kubectl apply -f k8s/helloworld-sa.yamlCreate a Google Cloud Service Account (GSA)
gcloud iam service-accounts create helloworld
PROJECT_ID=$(gcloud config get-value project)
gcloud projects add-iam-policy-binding ${PROJECT_ID} \
--member serviceAccount:helloworld@${PROJECT_ID}.iam.gserviceaccount.com \
--role roles/pubsub.publisherBind Service Accounts
Binding from Google Cloud
Binding from Kubernetes
Use the Kubernetes Service Account
Last updated
Was this helpful?