Skip to content

Get service account token using Metadata Endpoint

Why

If you're running a workload in GKE, sometimes it's useful to know what project that pod runs under

How

curl -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token

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