@@ -28,7 +28,7 @@ of operating system.
28
28
-->
29
29
在许多组织中,所运行的很大一部分服务和应用是 Windows 应用。
30
30
[ Windows 容器] ( https://aka.ms/windowscontainers ) 提供了一种封装进程和包依赖项的方式,
31
- 从而简化了 DevOps 实践,令 Windows 应用程序同样遵从云原生模式 。
31
+ 从而简化了 DevOps 实践,令 Windows 应用同样遵从云原生模式 。
32
32
33
33
对于同时投入基于 Windows 应用和 Linux 应用的组织而言,他们不必寻找不同的编排系统来管理其工作负载,
34
34
使其跨部署的运营效率得以大幅提升,而不必关心所用的操作系统。
@@ -48,7 +48,7 @@ multiple operating systems.
48
48
While you can only run the {{< glossary_tooltip text="control plane" term_id="control-plane" >}} on Linux,
49
49
you can deploy worker nodes running either Windows or Linux.
50
50
-->
51
- ## Kubernetes 中的 Windows 节点 {#windows-nodes-in-k8s}
51
+ ## Kubernetes 中的 Windows 节点 {#windows-nodes-in-k8s}
52
52
53
53
若要在 Kubernetes 中启用对 Windows 容器的编排,可以在现有的 Linux 集群中包含 Windows 节点。
54
54
在 Kubernetes 上调度 {{< glossary_tooltip text="Pod" term_id="pod" >}} 中的 Windows 容器与调度基于 Linux 的容器类似。
@@ -60,13 +60,14 @@ you can deploy worker nodes running either Windows or Linux.
60
60
<!--
61
61
Windows {{< glossary_tooltip text="nodes" term_id="node" >}} are
62
62
[supported](#windows-os-version-support) provided that the operating system is
63
- Windows Server 2019.
63
+ Windows Server 2019 or Windows Server 2022 .
64
64
65
65
This document uses the term *Windows containers* to mean Windows containers with
66
66
process isolation. Kubernetes does not support running Windows containers with
67
67
[Hyper-V isolation](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container).
68
68
-->
69
- 支持 Windows {{< glossary_tooltip text="节点" term_id="node" >}}的前提是操作系统为 Windows Server 2019。
69
+ 支持 Windows {{< glossary_tooltip text="节点" term_id="node" >}}的前提是操作系统为
70
+ Windows Server 2019 或 Windows Server 2022。
70
71
71
72
本文使用术语 ** Windows 容器** 表示具有进程隔离能力的 Windows 容器。
72
73
Kubernetes 不支持使用
@@ -85,7 +86,7 @@ including:
85
86
[HostProcess Containers](/docs/tasks/configure-pod-container/create-hostprocess-pod/) offer similar functionality.
86
87
* TerminationGracePeriod: requires containerD
87
88
-->
88
- ## 兼容性与局限性 {#limitations}
89
+ ## 兼容性与局限性 {#limitations}
89
90
90
91
某些节点层面的功能特性仅在使用特定[ 容器运行时] ( #container-runtime ) 时才可用;
91
92
另外一些特性则在 Windows 节点上不可用,包括:
@@ -109,7 +110,8 @@ functionality which are outlined in this section.
109
110
Windows 节点并不支持共享命名空间的所有功能特性。
110
111
有关更多详细信息,请参考 [ API 兼容性] ( #api ) 。
111
112
112
- 有关 Kubernetes 测试时所使用的 Windows 版本的详细信息,请参考 [ Windows 操作系统版本兼容性] ( #windows-os-version-support ) 。
113
+ 有关 Kubernetes 测试时所使用的 Windows 版本的详细信息,请参考
114
+ [ Windows 操作系统版本兼容性] ( #windows-os-version-support ) 。
113
115
114
116
从 API 和 kubectl 的角度来看,Windows 容器的行为与基于 Linux 的容器非常相似。
115
117
然而,在本节所概述的一些关键功能上,二者存在一些显著差异。
@@ -120,7 +122,7 @@ Windows 节点并不支持共享命名空间的所有功能特性。
120
122
Key Kubernetes elements work the same way in Windows as they do in Linux. This
121
123
section refers to several key workload abstractions and how they map to Windows.
122
124
-->
123
- ### 与 Linux 比较 {#comparison-with-Linux-similarities}
125
+ ### 与 Linux 比较 {#comparison-with-Linux-similarities}
124
126
125
127
Kubernetes 关键组件在 Windows 上的工作方式与在 Linux 上相同。
126
128
本节介绍几个关键的工作负载抽象及其如何映射到 Windows。
@@ -140,6 +142,7 @@ Kubernetes 关键组件在 Windows 上的工作方式与在 Linux 上相同。
140
142
你不可以在同一个 Pod 中部署 Windows 和 Linux 容器。
141
143
Pod 中的所有容器都调度到同一 Node 上,每个 Node 代表一个特定的平台和体系结构。
142
144
Windows 容器支持以下 Pod 能力、属性和事件:
145
+
143
146
<!--
144
147
* Single or multiple containers per Pod with process isolation and volume sharing
145
148
* Pod `status` fields
@@ -257,7 +260,7 @@ Pod、工作负载资源和 Service 是在 Kubernetes 上管理 Windows 工作
257
260
258
261
Some kubelet command line options behave differently on Windows, as described below:
259
262
-->
260
- ### kubelet 的命令行选项 {#kubelet-compatibility}
263
+ ### kubelet 的命令行选项 {#kubelet-compatibility}
261
264
262
265
某些 kubelet 命令行选项在 Windows 上的行为不同,如下所述:
263
266
@@ -296,7 +299,7 @@ and container runtime. Some workload properties were designed for Linux, and fai
296
299
297
300
At a high level, these OS concepts are different:
298
301
-->
299
- ### API 兼容性 {#api}
302
+ ### API 兼容性 {#api}
300
303
301
304
由于操作系统和容器运行时的缘故,Kubernetes API 在 Windows 上的工作方式存在细微差异。
302
305
某些工作负载属性是为 Linux 设计的,无法在 Windows 上运行。
@@ -367,7 +370,7 @@ work between Windows and Linux:
367
370
node. They should be applied to all containers as a best practice if the operator
368
371
wants to avoid overprovisioning entirely.
369
372
-->
370
- #### 容器规约的字段兼容性 {#compatibility-v1-pod-spec-containers}
373
+ #### 容器规约的字段兼容性 {#compatibility-v1-pod-spec-containers}
371
374
372
375
以下列表记录了 Pod 容器规约在 Windows 和 Linux 之间的工作方式差异:
373
376
@@ -437,7 +440,7 @@ The following list documents differences between how Pod specifications work bet
437
440
which are not implemented on Windows. Windows cannot share process namespaces or
438
441
the container's root filesystem. Only the network can be shared.
439
442
-->
440
- #### Pod 规约的字段兼容性 {#compatibility-v1-pod}
443
+ #### Pod 规约的字段兼容性 {#compatibility-v1-pod}
441
444
442
445
以下列表记录了 Pod 规约在 Windows 和 Linux 之间的工作方式差异:
443
446
@@ -446,7 +449,7 @@ The following list documents differences between how Pod specifications work bet
446
449
* ` dnsPolicy ` - Windows 不支持将 Pod ` dnsPolicy ` 设为 ` ClusterFirstWithHostNet ` ,
447
450
因为未提供主机网络。Pod 始终用容器网络运行。
448
451
* ` podSecurityContext ` [ 参见下文] ( #compatibility-v1-pod-spec-containers-securitycontext )
449
- * ` shareProcessNamespace ` - 这是一个 beta 版功能特性,依赖于 Windows 上未实现的 Linux 命名空间。
452
+ * ` shareProcessNamespace ` - 这是一个 Beta 版功能特性,依赖于 Windows 上未实现的 Linux 命名空间。
450
453
Windows 无法共享进程命名空间或容器的根文件系统(root filesystem)。
451
454
只能共享网络。
452
455
<!--
@@ -471,7 +474,7 @@ The following list documents differences between how Pod specifications work bet
471
474
最后使用正常的 Windows 关机行为终止所有进程。
472
475
5 秒默认值实际上位于[ 容器内] ( https://github.com/moby/moby/issues/25982#issuecomment-426441183 ) 的
473
476
Windows 注册表中,因此在构建容器时可以覆盖这个值。
474
- * ` volumeDevices ` - 这是一个 beta 版功能特性,未在 Windows 上实现。
477
+ * ` volumeDevices ` - 这是一个 Beta 版功能特性,未在 Windows 上实现。
475
478
Windows 无法将原始块设备挂接到 Pod。
476
479
* ` volumes `
477
480
* 如果你定义一个 ` emptyDir ` 卷,则你无法将卷源设为 ` memory ` 。
@@ -485,7 +488,7 @@ The following list documents differences between how Pod specifications work bet
485
488
The kubelet can now request that pods running on Windows nodes use the host's network namespace instead
486
489
of creating a new pod network namespace. To enable this functionality pass `--feature-gates=WindowsHostNetwork=true` to the kubelet.
487
490
-->
488
- #### hostNetwork 的字段兼容性 {#compatibility-v1-pod-spec-containers-hostnetwork}
491
+ #### hostNetwork 的字段兼容性 {#compatibility-v1-pod-spec-containers-hostnetwork}
489
492
490
493
{{< feature-state for_k8s_version="v1.26" state="alpha" >}}
491
494
@@ -505,9 +508,9 @@ This functionality requires a container runtime that supports this functionality
505
508
Only the `securityContext.runAsNonRoot` and `securityContext.windowsOptions` from the Pod
506
509
[`securityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) fields work on Windows.
507
510
-->
508
- #### Pod 安全上下文的字段兼容性 {#compatibility-v1-pod-spec-containers-securitycontext}
511
+ #### Pod 安全上下文的字段兼容性 {#compatibility-v1-pod-spec-containers-securitycontext}
509
512
510
- Pod 的 [ ` securityContext ` ] ( /docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context )
513
+ Pod 的 [ ` securityContext ` ] ( /zh-cn/ docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context )
511
514
中只有 ` securityContext.runAsNonRoot ` 和 ` securityContext.windowsOptions ` 字段在 Windows 上生效。
512
515
513
516
<!--
@@ -518,7 +521,7 @@ The node problem detector (see
518
521
has preliminary support for Windows.
519
522
For more information, visit the project's [GitHub page](https://github.com/kubernetes/node-problem-detector#windows).
520
523
-->
521
- ## 节点问题检测器 {#node-problem-detector}
524
+ ## 节点问题检测器 {#node-problem-detector}
522
525
523
526
节点问题检测器(参考[ 节点健康监测] ( /zh-cn/docs/tasks/debug/debug-cluster/monitor-node-health/ ) )初步支持 Windows。
524
527
有关更多信息,请访问该项目的 [ GitHub 页面] ( https://github.com/kubernetes/node-problem-detector#windows ) 。
@@ -534,7 +537,7 @@ containers, share a common network endpoint (same IPv4 and / or IPv6 address, sa
534
537
network port spaces). Kubernetes uses pause containers to allow for worker containers
535
538
crashing or restarting without losing any of the networking configuration.
536
539
-->
537
- ## Pause 容器 {#pause-container}
540
+ ## Pause 容器 {#pause-container}
538
541
539
542
在 Kubernetes Pod 中,首先创建一个基础容器或 “pause” 容器来承载容器。
540
543
在 Linux 中,构成 Pod 的 cgroup 和命名空间维持持续存在需要一个进程;
@@ -577,7 +580,7 @@ into each node in the cluster so that Pods can run there.
577
580
578
581
The following container runtimes work with Windows:
579
582
-->
580
- ## 容器运行时 {#container-runtime}
583
+ ## 容器运行时 {#container-runtime}
581
584
582
585
你需要将{{< glossary_tooltip text="容器运行时" term_id="container-runtime" >}}安装到集群中的每个节点,
583
586
这样 Pod 才能在这些节点上运行。
@@ -596,7 +599,7 @@ as the container runtime for Kubernetes nodes that run Windows.
596
599
597
600
Learn how to [install ContainerD on a Windows node](/docs/setup/production-environment/container-runtimes/#containerd).
598
601
-->
599
- ### ContainerD {#containerd}
602
+ ### ContainerD
600
603
601
604
{{< feature-state for_k8s_version="v1.20" state="stable" >}}
602
605
@@ -624,7 +627,7 @@ is available as a container runtime for all Windows Server 2019 and later versio
624
627
625
628
See [Install MCR on Windows Servers](https://docs.mirantis.com/mcr/20.10/install/mcr-windows.html) for more information.
626
629
-->
627
- ### Mirantis 容器运行时 {#mcr}
630
+ ### Mirantis 容器运行时 {#mcr}
628
631
629
632
[ Mirantis 容器运行时] ( https://docs.mirantis.com/mcr/20.10/overview.html ) (MCR)
630
633
可作为所有 Windows Server 2019 和更高版本的容器运行时。
@@ -641,7 +644,7 @@ operating system of Windows Server 2019 are fully supported.
641
644
For Kubernetes v{{< skew currentVersion >}}, operating system compatibility for Windows nodes (and Pods)
642
645
is as follows:
643
646
-->
644
- ## Windows 操作系统版本兼容性 {#windows-os-version-support}
647
+ ## Windows 操作系统版本兼容性 {#windows-os-version-support}
645
648
646
649
在 Windows 节点上,如果主机操作系统版本必须与容器基础镜像操作系统版本匹配,
647
650
则会应用严格的兼容性规则。
@@ -654,13 +657,79 @@ Windows Server LTSC release
654
657
: Windows Server 2022
655
658
656
659
Windows Server SAC release
657
- : Windows Server version 20H2
660
+ : Windows Server version 20H2
658
661
659
662
<!--
660
663
The Kubernetes [version-skew policy](/docs/setup/release/version-skew-policy/) also applies.
661
664
-->
662
665
也适用 Kubernetes [ 版本偏差策略] ( /zh-cn/releases/version-skew-policy/ ) 。
663
666
667
+ <!--
668
+ ## Hardware recommendations and considerations {#windows-hardware-recommendations}
669
+ -->
670
+ ## 硬件建议和注意事项 {#windows-hardware-recommendations}
671
+
672
+ {{% thirdparty-content %}}
673
+
674
+ {{< note >}}
675
+ <!--
676
+ The following hardware specifications outlined here should be regarded as sensible default values.
677
+ They are not intended to represent minimum requirements or specific recommendations for production environments.
678
+ Depending on the requirements for your workload these values may need to be adjusted.
679
+ -->
680
+ 这里列出的硬件规格应被视为合理的默认值。
681
+ 它们并不代表生产环境的最低要求或具体推荐。
682
+ 根据你的工作负载要求,这些值可能需要进行调整。
683
+ {{< /note >}}
684
+
685
+ <!--
686
+ - 64-bit processor 4 CPU cores or more, capable of supporting virtualization
687
+ - 8GB or more of RAM
688
+ - 50GB or more of free disk space
689
+ -->
690
+ - 64 位处理器,4 核或更多的 CPU,能够支持虚拟化
691
+ - 8GB 或更多的 RAM
692
+ - 50GB 或更多的可用磁盘空间
693
+
694
+ <!--
695
+ Refer to
696
+ [Hardware requirements for Windows Server Microsoft documentation](https://learn.microsoft.com/en-us/windows-server/get-started/hardware-requirements)
697
+ for the most up-to-date information on minimum hardware requirements. For guidance on deciding on resources for
698
+ production worker nodes refer to [Production worker nodes Kubernetes documentation](https://kubernetes.io/docs/setup/production-environment/#production-worker-nodes).
699
+ -->
700
+ 有关最新的最低硬件要求信息,
701
+ 请参考[ 微软文档:Windows Server 的硬件要求] ( https://learn.microsoft.com/zh-cn/windows-server/get-started/hardware-requirements ) 。
702
+ 有关决定生产工作节点资源的指导信息,
703
+ 请参考 [ Kubernetes 文档:生产用工作节点] ( https://kubernetes.io/zh-cn/docs/setup/production-environment/#production-worker-nodes ) 。
704
+
705
+ <!--
706
+ To optimize system resources, if a graphical user interface is not required,
707
+ it may be preferable to use a Windows Server OS installation that excludes
708
+ the [Windows Desktop Experience](https://learn.microsoft.com/en-us/windows-server/get-started/install-options-server-core-desktop-experience)
709
+ installation option, as this configuration typically frees up more system
710
+ resources.
711
+ -->
712
+ 为了优化系统资源,如果图形用户界面不是必需的,最好选择一个不包含
713
+ [ Windows 桌面体验] ( https://learn.microsoft.com/zh-cn/windows-server/get-started/install-options-server-core-desktop-experience ) 安装选项的
714
+ Windows Server 操作系统安装包,因为这种配置通常会释放更多的系统资源。
715
+
716
+ <!--
717
+ In assessing disk space for Windows worker nodes, take note that Windows container images are typically larger than
718
+ Linux container images, with container image sizes ranging
719
+ 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)
720
+ for a single image. Additionally, take note that the `C:` drive in Windows containers represents a virtual free size of
721
+ 20GB by default, which is not the actual consumed space, but rather the disk size for which a single container can grow
722
+ to occupy when using local storage on the host.
723
+ See [Containers on Windows - Container Storage Documentation](https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/container-storage#storage-limits)
724
+ for more detail.
725
+ -->
726
+ 在估算 Windows 工作节点的磁盘空间时,需要注意 Windows 容器镜像通常比 Linux 容器镜像更大,
727
+ 单个镜像的容器大小范围从 [ 300MB 到超过 10GB] ( https://techcommunity.microsoft.com/t5/containers/nano-server-x-server-core-x-server-which-base-image-is-the-right/ba-p/2835785 ) 。
728
+ 此外,需要注意 Windows 容器中的 ` C: ` 驱动器默认呈现的虚拟剩余空间为 20GB,
729
+ 这不是实际的占用空间,而是使用主机上的本地存储时单个容器可以最多占用的磁盘大小。
730
+ 有关更多详细信息,
731
+ 请参见[ 在 Windows 上运行容器 - 容器存储文档] ( https://learn.microsoft.com/zh-cn/virtualization/windowscontainers/manage-containers/container-storage#storage-limits ) 。
732
+
664
733
<!--
665
734
## Getting help and troubleshooting {#troubleshooting}
666
735
@@ -675,7 +744,7 @@ troubleshooting assistance from other contributors. Follow the
675
744
instructions in the
676
745
SIG Windows [contributing guide on gathering logs](https://github.com/kubernetes/community/blob/master/sig-windows/CONTRIBUTING.md#gathering-logs).
677
746
-->
678
- ## 获取帮助和故障排查 {#troubleshooting}
747
+ ## 获取帮助和故障排查 {#troubleshooting}
679
748
680
749
对 Kubernetes 集群进行故障排查的主要帮助来源应始于[ 故障排查] ( /zh-cn/docs/tasks/debug/ ) 页面。
681
750
@@ -695,14 +764,12 @@ reported previously and comment with your experience on the issue and add additi
695
764
logs. SIG Windows channel on the Kubernetes Slack is also a great avenue to get some initial support and
696
765
troubleshooting ideas prior to creating a ticket.
697
766
-->
698
- ### 报告问题和功能请求 {#report-issue-and-feature-request}
767
+ ### 报告问题和功能请求 {#report-issue-and-feature-request}
699
768
700
769
如果你发现疑似 bug,或者你想提出功能请求,请按照
701
770
[ SIG Windows 贡献指南] ( https://github.com/kubernetes/community/blob/master/sig-windows/CONTRIBUTING.md#reporting-issues-and-feature-requests )
702
- 新建一个 Issue。
703
- 你应该先搜索 issue 列表,以防之前报告过这个问题,凭你对该问题的经验添加评论,
704
- 并随附日志信息。
705
- Kubernetes Slack 上的 SIG Windows 频道也是一个很好的途径,
771
+ 新建一个 Issue。你应该先搜索 Issue 列表,以防之前报告过这个问题,凭你对该问题的经验添加评论,
772
+ 并随附日志信息。Kubernetes Slack 上的 SIG Windows 频道也是一个很好的途径,
706
773
可以在创建工单之前获得一些初始支持和故障排查思路。
707
774
708
775
## {{% heading "whatsnext" %}}
@@ -715,7 +782,7 @@ plane to manage the cluster it, and nodes to run your workloads.
715
782
716
783
The Kubernetes [cluster API](https://cluster-api.sigs.k8s.io/) project also provides means to automate deployment of Windows nodes.
717
784
-->
718
- ## 部署工具 {#deployment-tools}
785
+ ## 部署工具 {#deployment-tools}
719
786
720
787
kubeadm 工具帮助你部署 Kubernetes 集群,提供管理集群的控制平面以及运行工作负载的节点。
721
788
@@ -732,7 +799,7 @@ Information on the different Windows Server servicing channels
732
799
including their support models can be found at
733
800
[Windows Server servicing channels](https://docs.microsoft.com/en-us/windows-server/get-started/servicing-channels-comparison).
734
801
-->
735
- ## Windows 分发渠道 {#windows-distribution-channels}
802
+ ## Windows 分发渠道 {#windows-distribution-channels}
736
803
737
804
有关 Windows 分发渠道的详细阐述,请参考
738
805
[ Microsoft 文档] ( https://docs.microsoft.com/zh-cn/windows-server/get-started-19/servicing-channels-19 ) 。
0 commit comments