Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the kubelet on a GCE master check instance metadata for manifests #11963

Merged
merged 1 commit into from Jul 30, 2015

Conversation

a-robinson
Copy link
Contributor

Primary motivation: enable GKE and other cluster-as-a-service folks to easily run additional logic on the master without having to modify salt or SSH to the master after it's been created.

Verified to work on GCE.

@brendandburns @roberthbailey @zmerlynn

@k8s-bot
Copy link

k8s-bot commented Jul 29, 2015

GCE e2e build/test failed for commit 18fa01fc0062e2f362438f0452618fa48474aa7b.

@a-robinson
Copy link
Contributor Author

Jenkins failure is due to a test environment issue:

Creating minions.
Instance template pull-e2e-1-minion-template already exists; deleting.
Failed to delete existing instance template
2015/07/28 18:00:43 Error running up: exit status 2
2015/07/28 18:00:43 Error starting e2e cluster. Aborting.
exit status 1

@a-robinson
Copy link
Contributor Author

@k8s-bot test this please

@k8s-bot
Copy link

k8s-bot commented Jul 29, 2015

GCE e2e build/test passed for commit 18fa01fc0062e2f362438f0452618fa48474aa7b.

@@ -41,6 +41,12 @@
{% endif -%}

{% set config = "--config=/etc/kubernetes/manifests" -%}

{% set manifest_url = "" -%}
{% if grains['roles'][0] == 'kubernetes-master' and grains.cloud in ['gce'] -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to only do this on the master? We will (hopefully soon) treat the master node on GCE just like any other node, so we should look at reducing the number of special cases we apply to the master.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, the daemon controller will handle the node case in the very near future, and adding it to the nodes adds another edge-feature that isn't worth properly supporting given that there's not much use for it once the daemon controller exists.

That said, reducing special cases is a reasonable goal, so I'm happy to go that way if you'd prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there's much reason to do it on the nodes, just wanted to think about what it would entail.

@roberthbailey
Copy link
Contributor

LGTM. Please cherry pick this into the 1.0 release branch as well.


{% set manifest_url = "" -%}
{% if grains['roles'][0] == 'kubernetes-master' and grains.cloud in ['gce'] -%}
{% set manifest_url = "--manifest-url=http://metadata.google.internal/computeMetadata/v1beta1/instance/attributes/google-container-manifest" -%}
Copy link
Contributor

Choose a reason for hiding this comment

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

This should use the v1 api rather than the v1beta1 api.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm testing it, but I don't think the kubelet knows to set the "Metadata-Flavor: Google" header on its requests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I've confirmed the kubelet isn't smart enough to hit the v1 metadata server...

Copy link
Member

Choose a reason for hiding this comment

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

Ugh, that means that an internal change I have won't work (I haven't tested it yet).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Working on it in #11982

@roberthbailey roberthbailey added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2015
@a-robinson
Copy link
Contributor Author

I noticed this morning that the downside of this is that it causes the kubelet to spit out an error log message every 20 seconds if there is no pod manifest in the metadata. Maybe this setting should be controlled by a piece of kube-env?

@a-robinson a-robinson removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 29, 2015
Primary motivation: enable GKE and other cluster-as-a-service folks to
easily run additional logic on the master without having to modify salt
or SSH to the master after it's been created.
@a-robinson
Copy link
Contributor Author

Switched to use the v1 metadata API after rebasing onto #12024. Running one final kube-up with a pod specified in the metadata before re-attaching the LGTM label I previously removed.

@a-robinson
Copy link
Contributor Author

Seems to be working swimmingly, and I verified as part of the other PR that it doesn't complain more than 3 times if there isn't a manifest in the metadata. re-applying @roberthbailey's LGTM

@a-robinson a-robinson added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 30, 2015
@k8s-bot
Copy link

k8s-bot commented Jul 30, 2015

GCE e2e build/test passed for commit 94ae0a9.

@roberthbailey
Copy link
Contributor

Still lgtm.

@a-robinson
Copy link
Contributor Author

Shippable flaked on the integration test. Should be good to merge. I'd kick shippable, but the retry button is missing.

@a-robinson
Copy link
Contributor Author

pinging @mikedanese to get this in sometime today

@mikedanese
Copy link
Member

It's on my radar.

mikedanese added a commit that referenced this pull request Jul 30, 2015
Make the kubelet on a GCE master check instance metadata for manifests
@mikedanese mikedanese merged commit 622bf70 into kubernetes:master Jul 30, 2015
zmerlynn added a commit that referenced this pull request Jul 31, 2015
…2024-#11963-upstream-release-1.0

Automated cherry pick of #12024 #11963
@brendandburns brendandburns mentioned this pull request Aug 1, 2015
@a-robinson a-robinson deleted the manifest branch August 5, 2015 00:24
@dchen1107
Copy link
Member

Please cc to me or node team next time on any node / kubelet related configuration changes. I were surprised with this pr when I saw #15122 yesterday. We spent sometime on making node configuration consistently (of course not true in today's situation), but this change is totally opposite on what we are doing. cc/ @yujuhong

@dchen1107
Copy link
Member

cc/ @kubernetes/goog-node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants