Skip to content

Commit c967786

Browse files
tengqmjavidiaz
authored andcommitted
[zh] Translate upgrading-windows-nodes
1 parent 2853190 commit c967786

File tree

1 file changed

+173
-0
lines changed

1 file changed

+173
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
---
2+
title: 升级 Windows 节点
3+
min-kubernetes-server-version: 1.17
4+
content_type: task
5+
weight: 40
6+
---
7+
<!--
8+
title: Upgrading Windows nodes
9+
min-kubernetes-server-version: 1.17
10+
content_type: task
11+
weight: 40
12+
-->
13+
14+
<!-- overview -->
15+
16+
{{< feature-state for_k8s_version="v1.18" state="beta" >}}
17+
18+
<!--
19+
This page explains how to upgrade a Windows node [created with kubeadm](/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes).
20+
-->
21+
本页解释如何升级[用 kubeadm 创建的](/zh/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes)
22+
Windows 节点。
23+
24+
## {{% heading "prerequisites" %}}
25+
26+
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
27+
28+
<!--
29+
* Familiarize yourself with [the process for upgrading the rest of your kubeadm
30+
cluster](/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade). You will want to
31+
upgrade the control plane nodes before upgrading your Windows nodes.
32+
-->
33+
* 熟悉[更新 kubeadm 集群中的其余组件](/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade)
34+
在升级你的 Windows 节点之前你会想要升级控制面节点。
35+
36+
<!-- steps -->
37+
<!--
38+
## Upgrading worker nodes
39+
40+
### Upgrade kubeadm
41+
-->
42+
## 升级工作节点 {#upgrading-worker-nodes}
43+
44+
### 升级 kubeadm {#upgrade-kubeadm}
45+
46+
<!--
47+
1. From the Windows node, upgrade kubeadm:
48+
49+
```powershell
50+
# replace {{< param "fullversion" >}} with your desired version
51+
curl.exe -Lo C:\k\kubeadm.exe https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubeadm.exe
52+
```
53+
-->
54+
1. 在 Windows 节点上升级 kubeadm:
55+
56+
```powershell
57+
# 将 {{< param "fullversion" >}} 替换为你希望的版本
58+
curl.exe -Lo C:\k\kubeadm.exe https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubeadm.exe
59+
```
60+
61+
<!--
62+
### Drain the node
63+
64+
1. From a machine with access to the Kubernetes API,
65+
prepare the node for maintenance by marking it unschedulable and evicting the workloads:
66+
67+
```shell
68+
# replace <node-to-drain> with the name of your node you are draining
69+
kubectl drain <node-to-drain> -ignore-daemonsets
70+
```
71+
72+
You should see output similar to this:
73+
74+
```
75+
node/ip-172-31-85-18 cordoned
76+
node/ip-172-31-85-18 drained
77+
```
78+
-->
79+
### 腾空节点 {#drain-the-node}
80+
81+
1. 在一个能访问到 Kubernetes API 的机器上,将 Windows 节点标记为不可调度并
82+
驱逐其上的所有负载,以便准备节点维护操作:
83+
84+
```shell
85+
# 将 <要腾空的节点> 替换为你要腾空的节点的名称
86+
kubectl drain <要腾空的节点> -ignore-daemonsets
87+
```
88+
89+
你应该会看到类似下面的输出:
90+
91+
```
92+
node/ip-172-31-85-18 cordoned
93+
node/ip-172-31-85-18 drained
94+
```
95+
96+
<!--
97+
### Upgrade the kubelet configuration
98+
99+
1. From the Windows node, call the following command to sync new kubelet configuration:
100+
101+
```powershell
102+
kubeadm upgrade node
103+
```
104+
-->
105+
### 升级 kubelet 配置 {#upgrade-the-kubelet-configuration}
106+
107+
1. 在 Windows 节点上,执行下面的命令来同步新的 kubelet 配置:
108+
109+
```powershell
110+
kubeadm upgrade node
111+
```
112+
113+
<!--
114+
### Upgrade kubelet
115+
116+
1. From the Windows node, upgrade and restart the kubelet:
117+
118+
```powershell
119+
stop-service kubelet
120+
curl.exe -Lo C:\k\kubelet.exe https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubelet.exe
121+
restart-service kubelet
122+
```
123+
-->
124+
### 升级 kubelet {#upgrade-kubelet}
125+
126+
1. 在 Windows 节点上升级并重启 kubelet:
127+
128+
```powershell
129+
stop-service kubelet
130+
curl.exe -Lo C:\k\kubelet.exe https://dl.k8s.io/{{< param "fullversion" >}}/bin/windows/amd64/kubelet.exe
131+
restart-service kubelet
132+
```
133+
134+
<!--
135+
### Uncordon the node
136+
137+
1. From a machine with access to the Kubernetes API,
138+
bring the node back online by marking it schedulable:
139+
140+
```shell
141+
# replace <node-to-drain> with the name of your node
142+
kubectl uncordon <node-to-drain>
143+
```
144+
-->
145+
### 对节点执行 uncordon 操作 {#uncordon-the-node}
146+
147+
1. 从一台能够访问到 Kubernetes API 的机器上,通过将节点标记为可调度,使之
148+
重新上线:
149+
150+
```shell
151+
# 将 <要腾空的节点> 替换为你的节点名称
152+
kubectl uncordon <要腾空的节点>
153+
```
154+
155+
<!--
156+
### Upgrade kube-proxy
157+
158+
1. From a machine with access to the Kubernetes API, run the following,
159+
again replacing {{< param "fullversion" >}} with your desired version:
160+
161+
```shell
162+
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 -
163+
```
164+
-->
165+
### 升级 kube-proxy {#upgrade-kube-proxy}
166+
167+
1. 在一台可访问 Kubernetes API 的机器上和,将 {{< param "fullversion" >}} 替换成你
168+
期望的版本后再次执行下面的命令:
169+
170+
```shell
171+
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 -
172+
```
173+

0 commit comments

Comments
 (0)