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

[node-group] Fix remove taints patch from master NG #2809

Merged
merged 4 commits into from
Oct 23, 2022

Conversation

yalosev
Copy link
Member

@yalosev yalosev commented Oct 22, 2022

Signed-off-by: Yuriy Losev yuriy.losev@flant.com

Description

Remove "master" taint if "control-plane" taint is removed

Why do we need it, and what problem does it solve?

When we are bootstraping a new single master cluster, we use command kubectl patch nodegroup master --type json -p '[{"op": "remove", "path": "/spec/nodeTemplate/taints"}]' for removing node taints.
Meanwhile our NG master only has:

    taints:
    - effect: NoSchedule
      key: node-role.kubernetes.io/control-plane

and if kubernetes version < 1.24 - kubeadm sets both taints for the master node during the bootstrap process:

  taints:
  - effect: NoSchedule
    key: node-role.kubernetes.io/control-plane
  - effect: NoSchedule
    key: node-role.kubernetes.io/master

After patching the master NG only control-plane taint will be removed explicitly. We also have to remove master taint if control-plane taint was removed, otherwise cluster will not be bootstrapped.

What is the expected result?

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: candi
type: fix
summary: Remove `master` taint if `control-plane` taint was removed in a single node installation.

Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
@yalosev yalosev added this to the v1.37.8 milestone Oct 22, 2022
@yalosev yalosev self-assigned this Oct 22, 2022
@yalosev yalosev added e2e/use/cri/containerd e2e/run/yandex-cloud Run e2e tests in Yandex Cloud labels Oct 22, 2022
@deckhouse-BOaTswain
Copy link
Collaborator

deckhouse-BOaTswain commented Oct 22, 2022

🟢 e2e: Yandex.Cloud for deckhouse:fix-single-master-taint succeeded in 32m22s.

Workflow details

🟢 e2e: Yandex.Cloud, Containerd, Kubernetes 1.21 succeeded in 31m47s.

@github-actions github-actions bot removed the e2e/run/yandex-cloud Run e2e tests in Yandex Cloud label Oct 22, 2022
@yalosev yalosev added the status/backport Backport pr label Oct 22, 2022
yalosev and others added 3 commits October 23, 2022 14:00
Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
@name212
Copy link
Member

name212 commented Oct 23, 2022

better

s/single master cluster/single node cluster/g

Copy link
Member

@name212 name212 left a comment

Choose a reason for hiding this comment

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

please fix e2e (run (better) or skip)

@yalosev
Copy link
Member Author

yalosev commented Oct 23, 2022

E2E was passed. We had just comments changes after the test

@nabokihms nabokihms merged commit 2c82496 into main Oct 23, 2022
@nabokihms nabokihms deleted the fix-single-master-taint branch October 23, 2022 20:22
github-actions bot pushed a commit that referenced this pull request Oct 23, 2022
Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
@deckhouse-BOaTswain
Copy link
Collaborator

Cherry pick PR 2814 to the branch release-1.37 successful!

deckhouse-BOaTswain added a commit that referenced this pull request Oct 23, 2022
Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>

Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
Co-authored-by: Yuriy Losev <yuriy.losev@flant.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
@deckhouse-BOaTswain deckhouse-BOaTswain removed the status/backport Backport pr label Oct 23, 2022
@z9r5
Copy link
Member

z9r5 commented Oct 24, 2022

/backport 1.38

github-actions bot pushed a commit that referenced this pull request Oct 24, 2022
Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
@deckhouse-BOaTswain
Copy link
Collaborator

Cherry pick PR 2816 to the branch release-1.38 successful!

deckhouse-BOaTswain added a commit that referenced this pull request Oct 24, 2022
Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>

Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
Co-authored-by: Yuriy Losev <yuriy.losev@flant.com>
Co-authored-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants