Files
Ben Moss 615c7f619f Update kubeadm for Windows (#19217)
* Start updates for DaemonSet approach

* Rough first draft

* Remove old image assets

* Document how to fetch the correct version of kube-proxy

* Remove InstallNSSM script

It was merged into the PrepareNode script

* Update links to sig-windows-tools release files

Using the latest tag so we can continue to update things as needed
without needing to keep updating the docs

* Add upgrade tutorial for Windows kubeadm nodes

* Clarify which machine each command should be run from

* Add link from main tutorial, small edits

- Rename file / title
- Remove reviewers

* Remove IP management section

User can just rely on the defaults from kube-proxy and flannel now, or
change them in the same manner as on Linux

* Apply suggestions from code review

Co-Authored-By: Tim Bannister <tim@scalefactory.com>

* More review updates

* Switch to task template

* Apply suggestions from code review

Co-Authored-By: Tim Bannister <tim@scalefactory.com>

* More review feedback

* Adjust upgrading title

* Additional edits

* Move to kubeadm directory

* Remove stale link

This guide never had any real content about the pause image

* Add redirect from old url

* Fix weights

* Update Windows intro

* Apply suggestions from code review

Co-Authored-By: Tim Bannister <tim@scalefactory.com>

* Fix typo

* Add beta markers

Co-authored-by: Tim Bannister <tim@scalefactory.com>
2020-03-16 08:14:43 -07:00

94 lines
2.5 KiB
Markdown

---
title: Upgrading Windows nodes
min-kubernetes-server-version: 1.17
content_template: templates/task
weight: 40
---
{{% capture overview %}}
{{< feature-state for_k8s_version="v1.18" state="beta" >}}
This page explains how to upgrade a Windows node [created with kubeadm](/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes).
{{% /capture %}}
{{% capture 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 Windows nodes.
{{% /capture %}}
{{% capture steps %}}
## Upgrading worker nodes
### Upgrade kubeadm
1. From the Windows node, upgrade kubeadm:
```powershell
# replace {{< param "fullversion" >}} with your desired version
curl.exe -Lo C:\k\kubeadm.exe https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubeadm.exe
```
### Drain the node
1. From a machine with access to the Kubernetes API,
prepare the node for maintenance by marking it unschedulable and evicting the workloads:
```shell
# replace <node-to-drain> with the name of your node you are draining
kubectl drain <node-to-drain> --ignore-daemonsets
```
You should see output similar to this:
```
node/ip-172-31-85-18 cordoned
node/ip-172-31-85-18 drained
```
### Upgrade the kubelet configuration
1. From the Windows node, call the following command to sync new kubelet configuration:
```powershell
kubeadm upgrade node
```
### Upgrade kubelet
1. From the Windows node, upgrade and restart the kubelet:
```powershell
stop-service kubelet
curl.exe -Lo C:\k\kubelet.exe https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubelet.exe
restart-service kubelet
```
### Uncordon the node
1. From a machine with access to the Kubernetes API,
bring the node back online by marking it schedulable:
```shell
# replace <node-to-drain> with the name of your node
kubectl uncordon <node-to-drain>
```
### Upgrade kube-proxy
1. From a machine with access to the Kubernetes API, run the following,
again replacing {{< param "fullversion" >}} with your desired version:
```shell
curl -L https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/kube-proxy.yml | sed 's/VERSION/{{< param "fullversion" >}}/g' | kubectl apply -f -
```
{{% /capture %}}