Skip to content

Commit 2b27d92

Browse files
authored
Merge pull request #29562 from mengjiao-liu/sync-1.22-windows-runtime
[zh] Setup files to sync for 1.22(windows & runtime)
2 parents d30c26c + b6a1a29 commit 2b27d92

File tree

3 files changed

+120
-60
lines changed

3 files changed

+120
-60
lines changed

content/zh/docs/setup/production-environment/container-runtimes.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,64 @@ configuration, or reinstall it using automation.
106106
如果你有切实可行的自动化方案,使用其他已更新配置的节点来替换该节点,
107107
或者使用自动化方案来重新安装。
108108

109+
<!--
110+
## Cgroup v2
111+
112+
Cgroup v2 is the next version of the cgroup Linux API. Differently than cgroup v1, there is a single
113+
hierarchy instead of a different one for each controller.
114+
-->
115+
## Cgroup v2
116+
Cgroup v2 是 cgroup Linux API 的下一个版本。与 cgroup v1 不同的是,
117+
Cgroup v2 只有一个层次结构,而不是每个控制器有一个不同的层次结构。
118+
119+
<!--
120+
The new version offers several improvements over cgroup v1, some of these improvements are:
121+
122+
- cleaner and easier to use API
123+
- safe sub-tree delegation to containers
124+
- newer features like Pressure Stall Information
125+
-->
126+
新版本对 cgroup v1 进行了多项改进,其中一些改进是:
127+
128+
- 更简洁、更易于使用的 API
129+
- 可将安全子树委派给容器
130+
- 更新的功能,如压力失速信息(Pressure Stall Information)
131+
132+
<!--
133+
Even if the kernel supports a hybrid configuration where some controllers are managed by cgroup v1
134+
and some others by cgroup v2, Kubernetes supports only the same cgroup version to manage all the
135+
controllers.
136+
137+
If systemd doesn't use cgroup v2 by default, you can configure the system to use it by adding
138+
`systemd.unified_cgroup_hierarchy=1` to the kernel command line.
139+
-->
140+
尽管内核支持混合配置,即其中一些控制器由 cgroup v1 管理,另一些由 cgroup v2 管理,
141+
Kubernetes 仅支持使用同一 cgroup 版本来管理所有控制器。
142+
143+
如果 systemd 默认不使用 cgroup v2,你可以通过在内核命令行中添加
144+
`systemd.unified_cgroup_hierarchy=1` 来配置系统去使用它。
145+
146+
```shell
147+
# dnf install -y grubby && \
148+
sudo grubby \
149+
--update-kernel=ALL \
150+
--args=”systemd.unified_cgroup_hierarchy=1"
151+
```
152+
153+
<!--
154+
To apply the configuration, it is necessary to reboot the node.
155+
156+
There should not be any noticeable difference in the user experience when switching to cgroup v2, unless
157+
users are accessing the cgroup file system directly, either on the node or from within the containers.
158+
159+
In order to use it, cgroup v2 must be supported by the CRI runtime as well.
160+
-->
161+
要应用配置,必须重新启动节点。
162+
163+
切换到 cgroup v2 时,用户体验不应有任何明显差异,
164+
除非用户直接在节点上或在容器内访问 cgroup 文件系统。
165+
为了使用它,CRI 运行时也必须支持 cgroup v2。
166+
109167
<!--
110168
### Migrating to the `systemd` driver in kubeadm managed clusters
111169
-->

content/zh/docs/setup/production-environment/windows/intro-windows-in-kubernetes.md

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ Windows 容器仅能调度到 Windows 节点,Linux 容器则只能调度到 Li
124124

125125
| Kubernetes 版本 | Windows Server LTSC 版本 | Windows Server SAC 版本 |
126126
| --- | --- | --- | --- |
127-
| *Kubernetes v1.19* | Windows Server 2019 | Windows Server ver 1909, Windows Server ver 2004 |
128127
| *Kubernetes v1.20* | Windows Server 2019 | Windows Server ver 1909, Windows Server ver 2004 |
129128
| *Kubernetes v1.21* | Windows Server 2019 | Windows Server ver 2004, Windows Server ver 20H2 |
129+
| *Kubernetes v1.22* | Windows Server 2019 | Windows Server ver 2004, Windows Server ver 20H2 |
130130

