Skip to content

Commit 6789aa8

Browse files
authored
Merge pull request #39365 from Zhuzhenghao/intro
[zh]Resync page windows/intro
2 parents 0773363 + d7ceca9 commit 6789aa8

File tree

1 file changed

+53
-49
lines changed
  • content/zh-cn/docs/concepts/windows

1 file changed

+53
-49
lines changed

content/zh-cn/docs/concepts/windows/intro.md

Lines changed: 53 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,14 @@ Kubernetes 关键组件在 Windows 上的工作方式与在 Linux 上相同。
133133
Linux containers in the same Pod. All containers in a Pod are scheduled onto a single
134134
Node where each Node represents a specific platform and architecture. The following
135135
Pod capabilities, properties and events are supported with Windows containers:
136+
-->
137+
* [Pod](/zh-cn/docs/concepts/workloads/pods/)
136138

139+
Pod 是 Kubernetes 的基本构建块,是可以创建或部署的最小和最简单的单元。
140+
你不可以在同一个 Pod 中部署 Windows 和 Linux 容器。
141+
Pod 中的所有容器都调度到同一 Node 上,每个 Node 代表一个特定的平台和体系结构。
142+
Windows 容器支持以下 Pod 能力、属性和事件:
143+
<!--
137144
* Single or multiple containers per Pod with process isolation and volume sharing
138145
* Pod `status` fields
139146
* Readiness, liveness, and startup probes
@@ -142,28 +149,7 @@ Kubernetes 关键组件在 Windows 上的工作方式与在 Linux 上相同。
142149
* `emptyDir` volumes
143150
* Named pipe host mounts
144151
* Resource limits
145-
* OS field:
146-
147-
The `.spec.os.name` field should be set to `windows` to indicate that the current Pod uses Windows containers.
148-
149-
{{< note >}}
150-
Starting from 1.25, the `IdentifyPodOS` feature gate is in GA stage and defaults to be enabled.
151-
{{< /note >}}
152-
153-
If you set the `.spec.os.name` field to `windows`,
154-
you must not set the following fields in the `.spec` of that Pod:
155-
In the above list, wildcards (`*`) indicate all elements in a list.
156-
For example, `spec.containers[*].securityContext` refers to the SecurityContext object
157-
for all containers. If any of these fields is specified, the Pod will
158-
not be admitted by the API server.
159-
-->
160-
* [Pod](/zh-cn/docs/concepts/workloads/pods/)
161-
162-
Pod 是 Kubernetes 的基本构建块,是可以创建或部署的最小和最简单的单元。
163-
你不可以在同一个 Pod 中部署 Windows 和 Linux 容器。
164-
Pod 中的所有容器都调度到同一 Node 上,每个 Node 代表一个特定的平台和体系结构。
165-
Windows 容器支持以下 Pod 能力、属性和事件:
166-
152+
-->
167153
* 每个 Pod 有一个或多个容器,具有进程隔离和卷共享能力
168154
* Pod `status` 字段
169155
* 就绪、存活和启动探针
@@ -172,14 +158,26 @@ Kubernetes 关键组件在 Windows 上的工作方式与在 Linux 上相同。
172158
* `emptyDir`
173159
* 命名管道形式的主机挂载
174160
* 资源限制
161+
<!--
162+
* OS field:
163+
164+
The `.spec.os.name` field should be set to `windows` to indicate that the current Pod uses Windows containers.
165+
-->
175166
* 操作系统字段:
176167

177168
`.spec.os.name` 字段应设置为 `windows` 以表明当前 Pod 使用 Windows 容器。
178169

179170
{{< note >}}
171+
<!--
172+
Starting from 1.25, the `IdentifyPodOS` feature gate is in GA stage and defaults to be enabled.
173+
-->
180174
从 1.25 开始,`IdentifyPodOS` 特性门控进入 GA 阶段,默认启用。
181175
{{< /note >}}
182176

177+
<!--
178+
If you set the `.spec.os.name` field to `windows`,
179+
you must not set the following fields in the `.spec` of that Pod:
180+
-->
183181
如果你将 `.spec.os.name` 字段设置为 `windows`
184182
则你必须不能在对应 Pod 的 `.spec` 中设置以下字段:
185183

@@ -203,7 +201,13 @@ Kubernetes 关键组件在 Windows 上的工作方式与在 Linux 上相同。
203201
* `spec.containers[*].securityContext.procMount`
204202
* `spec.containers[*].securityContext.runAsUser`
205203
* `spec.containers[*].securityContext.runAsGroup`
206-
204+
205+
<!--
206+
In the above list, wildcards (`*`) indicate all elements in a list.
207+
For example, `spec.containers[*].securityContext` refers to the SecurityContext object
208+
for all containers. If any of these fields is specified, the Pod will
209+
not be admitted by the API server.
210+
-->
207211
在上述列表中,通配符(`*`)表示列表中的所有项。
208212
例如,`spec.containers[*].securityContext` 指代所有容器的 SecurityContext 对象。
209213
如果指定了这些字段中的任意一个,则 API 服务器不会接受此 Pod。
@@ -238,7 +242,7 @@ Kubernetes 关键组件在 Windows 上的工作方式与在 Linux 上相同。
238242
Pods, workload resources, and Services are critical elements to managing Windows
239243
workloads on Kubernetes. However, on their own they are not enough to enable
240244
the proper lifecycle management of Windows workloads in a dynamic cloud native
241-
environment. Kubernetes also supports:
245+
environment.
242246
243247
* `kubectl exec`
244248
* Pod and container metrics
@@ -248,7 +252,6 @@ environment. Kubernetes also supports:
248252
-->
249253
Pod、工作负载资源和 Service 是在 Kubernetes 上管理 Windows 工作负载的关键元素。
250254
然而,它们本身还不足以在动态的云原生环境中对 Windows 工作负载进行恰当的生命周期管理。
251-
Kubernetes 还支持:
252255

253256
* `kubectl exec`
254257
* Pod 和容器度量指标
@@ -356,7 +359,7 @@ passed from the Kubernetes components (kubelet, kube-proxy) are unchanged.
356359
但是,从 Kubernetes 组件(kubelet、kube-proxy)传递的退出码保持不变。
357360

358361
<!--
359-
##### Field compatibility for container specifications {#compatibility-v1-pod-spec-containers}
362+
#### Field compatibility for container specifications {#compatibility-v1-pod-spec-containers}
360363
361364
The following list documents differences between how Pod container specifications
362365
work between Windows and Linux:
@@ -371,9 +374,9 @@ work between Windows and Linux:
371374
node. They should be applied to all containers as a best practice if the operator
372375
wants to avoid overprovisioning entirely.
373376
-->
374-
##### 容器规范的字段兼容性 {#compatibility-v1-pod-spec-containers}
377+
#### 容器规约的字段兼容性 {#compatibility-v1-pod-spec-containers}
375378

376-
以下列表记录了 Pod 容器规范在 Windows 和 Linux 之间的工作方式差异:
379+
以下列表记录了 Pod 容器规约在 Windows 和 Linux 之间的工作方式差异:
377380

