From 815198af5613392900bf8ec954e23caba1ce4469 Mon Sep 17 00:00:00 2001 From: shubham82 Date: Wed, 1 Mar 2023 15:44:58 +0900 Subject: [PATCH 1/3] Added the document for the Node Upgrade on Linux. --- .../kubeadm/kubeadm-upgrade.md | 77 +------------- .../kubeadm/upgrading-linux-nodes.md | 100 ++++++++++++++++++ .../kubeadm/upgrading-windows-nodes.md | 2 + 3 files changed, 105 insertions(+), 74 deletions(-) create mode 100644 content/en/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md diff --git a/content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade.md b/content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade.md index 3df3a729b87..d6e9821b597 100644 --- a/content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade.md +++ b/content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade.md @@ -217,81 +217,10 @@ Also calling `kubeadm upgrade plan` and upgrading the CNI provider plugin is no The upgrade procedure on worker nodes should be executed one node at a time or few nodes at a time, without compromising the minimum required capacity for running your workloads. -### Upgrade kubeadm +The following pages show how to Upgrade Linux and Windows worker nodes: -- Upgrade kubeadm: - - {{< tabs name="k8s_install_kubeadm_worker_nodes" >}} - {{% tab name="Ubuntu, Debian or HypriotOS" %}} - ```shell - # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version - apt-mark unhold kubeadm && \ - apt-get update && apt-get install -y kubeadm={{< skew currentVersion >}}.x-00 && \ - apt-mark hold kubeadm - ``` - {{% /tab %}} - {{% tab name="CentOS, RHEL or Fedora" %}} - ```shell - # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version - yum install -y kubeadm-{{< skew currentVersion >}}.x-0 --disableexcludes=kubernetes - ``` - {{% /tab %}} - {{< /tabs >}} - -### Call "kubeadm upgrade" - -- For worker nodes this upgrades the local kubelet configuration: - - ```shell - sudo kubeadm upgrade node - ``` - -### Drain the node - -- Prepare the node for maintenance by marking it unschedulable and evicting the workloads: - - ```shell - # replace with the name of your node you are draining - kubectl drain --ignore-daemonsets - ``` - -### Upgrade kubelet and kubectl - -- Upgrade the kubelet and kubectl: - - {{< tabs name="k8s_kubelet_and_kubectl" >}} - {{% tab name="Ubuntu, Debian or HypriotOS" %}} - ```shell - # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version - apt-mark unhold kubelet kubectl && \ - apt-get update && apt-get install -y kubelet={{< skew currentVersion >}}.x-00 kubectl={{< skew currentVersion >}}.x-00 && \ - apt-mark hold kubelet kubectl - ``` - {{% /tab %}} - {{% tab name="CentOS, RHEL or Fedora" %}} - ```shell - # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version - yum install -y kubelet-{{< skew currentVersion >}}.x-0 kubectl-{{< skew currentVersion >}}.x-0 --disableexcludes=kubernetes - ``` - {{% /tab %}} - {{< /tabs >}} -
- -- Restart the kubelet: - - ```shell - sudo systemctl daemon-reload - sudo systemctl restart kubelet - ``` - -### Uncordon the node - -- Bring the node back online by marking it schedulable: - - ```shell - # replace with the name of your node - kubectl uncordon - ``` + * [Upgrade Linux nodes](/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes/) + * [Upgrade Windows nodes](/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes/) ## Verify the status of the cluster diff --git a/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md new file mode 100644 index 00000000000..9c30d42b8b1 --- /dev/null +++ b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md @@ -0,0 +1,100 @@ +--- +title: Upgrading Linux nodes +content_type: task +weight: 50 +--- + + + +This page explains how to upgrade a Linux Worker Nodes created with kubeadm. + +## {{% heading "prerequisites" %}} + +{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} +* Familiarize yourself with [the process for upgrading the rest of your kubeadm +cluster](/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade). You will want to +upgrade the control plane nodes before upgrading your Linux Worker nodes. + + + +## Upgrading worker nodes + +### Upgrade kubeadm + + Upgrade kubeadm: + + {{< tabs name="k8s_install_kubeadm_worker_nodes" >}} + {{% tab name="Ubuntu, Debian or HypriotOS" %}} + ```shell + # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version + apt-mark unhold kubeadm && \ + apt-get update && apt-get install -y kubeadm={{< skew currentVersion >}}.x-00 && \ + apt-mark hold kubeadm + ``` + {{% /tab %}} + {{% tab name="CentOS, RHEL or Fedora" %}} + ```shell + # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version + yum install -y kubeadm-{{< skew currentVersion >}}.x-0 --disableexcludes=kubernetes + ``` + {{% /tab %}} + {{< /tabs >}} + +### Call "kubeadm upgrade" + +- For worker nodes this upgrades the local kubelet configuration: + + ```shell + sudo kubeadm upgrade node + ``` + +### Drain the node + +- Prepare the node for maintenance by marking it unschedulable and evicting the workloads: + + ```shell + # replace with the name of your node you are draining + kubectl drain --ignore-daemonsets + ``` + +### Upgrade kubelet and kubectl + +- Upgrade the kubelet and kubectl: + + {{< tabs name="k8s_kubelet_and_kubectl" >}} + {{% tab name="Ubuntu, Debian or HypriotOS" %}} + ```shell + # replace x in {{< skew currentVersion >}}.x-00 with the latest patch version + apt-mark unhold kubelet kubectl && \ + apt-get update && apt-get install -y kubelet={{< skew currentVersion >}}.x-00 kubectl={{< skew currentVersion >}}.x-00 && \ + apt-mark hold kubelet kubectl + ``` + {{% /tab %}} + {{% tab name="CentOS, RHEL or Fedora" %}} + ```shell + # replace x in {{< skew currentVersion >}}.x-0 with the latest patch version + yum install -y kubelet-{{< skew currentVersion >}}.x-0 kubectl-{{< skew currentVersion >}}.x-0 --disableexcludes=kubernetes + ``` + {{% /tab %}} + {{< /tabs >}} +
+ +- Restart the kubelet: + + ```shell + sudo systemctl daemon-reload + sudo systemctl restart kubelet + ``` + +### Uncordon the node + +- Bring the node back online by marking it schedulable: + + ```shell + # replace with the name of your node + kubectl uncordon + ``` + + ## {{% heading "whatsnext" %}} + +* See how to [Upgrade Windows nodes](/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes/). \ No newline at end of file diff --git a/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md index 21c39c84d5f..a0fba7c26da 100644 --- a/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md +++ b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md @@ -88,4 +88,6 @@ bring the node back online by marking it schedulable: # replace with the name of your node kubectl uncordon ``` + ## {{% heading "whatsnext" %}} +* See how to [Upgrade Linux nodes](/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes/). From 6a38d82e3a6e58c6c320a487473a821375bd1870 Mon Sep 17 00:00:00 2001 From: shubham82 Date: Thu, 2 Mar 2023 11:57:19 +0900 Subject: [PATCH 2/3] Update page weights --- .../tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md | 2 +- .../tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md index 9c30d42b8b1..97768683077 100644 --- a/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md +++ b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-linux-nodes.md @@ -1,7 +1,7 @@ --- title: Upgrading Linux nodes content_type: task -weight: 50 +weight: 100 --- diff --git a/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md index a0fba7c26da..60ce45134b0 100644 --- a/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md +++ b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md @@ -2,7 +2,7 @@ title: Upgrading Windows nodes min-kubernetes-server-version: 1.17 content_type: task -weight: 50 +weight: 100 --- From 102f56b731e314ddc8f57cbc1bf97da885199845 Mon Sep 17 00:00:00 2001 From: shubham82 Date: Fri, 3 Mar 2023 10:42:53 +0900 Subject: [PATCH 3/3] Modify the page weight for upgrading windows nodes --- .../tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md index 60ce45134b0..2d1da5e0405 100644 --- a/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md +++ b/content/en/docs/tasks/administer-cluster/kubeadm/upgrading-windows-nodes.md @@ -2,7 +2,7 @@ title: Upgrading Windows nodes min-kubernetes-server-version: 1.17 content_type: task -weight: 100 +weight: 110 ---