Skip to content

kubeadm: Extended KubeletVersionCheck#54868

Merged
k8s-github-robot merged 1 commit intokubernetes:masterfrom
kad:kubeadm-issue-496
Nov 9, 2017
Merged

kubeadm: Extended KubeletVersionCheck#54868
k8s-github-robot merged 1 commit intokubernetes:masterfrom
kad:kubeadm-issue-496

Conversation

@kad
Copy link
Member

@kad kad commented Oct 31, 2017

What this PR does / why we need it:
KubeletVersionCheck now able to detect if kubelet version
is higher than control plane. As this might lead to malfunctional
cluster setups, kubeadm will give warning.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes kubernetes/kubeadm#496

Special notes for your reviewer:
/sig cluster-lifecycle
/area kubeadm

Release note:

- kubeadm will produce error if kubelet too new for control plane

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. area/kubeadm size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 31, 2017
@kad
Copy link
Member Author

kad commented Oct 31, 2017

/test pull-kubernetes-bazel-test

@kad
Copy link
Member Author

kad commented Nov 3, 2017

@krousey @dmmcquay any opinion on PR ?

Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, great!
I left some comments

Copy link
Member

Choose a reason for hiding this comment

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

This can be simpler I think... Why not just do if kubeletVersion.Minor() > k8sVersion.Minor() => error?

Copy link
Member Author

Choose a reason for hiding this comment

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

While developing next minor version, it is fine to have kubelet a bit newer than control plane.
e.g. testing kubelet 1.9.0-alpha.3+gitXYZ on top of 1.8.x stable cluster. Just be a bit more handy for developers.
Release 1.9.0 will complain, but development builds before 1.9.0 release will be ok.

Copy link
Member

Choose a reason for hiding this comment

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

suggest: The kubelet version is higher than the control plane version. This is not a supported version skew and may lead to a malfunctional cluster. Kubelet version: %s. Control plane version: %s.

Copy link
Member

Choose a reason for hiding this comment

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

Also I think this should be an error

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd suggest to keep it as warning. We don't break every single release interfaces between kubelet and control plane. It might be some cases where it will work incorrectly, but generally it should work. But I can change that to error, not big deal, as soon we will have custom controls on pre-flight checks :)

Copy link
Member

Choose a reason for hiding this comment

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

As it never is guaranteed to be a supported state, I want it to be an error. Please fix as above

Copy link
Member

Choose a reason for hiding this comment

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

this confused me first: please say // too old kubelet generally, v1.7 kubelets not supported anymore

Copy link
Member Author

Choose a reason for hiding this comment

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

That is intentional, to check error path with kubeadmconstants.MinimumKubeletVersion

Copy link
Member

Choose a reason for hiding this comment

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

yeah, but I'd appreciate if you changed the comment to be clearer. That was my intention

Copy link
Member

Choose a reason for hiding this comment

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

I would expect this to fail

Copy link
Member

Choose a reason for hiding this comment

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

Also add a proper v1.10.3 and v1.9.4 test that should fail

Copy link
Member Author

Choose a reason for hiding this comment

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

Using development builds of kubelet on top of stable control plane would be good to allow. See other comment.

Copy link
Member

Choose a reason for hiding this comment

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

ok

Copy link
Member

Choose a reason for hiding this comment

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

Can you please re-engineer this to use k8s.io/utils/exec for this instead so you can fake out the exec calls in unit tests instead of doing this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't noticed that lib. Will check it. From quick look, it might require change also in implementation of GetKubeletVersion(). Do you want to have it as part of this PR or maybe let's do re-factoring to use utils/exec as separate PR ?

Copy link
Member

Choose a reason for hiding this comment

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

Follow up is fine by me

Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

After the last comments are addressed, I'll LGTM

Copy link
Member

Choose a reason for hiding this comment

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

yeah, but I'd appreciate if you changed the comment to be clearer. That was my intention

Copy link
Member

Choose a reason for hiding this comment

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

As it never is guaranteed to be a supported state, I want it to be an error. Please fix as above

Copy link
Member

Choose a reason for hiding this comment

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

ok

Copy link
Member

Choose a reason for hiding this comment

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

Follow up is fine by me

@kad kad force-pushed the kubeadm-issue-496 branch from 5dfa888 to 18f486c Compare November 8, 2017 20:35
@kad
Copy link
Member Author

kad commented Nov 8, 2017

updated with making it as an error and addressing other comments.

Copy link
Member

@luxas luxas 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 @kad!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2017
@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2017
KubeletVersionCheck now able to detect if kubelet version
is higher than control plane. As this might lead to malfunctional
cluster setups, kubeadm will give warning.

Fixes: kubernetes/kubeadm#496
@kad kad force-pushed the kubeadm-issue-496 branch from 18f486c to de272d0 Compare November 8, 2017 21:36
@kad
Copy link
Member Author

kad commented Nov 8, 2017

Sorry @luxas needed to push once again with fix for golint issue :(

Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-github-robot k8s-github-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 8, 2017
@kad
Copy link
Member Author

kad commented Nov 9, 2017

/retest

@luxas
Copy link
Member

luxas commented Nov 9, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 9, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kad, luxas

Associated issue: 496

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 065e450 into kubernetes:master Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kubeadm init specifying a version may result in a kubelet version mismatch

6 participants