Unable to access the GCP metadata server from a pod
Issue
-
The Google metadata server is not accessible from within a pod:
$ oc rsh $POD curl -s "http://metadata.google.internal/computeMetadata/v1/instance/zone" -H "Metadata-Flavor: Google" command terminated with exit code 7 -
Running the same command from the node or a pod with
hostNetwork: trueworks:$ oc debug node/${NODE} -- curl -s "http://metadata.google.internal/computeMetadata/v1/instance/zone" -H "Metadata-Flavor: Google" Starting pod/pbertera-03285776-s9fkd-worker-a-x77wx-debug ... To use host binaries, run `chroot /host` projects/123456789/zones/europe-west3-a Removing debug pod ...
Environment
- Red Hat OpenShift Container Platform
- Google Cloud Platform
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.