Skip to content

Commit 272b0f4

Browse files
authored
Merge pull request #45314 from my-git9/kubeadm-upgrade13
[zh-cn] sync kubeadm-upgrade.md
2 parents 3e4c64d + 02685cc commit 272b0f4

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

content/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,44 @@ The upgrade workflow at high level is the following:
110110
这样会产生意想不到的结果。
111111
请按照[重新配置 kubeadm 集群](/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-reconfigure)中的步骤来进行。
112112

113+
<!--
114+
### Considerations when upgrading etcd
115+
116+
Because the `kube-apiserver` static pod is running at all times (even if you
117+
have drained the node), when you perform a kubeadm upgrade which includes an
118+
etcd upgrade, in-flight requests to the server will stall while the new etcd
119+
static pod is restarting. As a workaround, it is possible to actively stop the
120+
`kube-apiserver` process a few seconds before starting the `kubeadm upgrade
121+
apply` command. This permits to complete in-flight requests and close existing
122+
connections, and minimizes the consequence of the etcd downtime. This can be
123+
done as follows on control plane nodes:
124+
-->
125+
### 升级 etcd 时的注意事项
126+
127+
由于 `kube-apiserver` 静态 Pod 始终在运行(即使你已经执行了腾空节点的操作),
128+
因此当你执行包括 etcd 升级在内的 kubeadm 升级时,对服务器正在进行的请求将停滞,
129+
因为要重新启动新的 etcd 静态 Pod。作为一种解决方法,可以在运行 `kubeadm upgrade apply`
130+
命令之前主动停止 `kube-apiserver` 进程几秒钟。这样可以允许正在进行的请求完成处理并关闭现有连接,
131+
并最大限度地减少 etcd 停机的后果。此操作可以在控制平面节点上按如下方式完成:
132+
133+
<!--
134+
```shell
135+
# trigger a graceful kube-apiserver shutdown
136+
# wait a little bit to permit completing in-flight requests
137+
# execute a kubeadm upgrade command
138+
-->
139+
```shell
140+
killall -s SIGTERM kube-apiserver # 触发 kube-apiserver 体面关闭
141+
sleep 20 # 等待一下,以完成进行中的请求
142+
kubeadm upgrade ... # 执行 kubeadm 升级命令
143+
```
144+
113145
<!-- steps -->
114146

115147
<!--
116148
## Changing the package repository
117149
118-
If you're using the community-owned package repositories (`pkgs.k8s.io`), you need to
150+
If you're using the community-owned package repositories (`pkgs.k8s.io`), you need to
119151
enable the package repository for the desired Kubernetes minor release. This is explained in
120152
[Changing the Kubernetes package repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/)
121153
document.

0 commit comments

Comments
 (0)