Skip to content

Get Service Account using Metadata Endpoint

Why

If you're using workload identity in Kubernetes, sometimes you need to know what external (being GCP) Service account you're running as

How

curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/

Want to make this site better? Open a PR or help fund hosting costs