378381
* 巨页(Huge page)在 Windows 容器运行时中未实现,且不可用。
379382
巨页需要不可为容器配置的[用户特权生效](https://docs.microsoft.com/zh-cn/windows/win32/memory/large-page-support)
@@ -419,15 +422,15 @@ work between Windows and Linux:
419422
default value is `/dev/termination-log`, which does work because it does not
420423
exist on Windows by default.
421424
-->
422-
* `securityContext.runAsNonRoot` -
425+
* `securityContext.runAsNonRoot` -
423426
此设置将阻止以 `ContainerAdministrator` 身份运行容器,这是 Windows 上与 root 用户最接近的身份。
424427
* `securityContext.runAsUser` - 改用 [`runAsUserName`](/zh-cn/docs/tasks/configure-pod-container/configure-runasusername)
425428
* `securityContext.seLinuxOptions` - 不能在 Windows 上使用,因为 SELinux 特定于 Linux。
426429
* `terminationMessagePath` - 这个字段有一些限制,因为 Windows 不支持映射单个文件。
427430
默认值为 `/dev/termination-log`,因为默认情况下它在 Windows 上不存在,所以能生效。
428431

429432
<!--
430-
##### Field compatibility for Pod specifications {#compatibility-v1-pod}
433+
#### Field compatibility for Pod specifications {#compatibility-v1-pod}
431434
432435
The following list documents differences between how Pod specifications work between Windows and Linux:
433436
@@ -441,9 +444,9 @@ The following list documents differences between how Pod specifications work bet
441444
which are not implemented on Windows. Windows cannot share process namespaces or
442445
the container's root filesystem. Only the network can be shared.
443446
-->
444-
##### Pod 规范的字段兼容性 {#compatibility-v1-pod}
447+
#### Pod 规约的字段兼容性 {#compatibility-v1-pod}
445448

446-
以下列表记录了 Pod 规范在 Windows 和 Linux 之间的工作方式差异:
449+
以下列表记录了 Pod 规约在 Windows 和 Linux 之间的工作方式差异:
447450

448451
* `hostIPC``hostpid` - 不能在 Windows 上共享主机命名空间。
449452
* `hostNetwork` - [参见下文](#compatibility-v1-pod-spec-containers-hostnetwork)
@@ -498,20 +501,21 @@ of creating a new pod network namespace. To enable this functionality pass `--fe
498501

499502
{{< note >}}
500503
<!--
501-
This functionality requires a container runtime that supports this functionality.
504+
This functionality requires a container runtime that supports this functionality.
502505
-->
503506
此功能需要支持该功能的容器运行时。
504507
{{< /note >}}
505508

506509
<!--
507510
#### Field compatibility for Pod security context {#compatibility-v1-pod-spec-containers-securitycontext}
508511
509-
None of the Pod [`securityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) fields work on Windows.
512+
Only the `securityContext.runAsNonRoot` and `securityContext.windowsOptions` from the Pod
513+
[`securityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) fields work on Windows.
510514
-->
511515
#### Pod 安全上下文的字段兼容性 {#compatibility-v1-pod-spec-containers-securitycontext}
512516

513-
Pod 的所有 [`securityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context)
514-
字段都无法在 Windows 上生效。
517+
Pod [`securityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context)
518+
中只有 `securityContext.runAsNonRoot``securityContext.windowsOptions` 字段在 Windows 上生效。
515519

516520
<!--
517521
## Node problem detector
@@ -527,7 +531,7 @@ For more information, visit the project's [GitHub page](https://github.com/kuber
527531
有关更多信息,请访问该项目的 [GitHub 页面](https://github.com/kubernetes/node-problem-detector#windows)
528532

529533
<!--
530-
### Pause container
534+
## Pause container
531535
532536
In a Kubernetes Pod, an infrastructure or “pause” container is first created
533537
to host the container. In Linux, the cgroups and namespaces that make up a pod
@@ -537,7 +541,7 @@ containers, share a common network endpoint (same IPv4 and / or IPv6 address, sa
537541
network port spaces). Kubernetes uses pause containers to allow for worker containers
538542
crashing or restarting without losing any of the networking configuration.
539543
-->
540-
### Pause 容器 {#pause-container}
544+
## Pause 容器 {#pause-container}
541545

542546
在 Kubernetes Pod 中,首先创建一个基础容器或 “pause” 容器来承载容器。
543547
在 Linux 中,构成 Pod 的 cgroup 和命名空间维持持续存在需要一个进程;
@@ -572,15 +576,15 @@ Microsoft 进行了[验证码签名](https://docs.microsoft.com/zh-cn/windows-ha
572576
Kubernetes 项目建议使用 Microsoft 维护的镜像。
573577

574578
<!--
575-
### Container runtimes {#container-runtime}
579+
## Container runtimes {#container-runtime}
576580
577581
You need to install a
578582
{{< glossary_tooltip text="container runtime" term_id="container-runtime" >}}
579583
into each node in the cluster so that Pods can run there.
580584
581585
The following container runtimes work with Windows:
582586
-->
583-
### 容器运行时 {#container-runtime}
587+
## 容器运行时 {#container-runtime}
584588

585589
你需要将{{< glossary_tooltip text="容器运行时" term_id="container-runtime" >}}安装到集群中的每个节点,
586590
这样 Pod 才能在这些节点上运行。
@@ -590,7 +594,7 @@ The following container runtimes work with Windows:
590594
{{% thirdparty-content %}}
591595

592596
<!--
593-
#### ContainerD
597+
### ContainerD
594598
595599
{{< feature-state for_k8s_version="v1.20" state="stable" >}}
596600
@@ -599,7 +603,7 @@ as the container runtime for Kubernetes nodes that run Windows.
599603
600604
Learn how to [install ContainerD on a Windows node](/docs/setup/production-environment/container-runtimes/#install-containerd).
601605
-->
602-
#### ContainerD {#containerd}
606+
### ContainerD {#containerd}
603607

604608
{{< feature-state for_k8s_version="v1.20" state="stable" >}}
605609

@@ -608,26 +612,26 @@ Learn how to [install ContainerD on a Windows node](/docs/setup/production-envir
608612

609613
学习如何[在 Windows 上安装 ContainerD](/zh-cn/docs/setup/production-environment/container-runtimes/#install-containerd)
610614

615+
{{< note >}}
611616
<!--
612617
There is a [known limitation](/docs/tasks/configure-pod-container/configure-gmsa/#gmsa-limitations)
613618
when using GMSA with containerd to access Windows network shares, which requires a
614619
kernel patch.
615620
-->
616-
{{< note >}}
617621
将 GMSA 和 containerd 一起用于访问 Windows
618622
网络共享时存在[已知限制](/zh-cn/docs/tasks/configure-pod-container/configure-gmsa/#gmsa-limitations)
619623
这需要一个内核补丁。
620624
{{< /note >}}
621625

622626
<!--
623-
#### Mirantis Container Runtime {#mcr}
627+
### Mirantis Container Runtime {#mcr}
624628
625629
[Mirantis Container Runtime](https://docs.mirantis.com/mcr/20.10/overview.html) (MCR)
626630
is available as a container runtime for all Windows Server 2019 and later versions.
627631
628632
See [Install MCR on Windows Servers](https://docs.mirantis.com/mcr/20.10/install/mcr-windows.html) for more information.
629633
-->
630-
#### Mirantis 容器运行时 {#mcr}
634+
### Mirantis 容器运行时 {#mcr}
631635

632636
[Mirantis 容器运行时](https://docs.mirantis.com/mcr/20.10/overview.html)(MCR)
633637
可作为所有 Windows Server 2019 和更高版本的容器运行时。
@@ -711,21 +715,21 @@ Kubernetes Slack 上的 SIG Windows 频道也是一个很好的途径,
711715
## {{% heading "whatsnext" %}}
712716

713717
<!--
714-
### Deployment tools
718+
## Deployment tools
715719
716720
The kubeadm tool helps you to deploy a Kubernetes cluster, providing the control
717721
plane to manage the cluster it, and nodes to run your workloads.
718722
719723
The Kubernetes [cluster API](https://cluster-api.sigs.k8s.io/) project also provides means to automate deployment of Windows nodes.
720724
-->
721-
### 部署工具 {#deployment-tools}
725+
## 部署工具 {#deployment-tools}
722726

723727
kubeadm 工具帮助你部署 Kubernetes 集群,提供管理集群的控制平面以及运行工作负载的节点。
724728

725729
Kubernetes [集群 API](https://cluster-api.sigs.k8s.io/) 项目也提供了自动部署 Windows 节点的方式。
726730

727731
<!--
728-
### Windows distribution channels
732+
## Windows distribution channels
729733
730734
For a detailed explanation of Windows distribution channels see the
731735
[Microsoft documentation](https://docs.microsoft.com/en-us/windows-server/get-started-19/servicing-channels-19).
@@ -734,7 +738,7 @@ Information on the different Windows Server servicing channels
734738
including their support models can be found at
735739
[Windows Server servicing channels](https://docs.microsoft.com/en-us/windows-server/get-started/servicing-channels-comparison).
736740
-->
737-
### Windows 分发渠道 {#windows-distribution-channels}
741+
## Windows 分发渠道 {#windows-distribution-channels}
738742

739743
有关 Windows 分发渠道的详细阐述,请参考
740744
[Microsoft 文档](https://docs.microsoft.com/zh-cn/windows-server/get-started-19/servicing-channels-19)

0 commit comments

Comments
 (0)