131131
<!--
132132
Information on the different Windows Server servicing channels including their
@@ -184,13 +184,25 @@ limitation and compatibility rules will change.
184184
<!--
185185
#### Pause Image
186186
187-
Microsoft maintains a Windows pause infrastructure container at
188-
`mcr.microsoft.com/oss/kubernetes/pause:3.4.1`.
187+
Kubernetes maintains a multi-architecture image that includes support for Windows.
188+
For Kubernetes v1.22 the recommended pause image is `k8s.gcr.io/pause:3.5`.
189+
The [source code](https://github.com/kubernetes/kubernetes/tree/master/build/pause)
190+
is available on GitHub.
191+
192+
Microsoft maintains a multi-architecture image with Linux and Windows amd64 support at `mcr.microsoft.com/oss/kubernetes/pause:3.5`.
193+
This image is built from the same source as the Kubernetes maintained image but all of the Windows binaries are [authenticode signed](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/authenticode) by Microsoft.
194+
The Microsoft maintained image is recommended for production environments when signed binaries are required.
189195
-->
190196
#### Pause 镜像 {#pause-image}
191197

192-
Microsoft 在 `mcr.microsoft.com/oss/kubernetes/pause:3.4.1` 处维护
193-
一个 pause 基础设施容器镜像。
198+
Kubernetes 维护着一个多体系结构镜像,其中包括对 Windows 的支持。
199+
对于 Kubernetes v1.22,推荐的 pause 镜像是 `k8s.gcr.io/pause:3.5`
200+
[源代码](https://github.com/kubernetes/kubernetes/tree/master/build/pause)可在 GitHub 上找到。
201+
202+
Microsoft 维护了一个支持 Linux 和 Windows amd64 的多体系结构镜像: `mcr.microsoft.com/oss/kubernetes/pause:3.5`
203+
此镜像与 Kubernetes 维护的镜像是从同一来源构建,但所有 Windows 二进制文件
204+
均由 Microsoft [签名](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/authenticode)
205+
当生产环境需要被签名的二进制文件时,建议使用 Microsoft 维护的镜像。
194206

195207
<!--
196208
#### Compute
@@ -418,7 +430,7 @@ FlexVolume 插件处理将卷挂接到 Kubernetes 节点或从其上解挂、将
418430
-->
419431
##### CSI 插件 {#csi-plugins}
420432

421-
{{< feature-state for_k8s_version="v1.19" state="beta" >}}
433+
{{< feature-state for_k8s_version="v1.22" state="stable" >}}
422434

423435
<!--
424436
Code associated with {{< glossary_tooltip text="CSI" term_id="csi" >}} plugins
@@ -428,40 +440,34 @@ DaemonSets and StatefulSets. CSI plugins handle a wide range of volume
428440
management actions in Kubernetes: provisioning/de-provisioning/resizing of
429441
volumes, attaching/detaching of volumes to/from a Kubernetes node and
430442
mounting/dismounting a volume to/from individual containers in a pod,
431-
backup/restore of persistent data using snapshots and cloning. CSI plugins
432-
typically consist of node plugins (that run on each node as a DaemonSet) and
433-
controller plugins.
443+
backup/restore of persistent data using snapshots and cloning.
434444
-->
435445
与 {{< glossary_tooltip text="CSI" term_id="csi" >}} 插件相关联的代码作为
436446
树外脚本和可执行文件来发布且通常发布为容器镜像形式,并使用 DaemonSet 和
437447
StatefulSet 这类标准的 Kubernetes 构造体来部署。
438448
CSI 插件处理 Kubernetes 中的很多卷管理操作:对卷的配备、去配和调整大小,
439449
将卷挂接到 Kubernetes 节点或从节点上解除挂接,将卷挂载到需要持久数据的 Pod
440450
中的某容器或从容器上卸载,使用快照和克隆来备份或恢复持久数据。
441-
CSI 插件通常包含节点插件(以 DaemonSet 形式运行于各节点上)和控制器插件。
442-
443-
<!--
444-
CSI node plugins (especially those associated with persistent volumes exposed
445-
as either block devices or over a shared file-system) need to perform various
446-
privileged operations like scanning of disk devices, mounting of file systems,
447-
etc. These operations differ for each host operating system. For Linux worker
448-
nodes, containerized CSI node plugins are typically deployed as privileged
449-
containers. For Windows worker nodes, privileged operations for containerized
450-
CSI node plugins is supported using
451-
[csi-proxy](https://github.com/kubernetes-csi/csi-proxy), a community-managed,
452-
stand-alone binary that needs to be pre-installed on each Windows node. Please
453-
refer to the deployment guide of the CSI plugin you wish to deploy for further
454-
details.
455-
-->
456-
CSI 节点插件(尤其是那些通过块设备或者共享文件系统形式来提供持久卷的插件)
457-
需要执行很多特权级操作,例如扫描磁盘设备、挂载文件系统等等。
458-
这些操作在不同的宿主操作系统上差别较大。对于 Linux 工作节点而言,容器化的
459-
CSI 节点插件通常部署为特权级的容器。对于 Windows 工作节点而言,容器化的
460-
CSI 节点插件的特权操作通过
461-
[csi-proxy](https://github.com/kubernetes-csi/csi-proxy)
451+
452+
<!--
453+
CSI plugins communicate with a CSI node plugin which performs the local storage operations.
454+
On Windows nodes CSI node plugins typically call APIs exposed by the community-managed
455+
[csi-proxy](https://github.com/kubernetes-csi/csi-proxy) which handles the local storage operations.
456+
457+
Please refer to the deployment guide of the environment where you wish to deploy a Windows CSI plugin
458+
for further details around installation.
459+
You may also refer to the following [installation steps](https://github.com/kubernetes-csi/csi-proxy#installation).
460+
-->
462461
来支持;csi-proxy 是一个社区管理的、独立的可执行文件,需要预安装在每个
463462
Windows 节点之上。请参考你要部署的 CSI 插件的部署指南以进一步了解其细节。
464463

464+
CSI 插件与执行本地存储操作的 CSI 节点插件通信。
465+
在 Windows 节点上,CSI 节点插件通常调用处理本地存储操作的 [csi-proxy](https://github.com/kubernetes-csi/csi-proxy)
466+
公开的 API, csi-proxy 由社区管理。
467+
468+
有关安装的更多详细信息,请参阅你要部署的 Windows CSI 插件的环境部署指南。
469+
你也可以参考以下[安装步骤](https://github.com/kubernetes-csi/csi-proxy#installation)
470+
465471
<!--
466472
#### Networking
467473
@@ -1875,10 +1881,8 @@ Kubernetes 中日志是故障排查的一个重要元素。确保你在尝试从
18751881
注册 kubelet.exe:
18761882
18771883
```powershell
1878-
# Microsoft 在 mcr.microsoft.com/oss/kubernetes/pause:3.4.1
1879-
# 发布其基础设施容器镜像
18801884
nssm install kubelet C:\k\kubelet.exe
1881-
nssm set kubelet AppParameters --hostname-override=<hostname> --v=6 --pod-infra-container-image=mcr.microsoft.com/oss/kubernetes/pause:3.4.1 --resolv-conf="" --allow-privileged=true --enable-debugging-handlers --cluster-dns=<DNS-service-IP> --cluster-domain=cluster.local --kubeconfig=c:\k\config --hairpin-mode=promiscuous-bridge --image-pull-progress-deadline=20m --cgroups-per-qos=false --log-dir=<log directory> --logtostderr=false --enforce-node-allocatable="" --network-plugin=cni --cni-bin-dir=c:\k\cni --cni-conf-dir=c:\k\cni\config
1885+
nssm set kubelet AppParameters --hostname-override=<hostname> --v=6 --pod-infra-container-image=k8s.gcr.io/pause:3.5 --resolv-conf="" --allow-privileged=true --enable-debugging-handlers --cluster-dns=<DNS-service-IP> --cluster-domain=cluster.local --kubeconfig=c:\k\config --hairpin-mode=promiscuous-bridge --image-pull-progress-deadline=20m --cgroups-per-qos=false --log-dir=<log directory> --logtostderr=false --enforce-node-allocatable="" --network-plugin=cni --cni-bin-dir=c:\k\cni --cni-conf-dir=c:\k\cni\config
18821886
nssm set kubelet AppDirectory C:\k
18831887
nssm start kubelet
18841888
```
@@ -2177,11 +2181,11 @@ Kubernetes 中日志是故障排查的一个重要元素。确保你在尝试从
21772181
<!--
21782182
* `kubectl port-forward` fails with "unable to do port forwarding: wincat not found"
21792183
2180-
This was implemented in Kubernetes 1.15 by including wincat.exe in the pause
2181-
infrastructure container `mcr.microsoft.com/oss/kubernetes/pause:3.4.1`. Be
2182-
sure to use these versions or newer ones. If you would like to build your
2183-
own pause infrastructure container, be sure to include
2184-
[wincat](https://github.com/kubernetes-sigs/sig-windows-tools/tree/master/cmd/wincat).
2184+
Port forwarding support for Windows requires wincat.exe to be available in the
2185+
[pause infrastructure container](#pause-image).
2186+
Ensure you are using a supported image that is compatable with your Windows OS version.
2187+
If you would like to build your own pause infrastructure container be sure to include
2188+
[wincat](https://github.com/kubernetes/kubernetes/tree/master/build/pause/windows/wincat).
21852189
-->
21862190
* `kubectl port-forward` 失败,错误信息为 "unable to do port forwarding: wincat not found"
21872191

@@ -2190,6 +2194,10 @@ Kubernetes 中日志是故障排查的一个重要元素。确保你在尝试从
21902194
请确保你使用的是这些版本或者更新版本。
21912195
如果你想要自行构造你自己的 pause 基础设施容器,要确保其中包含了
21922196
[wincat](https://github.com/kubernetes-sigs/sig-windows-tools/tree/master/cmd/wincat)
2197+
2198+
Windows 的端口转发支持需要在 [pause 基础设施容器](#pause-image) 中提供 wincat.exe。
2199+
确保你使用的是与你的 Windows 操作系统版本兼容的受支持镜像。
2200+
如果你想构建自己的 pause 基础架构容器,请确保包含 [wincat](https://github.com/kubernetes/kubernetes/tree/master/build/pause/windows/wincat).。
21932201

21942202
<!--
21952203
* My Kubernetes installation is failing because my Windows Server node is
@@ -2216,10 +2224,8 @@ Kubernetes 中日志是故障排查的一个重要元素。确保你在尝试从
22162224
to accommodate worker containers crashing or restarting without losing any of
22172225
the networking configuration.
22182226
2219-
The "pause" (infrastructure) image is hosted on Microsoft Container Registry
2220-
(MCR). You can access it using `mcr.microsoft.com/oss/kubernetes/pause:3.4.1`.
2221-
For more details, see the
2222-
[DOCKERFILE](https://github.com/kubernetes-sigs/sig-windows-tools/tree/master/cmd/wincat).
2227+
Refer to the [pause image](#pause-image) section to find the recommended version
2228+
of the pause image.
22232229
-->
22242230
* `pause` 容器是什么?
22252231

@@ -2228,10 +2234,7 @@ Kubernetes 中日志是故障排查的一个重要元素。确保你在尝试从
22282234
网络名字空间和端点(相同的 IP 和端口空间)。我们需要 pause 容器来工作容器崩溃或
22292235
重启的状况,以确保不会丢失任何网络配置。
22302236

2231-
"pause" (基础设施)镜像托管在 Microsoft Container Registry (MCR) 上。
2232-
你可以使用 `mcr.microsoft.com/oss/kubernetes/pause:3.4.1` 来访问它。
2233-
要了解进一步的细节,可参阅
2234-
[DOCKERFILE](https://github.com/kubernetes-sigs/sig-windows-tools/tree/master/cmd/wincat)
2237+
请参阅 [pause 镜像](#pause-image) 部分以查找 pause 镜像的推荐版本。
22352238

22362239
<!--
22372240
### Further investigation

content/zh/docs/setup/production-environment/windows/user-guide-windows-containers.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ Windows 应用程序构成了许多组织中运行的服务和应用程序的很
4040
## Before you begin
4141
4242
* Create a Kubernetes cluster that includes a
43-
[master and a worker node running Windows Server](../user-guide-windows-nodes)
43+
control plane and a [worker node running Windows Server](/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/)
4444
* It is important to note that creating and deploying services and workloads on Kubernetes
4545
behaves in much the same way for Linux and Windows containers.
4646
[Kubectl commands](/docs/reference/kubectl/overview/) to interface with the cluster are identical.
4747
The example in the section below is provided to jumpstart your experience with Windows containers.
4848
-->
4949
## 在你开始之前
5050

51-
* 创建一个 Kubernetes 集群,其中包括一个
52-
[运行 Windows 服务器的主节点和工作节点](/zh/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/)
51+
* 创建一个 Kubernetes 集群,其中包括一个控制平面和
52+
[运行 Windows 服务器的工作节点](/zh/docs/tasks/administer-cluster/kubeadm/adding-windows-nodes/)
5353
* 重要的是要注意,对于 Linux 和 Windows 容器,在 Kubernetes
5454
上创建和部署服务和工作负载的行为几乎相同。
5555
与集群接口的 [kubectl 命令](/zh/docs/reference/kubectl/overview/)相同。
@@ -139,15 +139,15 @@ the container port 80 is exposed directly to the service.
139139
1. Check that the deployment succeeded. To verify:
140140

141141
* Two containers per pod on the Windows node, use `docker ps`
142-
* Two pods listed from the Linux master, use `kubectl get pods`
143-
* Node-to-pod communication across the network, `curl` port 80 of your pod IPs from the Linux master
142+
* Two pods listed from the Linux control plane node, use `kubectl get pods`
143+
* Node-to-pod communication across the network, `curl` port 80 of your pod IPs from the Linux control plane node
144144
to check for a web server response
145145
* Pod-to-pod communication, ping between pods (and across hosts, if you have more than one Windows node)
146146
using docker exec or kubectl exec
147147
* Service-to-pod communication, `curl` the virtual service IP (seen under `kubectl get services`)
148-
from the Linux master and from individual pods
148+
from the Linux control plane node and from individual pods
149149
* Service discovery, `curl` the service name with the Kubernetes [default DNS suffix](/docs/concepts/services-networking/dns-pod-service/#services)
150-
* Inbound connectivity, `curl` the NodePort from the Linux master or machines outside of the cluster
150+
* Inbound connectivity, `curl` the NodePort from the Linux control plane node or machines outside of the cluster
151151
* Outbound connectivity, `curl` external IPs from inside the pod using kubectl exec
152152
-->
153153
1. 检查所有节点是否健康:
@@ -168,15 +168,15 @@ the container port 80 is exposed directly to the service.
168168
1. 检查部署是否成功。验证:
169169

170170
* Windows 节点上每个 Pod 有两个容器,使用 `docker ps`
171-
* Linux 主机列出两个 Pod,使用 `kubectl get pods`
172-
* 跨网络的节点到 Pod 通信,从 Linux 主服务器 `curl` 您的 pod IPs 的端口80,以检查 Web 服务器响应
171+
* Linux 控制平面节点列出两个 Pod,使用 `kubectl get pods`
172+
* 跨网络的节点到 Pod 通信,从 Linux 控制平面节点 `curl` 您的 pod IPs 的端口80,以检查 Web 服务器响应
173173
* Pod 到 Pod 的通信,使用 docker exec 或 kubectl exec 在 Pod 之间
174174
(以及跨主机,如果你有多个 Windows 节点)进行 ping 操作
175-
* 服务到 Pod 的通信,从 Linux 主服务器和各个 Pod 中 `curl` 虚拟服务 IP
175+
* 服务到 Pod 的通信,从 Linux 控制平面节点和各个 Pod 中 `curl` 虚拟服务 IP
176176
(在 `kubectl get services` 下可见)
177177
* 服务发现,使用 Kubernetes `curl` 服务名称
178178
[默认 DNS 后缀](/zh/docs/concepts/services-networking/dns-pod-service/#services)
179-
* 入站连接,从 Linux 主服务器或集群外部的计算机 `curl` NodePort
179+
* 入站连接,从 Linux 控制平面节点或集群外部的计算机 `curl` NodePort
180180
* 出站连接,使用 kubectl exec 从 Pod 内部 curl 外部 IP
181181

182182
<!--
@@ -324,11 +324,10 @@ For example: `--register-with-taints='os=windows:NoSchedule'`
324324
<!--
325325
By adding a taint to all Windows nodes, nothing will be scheduled on them (that includes existing Linux Pods).
326326
In order for a Windows Pod to be scheduled on a Windows node,
327-
it would need both the nodeSelector to choose Windows, and the appropriate matching toleration.
327+
it would need both the nodeSelector and the appropriate matching toleration to choose Windows.
328328
-->
329329
向所有 Windows 节点添加污点后,Kubernetes 将不会在它们上调度任何负载(包括现有的 Linux Pod)。
330-
为了使某 Windows Pod 调度到 Windows 节点上,该 Pod 既需要 nodeSelector 选择 Windows,
331-
也需要合适的匹配的容忍度设置。
330+
为了使某 Windows Pod 调度到 Windows 节点上,该 Pod 需要 nodeSelector 和合适的匹配的容忍度设置来选择 Windows,
332331

333332
```yaml
334333
nodeSelector:

0 commit comments

Comments
 (0)