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

kubeadm: Fix node join taints #69846

Merged

Conversation

andrewrynhard
Copy link
Contributor

What this PR does / why we need it:
This PR fixes a bug introduced in 8af751f, that prevents node taints from being applied that are specified in the JoinConfiguration.

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

Special notes for your reviewer:

Release note:

kubeadm: Fix node join taints.

/cc @fabriziopandini

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 16, 2018
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. area/kubeadm needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 16, 2018
@andrewrynhard andrewrynhard changed the title Kubeadm: Fix node join taints kubeadm: Fix node join taints Oct 16, 2018
@andrewrynhard
Copy link
Contributor Author

/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 16, 2018
@andrewrynhard
Copy link
Contributor Author

andrewrynhard commented Oct 16, 2018

/test pull-kubernetes-e2e-kops-aws
/test pull-kubernetes-integration

@neolit123
Copy link
Member

neolit123 commented Oct 16, 2018

@andrewrynhard thanks for catching this.

this is part of the 1.12.x release. should we backport?
/assign @timothysc

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@andrewrynhard Thanks for this PR!
Only one minor nit and then lgtm for me

// TODO: Maybe we want to do that some time in the future, in order to remove some logic from the markmaster phase?
if err := kubeletphase.WriteKubeletDynamicEnvFile(&j.cfg.NodeRegistration, j.cfg.FeatureGates, false, kubeadmconstants.KubeletRunDirectory); err != nil {
// Write env file with flags for the kubelet to use.
if err := kubeletphase.WriteKubeletDynamicEnvFile(&j.cfg.NodeRegistration, j.cfg.FeatureGates, true, kubeadmconstants.KubeletRunDirectory); err != nil {
Copy link
Member

@fabriziopandini fabriziopandini Oct 16, 2018

Choose a reason for hiding this comment

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

I think that the registerTaintsUsingFlags parameter should be set to true only in case cfg.ControlPlane == false, otherwise we are setting taints twice (here and afterwards when calling MarkMaster)

// TODO: Maybe we want to do that some time in the future, in order to remove some logic from the markmaster phase?
if err := kubeletphase.WriteKubeletDynamicEnvFile(&j.cfg.NodeRegistration, j.cfg.FeatureGates, false, kubeadmconstants.KubeletRunDirectory); err != nil {
// Write env file with flags for the kubelet to use.
if err := kubeletphase.WriteKubeletDynamicEnvFile(&j.cfg.NodeRegistration, j.cfg.FeatureGates, !j.cfg.ControlPlane, kubeadmconstants.KubeletRunDirectory); err != nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fabriziopandini !j.cfg.ControlPlane should address your concern.

Copy link
Member

@fabriziopandini fabriziopandini Oct 16, 2018

Choose a reason for hiding this comment

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

You are right, but I'm a little bit concerned that the reason behind that little ! will get lost soon.

What do you think about setting a new variable registerTaintsUsingFlags and adding a comment explaing why we that this is not required when the joining node should host a new control plane instance because taints will be applied afterwards by MarkMaster?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. Will push that up.

@andrewrynhard
Copy link
Contributor Author

@neolit123

this is part of the 1.12.x release. should we backport?

We probably should IMHO.

@andrewrynhard
Copy link
Contributor Author

@fabriziopandini Look better now?

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@andrewrynhard many many thanks for being so patient with me 😉
/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 18, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewrynhard, fabriziopandini

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 18, 2018
@k8s-ci-robot k8s-ci-robot merged commit 125cb7b into kubernetes:master Oct 18, 2018
@andrewrynhard andrewrynhard deleted the fix-kubeadm-join-taints branch October 18, 2018 21:46
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. kind/bug Categorizes issue or PR as related to a bug. 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/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.

None yet

5 participants