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