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

add feature to set google metadata within hosts when running on gce #817

Merged
merged 2 commits into from Jan 21, 2021

Conversation

knisbet
Copy link
Contributor

@knisbet knisbet commented Jan 19, 2021

Adds a feature to planet to hardcode the google metadata server into the planet hosts file when detected as running on a gcloud VM. This is a workaround for a kubelet problem where it will always try and contact the metadata server even when configured without cloud integrations.

kubernetes/kubernetes#30195
kubernetes/kubernetes#86245
And probably others.

Updates gravitational/gravity#2391

@knisbet knisbet requested review from a team, wadells and bernardjkim January 19, 2021 21:57
Copy link
Contributor

@wadells wadells left a comment

Choose a reason for hiding this comment

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

LGTM!

"syscall"
"unicode"

"github.com/gravitational/planet/lib/constants"
"github.com/sirupsen/logrus"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: move to the next group


if utils.OnGCEVM() {
hosts = append(hosts, utils.HostEntry{
IP: "169.254.169.254",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a commonly used IP address for a metadata server?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, off hand both AWS and GCE use this IP for the metadata server. I don't know about other envs off hand.

@knisbet knisbet merged commit aeaefb2 into master Jan 21, 2021
@knisbet knisbet deleted the kevin/master/gce-metadata-hosts branch January 21, 2021 15:10
knisbet pushed a commit that referenced this pull request Jan 21, 2021
…817)

* add feature to set google metadata within hosts when running on gce

* address review feedback

(cherry picked from commit aeaefb2)
knisbet pushed a commit that referenced this pull request Jan 21, 2021
…817)

* add feature to set google metadata within hosts when running on gce

* address review feedback

(cherry picked from commit aeaefb2)
knisbet pushed a commit that referenced this pull request Jan 21, 2021
…817)

* add feature to set google metadata within hosts when running on gce

* address review feedback

(cherry picked from commit aeaefb2)
knisbet pushed a commit that referenced this pull request Jan 21, 2021
…817) (#820)

* add feature to set google metadata within hosts when running on gce

* address review feedback

(cherry picked from commit aeaefb2)
knisbet pushed a commit that referenced this pull request Jan 21, 2021
…817) (#819)

* add feature to set google metadata within hosts when running on gce

* address review feedback

(cherry picked from commit aeaefb2)
knisbet pushed a commit that referenced this pull request Feb 4, 2021
…817) (#818)

* add feature to set google metadata within hosts when running on gce

* address review feedback

(cherry picked from commit aeaefb2)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants