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

GCI: Ensure that the right version of kubelet is used #25504

Merged
merged 1 commit into from
May 18, 2016
Merged

GCI: Ensure that the right version of kubelet is used #25504

merged 1 commit into from
May 18, 2016

Conversation

andyzheng0831
Copy link

This PR fixes a binary version issue in using GCI image. Unlike ContainerVM, we don't hard-code a GCI image version in kubernetes code. When a user creates a cluster using GCI, by default the latest "gci-dev" will be used, in which the latest kubelet and kubectl release binary are built. The problem is that the user may not intend to use the latest version. This PR is for fixing it.

@roberthbailey @dchen1107 please review it or assign it to a suitable reviewer. Please also mark it as a cherry-pick candidate.

cc/ @fabioy @wonderfly @kubernetes/goog-image

@k8s-github-robot k8s-github-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-label-needed labels May 11, 2016
# So, we compare the versions to ensure this run-time binary replacement is only
# applied for OSS kubernetes.
readonly builtin_version="$(/usr/bin/kubelet --version=true | cut -f2 -d " ")"
readonly required_version="$(/home/kubernetes/bin/kubelet --version=true | cut -f2 -d " ")"
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be taken from some environment var?

Copy link
Author

Choose a reason for hiding this comment

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

Originally, I thought we can get version info from kube-env. But later I noticed there is no version var in that file. Theoretically, we can add KUBE_VERSION in kube-env file. There two downsides: (1) it will change much more places; (2) the meaning of KUBE_VERSION itself is complex (https://github.com/kubernetes/kubernetes/blob/master/cluster/common.sh#l257). A similar way is get version from the tarball URL listed in kube-env, but it has the same problem. So, the simplest way is to run "kubelet --version" just like what ContainerVM's config does (https://github.com/kubernetes/kubernetes/blob/master/cluster/gce/configure-vm.sh#l89)

Copy link
Contributor

Choose a reason for hiding this comment

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

/cc @zmerlynn

@andyzheng0831
Copy link
Author

@roberthbailey will you please take a look? We will need to cherry pick it to release-1.2 before the next 1.2.X release. Thanks

@roberthbailey
Copy link
Contributor

This looks ok to me but I'm going to assign to @zmerlynn to take a look since I won't be able to review it in the next couple of days.

@zmerlynn zmerlynn added release-note Denotes a PR that will be considered when it comes time to generate release notes. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed release-note-label-needed labels May 18, 2016
@zmerlynn zmerlynn added this to the v1.2 milestone May 18, 2016
@zmerlynn zmerlynn added cherrypick-candidate cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. labels May 18, 2016
@k8s-bot
Copy link

k8s-bot commented May 18, 2016

GCE e2e build/test passed for commit 63494f6.

@lavalamp
Copy link
Member

Do we have an e2e job that tests this? (build cop wondering how safe this is to merge)

@andyzheng0831
Copy link
Author

This change only affects GCI. We don't have a e2e job to test a pending PR. But I had manually ran e2e to verify it. And also ssh into instances to verify the logic. It is safe to merge I think

@lavalamp lavalamp merged commit 01cf986 into kubernetes:master May 18, 2016
@lavalamp
Copy link
Member

@andyzheng0831 In the future, if you know something won't be tested by our e2e tests, please add the "e2e-not-required" label, otherwise the submit queue runs a pointless 40 minute test on it.

@andyzheng0831
Copy link
Author

@lavalamp Thanks for the suggestion! That will be better for both submit queue and GCI-specific changes

@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.2" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

@roberthbailey roberthbailey added the release-note-none Denotes a PR that doesn't merit a release note. label Jun 24, 2016
@roberthbailey roberthbailey removed the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jun 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants