Merge pull request #45149 from windsonsea/introy

[zh] Sync /windows/intro.md
pull/45407/head
Kubernetes Prow Robot 2024-03-01 07:17:06 -08:00 committed by GitHub
commit 8d1ac196d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 98 additions and 31 deletions

View File

@ -28,7 +28,7 @@ of operating system.
--> -->
在许多组织中,所运行的很大一部分服务和应用是 Windows 应用。 在许多组织中,所运行的很大一部分服务和应用是 Windows 应用。
[Windows 容器](https://aka.ms/windowscontainers)提供了一种封装进程和包依赖项的方式, [Windows 容器](https://aka.ms/windowscontainers)提供了一种封装进程和包依赖项的方式,
从而简化了 DevOps 实践,令 Windows 应用程序同样遵从云原生模式。 从而简化了 DevOps 实践,令 Windows 应用同样遵从云原生模式。
对于同时投入基于 Windows 应用和 Linux 应用的组织而言,他们不必寻找不同的编排系统来管理其工作负载, 对于同时投入基于 Windows 应用和 Linux 应用的组织而言,他们不必寻找不同的编排系统来管理其工作负载,
使其跨部署的运营效率得以大幅提升,而不必关心所用的操作系统。 使其跨部署的运营效率得以大幅提升,而不必关心所用的操作系统。
@ -60,13 +60,14 @@ you can deploy worker nodes running either Windows or Linux.
<!-- <!--
Windows {{< glossary_tooltip text="nodes" term_id="node" >}} are Windows {{< glossary_tooltip text="nodes" term_id="node" >}} are
[supported](#windows-os-version-support) provided that the operating system is [supported](#windows-os-version-support) provided that the operating system is
Windows Server 2019. Windows Server 2019 or Windows Server 2022.
This document uses the term *Windows containers* to mean Windows containers with This document uses the term *Windows containers* to mean Windows containers with
process isolation. Kubernetes does not support running Windows containers with process isolation. Kubernetes does not support running Windows containers with
[Hyper-V isolation](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container). [Hyper-V isolation](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container).
--> -->
支持 Windows {{< glossary_tooltip text="节点" term_id="node" >}}的前提是操作系统为 Windows Server 2019。 支持 Windows {{< glossary_tooltip text="节点" term_id="node" >}}的前提是操作系统为
Windows Server 2019 或 Windows Server 2022。
本文使用术语 **Windows 容器**表示具有进程隔离能力的 Windows 容器。 本文使用术语 **Windows 容器**表示具有进程隔离能力的 Windows 容器。
Kubernetes 不支持使用 Kubernetes 不支持使用
@ -109,7 +110,8 @@ functionality which are outlined in this section.
Windows 节点并不支持共享命名空间的所有功能特性。 Windows 节点并不支持共享命名空间的所有功能特性。
有关更多详细信息,请参考 [API 兼容性](#api)。 有关更多详细信息,请参考 [API 兼容性](#api)。
有关 Kubernetes 测试时所使用的 Windows 版本的详细信息,请参考 [Windows 操作系统版本兼容性](#windows-os-version-support)。 有关 Kubernetes 测试时所使用的 Windows 版本的详细信息,请参考
[Windows 操作系统版本兼容性](#windows-os-version-support)。
从 API 和 kubectl 的角度来看Windows 容器的行为与基于 Linux 的容器非常相似。 从 API 和 kubectl 的角度来看Windows 容器的行为与基于 Linux 的容器非常相似。
然而,在本节所概述的一些关键功能上,二者存在一些显著差异。 然而,在本节所概述的一些关键功能上,二者存在一些显著差异。
@ -140,6 +142,7 @@ Kubernetes 关键组件在 Windows 上的工作方式与在 Linux 上相同。
你不可以在同一个 Pod 中部署 Windows 和 Linux 容器。 你不可以在同一个 Pod 中部署 Windows 和 Linux 容器。
Pod 中的所有容器都调度到同一 Node 上,每个 Node 代表一个特定的平台和体系结构。 Pod 中的所有容器都调度到同一 Node 上,每个 Node 代表一个特定的平台和体系结构。
Windows 容器支持以下 Pod 能力、属性和事件: Windows 容器支持以下 Pod 能力、属性和事件:
<!-- <!--
* Single or multiple containers per Pod with process isolation and volume sharing * Single or multiple containers per Pod with process isolation and volume sharing
* Pod `status` fields * Pod `status` fields
@ -446,7 +449,7 @@ The following list documents differences between how Pod specifications work bet
* `dnsPolicy` - Windows 不支持将 Pod `dnsPolicy` 设为 `ClusterFirstWithHostNet` * `dnsPolicy` - Windows 不支持将 Pod `dnsPolicy` 设为 `ClusterFirstWithHostNet`
因为未提供主机网络。Pod 始终用容器网络运行。 因为未提供主机网络。Pod 始终用容器网络运行。
* `podSecurityContext` [参见下文](#compatibility-v1-pod-spec-containers-securitycontext) * `podSecurityContext` [参见下文](#compatibility-v1-pod-spec-containers-securitycontext)
* `shareProcessNamespace` - 这是一个 beta 版功能特性,依赖于 Windows 上未实现的 Linux 命名空间。 * `shareProcessNamespace` - 这是一个 Beta 版功能特性,依赖于 Windows 上未实现的 Linux 命名空间。
Windows 无法共享进程命名空间或容器的根文件系统root filesystem Windows 无法共享进程命名空间或容器的根文件系统root filesystem
只能共享网络。 只能共享网络。
<!-- <!--
@ -471,7 +474,7 @@ The following list documents differences between how Pod specifications work bet
最后使用正常的 Windows 关机行为终止所有进程。 最后使用正常的 Windows 关机行为终止所有进程。
5 秒默认值实际上位于[容器内](https://github.com/moby/moby/issues/25982#issuecomment-426441183)的 5 秒默认值实际上位于[容器内](https://github.com/moby/moby/issues/25982#issuecomment-426441183)的
Windows 注册表中,因此在构建容器时可以覆盖这个值。 Windows 注册表中,因此在构建容器时可以覆盖这个值。
* `volumeDevices` - 这是一个 beta 版功能特性,未在 Windows 上实现。 * `volumeDevices` - 这是一个 Beta 版功能特性,未在 Windows 上实现。
Windows 无法将原始块设备挂接到 Pod。 Windows 无法将原始块设备挂接到 Pod。
* `volumes` * `volumes`
* 如果你定义一个 `emptyDir` 卷,则你无法将卷源设为 `memory` * 如果你定义一个 `emptyDir` 卷,则你无法将卷源设为 `memory`
@ -507,7 +510,7 @@ Only the `securityContext.runAsNonRoot` and `securityContext.windowsOptions` fro
--> -->
#### Pod 安全上下文的字段兼容性 {#compatibility-v1-pod-spec-containers-securitycontext} #### Pod 安全上下文的字段兼容性 {#compatibility-v1-pod-spec-containers-securitycontext}
Pod 的 [`securityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) Pod 的 [`securityContext`](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context)
中只有 `securityContext.runAsNonRoot``securityContext.windowsOptions` 字段在 Windows 上生效。 中只有 `securityContext.runAsNonRoot``securityContext.windowsOptions` 字段在 Windows 上生效。
<!-- <!--
@ -596,7 +599,7 @@ as the container runtime for Kubernetes nodes that run Windows.
Learn how to [install ContainerD on a Windows node](/docs/setup/production-environment/container-runtimes/#containerd). Learn how to [install ContainerD on a Windows node](/docs/setup/production-environment/container-runtimes/#containerd).
--> -->
### ContainerD {#containerd} ### ContainerD
{{< feature-state for_k8s_version="v1.20" state="stable" >}} {{< feature-state for_k8s_version="v1.20" state="stable" >}}
@ -661,6 +664,72 @@ The Kubernetes [version-skew policy](/docs/setup/release/version-skew-policy/) a
--> -->
也适用 Kubernetes [版本偏差策略](/zh-cn/releases/version-skew-policy/)。 也适用 Kubernetes [版本偏差策略](/zh-cn/releases/version-skew-policy/)。
<!--
## Hardware recommendations and considerations {#windows-hardware-recommendations}
-->
## 硬件建议和注意事项 {#windows-hardware-recommendations}
{{% thirdparty-content %}}
{{< note >}}
<!--
The following hardware specifications outlined here should be regarded as sensible default values.
They are not intended to represent minimum requirements or specific recommendations for production environments.
Depending on the requirements for your workload these values may need to be adjusted.
-->
这里列出的硬件规格应被视为合理的默认值。
它们并不代表生产环境的最低要求或具体推荐。
根据你的工作负载要求,这些值可能需要进行调整。
{{< /note >}}
<!--
- 64-bit processor 4 CPU cores or more, capable of supporting virtualization
- 8GB or more of RAM
- 50GB or more of free disk space
-->
- 64 位处理器4 核或更多的 CPU能够支持虚拟化
- 8GB 或更多的 RAM
- 50GB 或更多的可用磁盘空间
<!--
Refer to
[Hardware requirements for Windows Server Microsoft documentation](https://learn.microsoft.com/en-us/windows-server/get-started/hardware-requirements)
for the most up-to-date information on minimum hardware requirements. For guidance on deciding on resources for
production worker nodes refer to [Production worker nodes Kubernetes documentation](https://kubernetes.io/docs/setup/production-environment/#production-worker-nodes).
-->
有关最新的最低硬件要求信息,
请参考[微软文档Windows Server 的硬件要求](https://learn.microsoft.com/zh-cn/windows-server/get-started/hardware-requirements)。
有关决定生产工作节点资源的指导信息,
请参考 [Kubernetes 文档:生产用工作节点](https://kubernetes.io/zh-cn/docs/setup/production-environment/#production-worker-nodes)。
<!--
To optimize system resources, if a graphical user interface is not required,
it may be preferable to use a Windows Server OS installation that excludes
the [Windows Desktop Experience](https://learn.microsoft.com/en-us/windows-server/get-started/install-options-server-core-desktop-experience)
installation option, as this configuration typically frees up more system
resources.
-->
为了优化系统资源,如果图形用户界面不是必需的,最好选择一个不包含
[Windows 桌面体验](https://learn.microsoft.com/zh-cn/windows-server/get-started/install-options-server-core-desktop-experience)安装选项的
Windows Server 操作系统安装包,因为这种配置通常会释放更多的系统资源。
<!--
In assessing disk space for Windows worker nodes, take note that Windows container images are typically larger than
Linux container images, with container image sizes ranging
from [300MB to over 10GB](https://techcommunity.microsoft.com/t5/containers/nano-server-x-server-core-x-server-which-base-image-is-the-right/ba-p/2835785)
for a single image. Additionally, take note that the `C:` drive in Windows containers represents a virtual free size of
20GB by default, which is not the actual consumed space, but rather the disk size for which a single container can grow
to occupy when using local storage on the host.
See [Containers on Windows - Container Storage Documentation](https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-storage#storage-limits)
for more detail.
-->
在估算 Windows 工作节点的磁盘空间时,需要注意 Windows 容器镜像通常比 Linux 容器镜像更大,
单个镜像的容器大小范围从 [300MB 到超过 10GB](https://techcommunity.microsoft.com/t5/containers/nano-server-x-server-core-x-server-which-base-image-is-the-right/ba-p/2835785)。
此外,需要注意 Windows 容器中的 `C:` 驱动器默认呈现的虚拟剩余空间为 20GB
这不是实际的占用空间,而是使用主机上的本地存储时单个容器可以最多占用的磁盘大小。
有关更多详细信息,
请参见[在 Windows 上运行容器 - 容器存储文档](https://learn.microsoft.com/zh-cn/virtualization/windowscontainers/manage-containers/container-storage#storage-limits)。
<!-- <!--
## Getting help and troubleshooting {#troubleshooting} ## Getting help and troubleshooting {#troubleshooting}
@ -699,10 +768,8 @@ troubleshooting ideas prior to creating a ticket.
如果你发现疑似 bug或者你想提出功能请求请按照 如果你发现疑似 bug或者你想提出功能请求请按照
[SIG Windows 贡献指南](https://github.com/kubernetes/community/blob/master/sig-windows/CONTRIBUTING.md#reporting-issues-and-feature-requests) [SIG Windows 贡献指南](https://github.com/kubernetes/community/blob/master/sig-windows/CONTRIBUTING.md#reporting-issues-and-feature-requests)
新建一个 Issue。 新建一个 Issue。你应该先搜索 Issue 列表,以防之前报告过这个问题,凭你对该问题的经验添加评论,
你应该先搜索 issue 列表,以防之前报告过这个问题,凭你对该问题的经验添加评论, 并随附日志信息。Kubernetes Slack 上的 SIG Windows 频道也是一个很好的途径,
并随附日志信息。
Kubernetes Slack 上的 SIG Windows 频道也是一个很好的途径,
可以在创建工单之前获得一些初始支持和故障排查思路。 可以在创建工单之前获得一些初始支持和故障排查思路。
## {{% heading "whatsnext" %}} ## {{% heading "whatsnext" %}}