Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Update static GCP metadata URL #1855

Merged
merged 1 commit into from
Apr 21, 2019

Conversation

nicktrav
Copy link
Contributor

@nicktrav nicktrav commented Apr 21, 2019

When running Istio on Google Kubernetes Enginge (GKE), the Envoy sidecar
proxy will fail to route any requests made to the metadata server via
the metadata hostname (requests will 404). Requests made to the fully
qualified metadata.google.internal hostname can be routed.

Update the constant for the metadata host in GcpMetadataConfig to use
the FQDN.

@nicktrav
Copy link
Contributor Author

This follows what was done in googleapis/google-cloud-java#4278 (fixing the same Istio on GKE problem raised in googleapis/google-cloud-java/pull/4269). Looks like GcpMetadataConfig is a port from the code in that repo, so I just ported the change over here.

When running Istio on Google Kubernetes Enginge (GKE), the Envoy sidecar
proxy will fail to route any requests made to the metadata server via
the `metadata` hostname (requests will 404). Requests made to the fully
qualified `metadata.google.internal` hostname can be routed.

Update the constant for the metadata host in `GcpMetadataConfig` to use
the FQDN.
Copy link
Contributor

@songy23 songy23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this be compatible with non-GKE environment? e.g GCE instances

@nicktrav
Copy link
Contributor Author

I can't really speak for GCP, but it seems like GCE knows about the FQDN:

nick.travers@nickt-test:~$ host metadata
metadata.google.internal has address 169.254.169.254
nick.travers@nickt-test:~$ host metadata.google.internal
metadata.google.internal has address 169.254.169.254
nick.travers@nickt-test:~$ curl -i http://metadata
HTTP/1.1 200 OK
Metadata-Flavor: Google
Content-Type: application/text
Date: Sun, 21 Apr 2019 17:23:01 GMT
Server: Metadata Server for VM
Content-Length: 22
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN

0.1/
computeMetadata/
nick.travers@nickt-test:~$ curl -i http://metadata.google.internal
HTTP/1.1 200 OK
Metadata-Flavor: Google
Content-Type: application/text
Date: Sun, 21 Apr 2019 17:23:07 GMT
Server: Metadata Server for VM
Content-Length: 22
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN

0.1/
computeMetadata/

The fact that it was merged into Google's core Java library gives me more confidence this is ok:
googleapis/google-cloud-java#4278

Copy link
Contributor

@songy23 songy23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for making this change.

@songy23 songy23 merged commit e455f5c into census-instrumentation:master Apr 21, 2019
@nicktrav nicktrav deleted the nickt.metadata branch April 21, 2019 19:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants