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

Update kubeadm upgrade instructions #44891

Closed
wants to merge 5 commits into from
Closed

Conversation

lichao127
Copy link
Contributor

@lichao127 lichao127 commented Jan 25, 2024

This PR moves kubectl drain instructions before kubeadm upgrade plan and kubeadm upgrade apply, because the node must be cordoned before upgrading (not after)

lichao127 and others added 2 commits January 24, 2024 18:00
draining needs to happen before kubeadm plan/upgrade
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 25, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign natalisucks for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 25, 2024
Copy link

netlify bot commented Jan 25, 2024

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 3e49ea8
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/65b1f7bf175c6a0008bec42b
😎 Deploy Preview https://deploy-preview-44891--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@T-Lakshmi T-Lakshmi left a comment

Choose a reason for hiding this comment

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

Hi @lichao127,
Thank you for your contribution.

adds sudo before apt commands so that all commands can be performed by a user with sudo privilege

This change has already been implemented by PR #44832, which was opened before this. So, i recommend that you to remove the content related to adding sudo privilege.

This reverts commit 79ecafb.
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 25, 2024
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 25, 2024
@lichao127 lichao127 changed the title Update control plane upgrade instructions Update kubeadm upgrade instructions Jan 25, 2024
@sftim
Copy link
Contributor

sftim commented Jan 28, 2024

/sig cluster-lifecycle

@k8s-ci-robot k8s-ci-robot added the sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. label Jan 28, 2024
Copy link
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

This PR moves kubectl drain instructions before kubeadm plan, because the node must be cordoned before upgrading

can you elaborate why?

@neolit123
Copy link
Member

/triage needs-information

@k8s-ci-robot k8s-ci-robot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Jan 29, 2024
@dipesh-rawat
Copy link
Member

@lichao127 When you have some time, could you kindly review the reviewer's query and provide a response? Appreciate it!

@lichao127
Copy link
Contributor Author

This PR moves kubectl drain instructions before kubeadm plan, because the node must be cordoned before upgrading

can you elaborate why?

The current version of doc has kubeadm upgrade plan and kubeadm upgrade apply instructions before draining the node. Draining should be done before kubeadm upgrade apply so that no pods can be scheduled during the upgrade.

@neolit123
Copy link
Member

This PR moves kubectl drain instructions before kubeadm plan, because the node must be cordoned before upgrading

can you elaborate why?

The current version of doc has kubeadm upgrade plan and kubeadm upgrade apply instructions before draining the node. Draining should be done before kubeadm upgrade apply so that no pods can be scheduled during the upgrade.

kubeadm does not manage non static pods, only static pods and their mirror pods at the apiserver. draining is done before kubelet upgrade because the kubelet manages all other pods and also generally draining and cordon is a kubelet upgrade requirement.

@stmcginnis
Copy link
Contributor

If anything, I would think we would want the cordon after kubeadm upgrade plan to minimize the maintenance window. Though if you have the capacity and want to give the most time for workloads to drain, you could even run cordon as the first step in the process. But it isn't strictly necessary until later.

But the current instructions should be fine. Upgrading the kubeadm upgrade apply portion should be non-disruptive. It's only when upgrading kubelet that there is a risk of disruption, from my understanding.

Maybe it should also be noted that upgrading containerd (or whatever container runtime you are using) should be done between that cordon and uncordon window.

@neolit123
Copy link
Member

Maybe it should also be noted that upgrading containerd (or whatever container runtime you are using) should be done between that cordon and uncordon window.

this can be mentioned, yes

@lichao127
Copy link
Contributor Author

attempting to gather the points so far:

  • kubeadm upgrade plan should be done before draining, to minimize the maintenance window
  • kubeadm upgrade apply can be performed without draining
    • question: in a one-node cluster, or when pods are tainted to run on control plane nodes, will this be different?
  • upgrading containerd (or other runtime) should be done within the cordon and uncordon window. we could mention in this doc.

@neolit123
Copy link
Member

question: in a one-node cluster, or when pods are tainted to run on control plane nodes, will this be different?

no, same steps.

@lichao127
Copy link
Contributor Author

no, same steps.

In that case we should leave the draining step as-is.

This doc mentions the container runtime upgrade:

When upgrading Kubernetes, the kubelet tries to automatically select the latest CRI version on restart of the component.

It seems redundant to mention the cordon/uncordon for containerd upgrade here. Closing PR.

@lichao127 lichao127 closed this Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants