

 **帮助改进此页面** 

要帮助改进本用户指南，请选择位于每个页面右侧窗格中的**在 GitHub 上编辑此页面**链接。

# 使用优化版 Windows AMI 创建节点
<a name="eks-optimized-windows-ami"></a>

Windows Amazon EKS 优化版 AMI 基于 Windows Server 2019、Windows Server 2022 和 Windows Server 2025 构建。它们被配置作为 Amazon EKS 节点的基本映像。默认情况下，AMI 包括以下组件：
+  [kubelet](https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/) 
+  [kube-proxy](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/) 
+  [适用于 Kubernetes 的 AWS IAM 身份验证器](https://github.com/kubernetes-sigs/aws-iam-authenticator) 
+  [csi-proxy](https://github.com/kubernetes-csi/csi-proxy) 
+  [containerd](https://containerd.io/) 

**注意**  
您可以使用 [Microsoft 安全更新指南](https://portal.msrc.microsoft.com/en-us/security-guidance)跟踪 Windows Server 的安全或隐私事件。

Amazon EKS 提供了已针对 Windows 容器进行了优化的 AMI，包括以下变体：
+ Amazon EKS 优化版 Windows Server 2019 Core AMI
+ Amazon EKS 优化版 Windows Server 2019 Full AMI
+ Amazon EKS 优化版 Windows Server 2022 Core AMI
+ Amazon EKS 优化版 Windows Server 2022 Full AMI
+ Amazon EKS 优化版 Windows Server 2025 Core AMI
+ Amazon EKS 优化版 Windows Server 2025 Full AMI

**重要**  
Amazon EKS 优化版 Windows Server 20H2 Core AMI 已弃用。不会发布此 AMI 的任何新版本。
为了确保您在默认情况下安装了最新的安全更新，Amazon EKS 将维持最近 4 个月的优化版 Windows AMI。自首次发布之日起，每个新 AMI 的可用期为 4 个月。在此期限之后，较旧的 AMI 将变为私有且不能再访问。我们鼓励使用最新的 AMI，以避免出现安全漏洞，避免无法访问已达到其支持生命周期尽头的旧 AMI。虽然我们不能保证可以提供对已设为私有的 AMI 的访问权限，但您可以通过向 AWS Support 提交服务单来请求访问权限。

## 发布日历
<a name="windows-ami-release-calendar"></a>

下表列出了 Amazon EKS 上的 Windows 版本的发布日期和支持终止日期。如果终止日期为空，则是因为相应版本仍受支持。


| Windows 版本 | Amazon EKS 版本 | Amazon EKS 支持终止 | 
| --- | --- | --- | 
|  Windows Server 2025 Core  |  01/27/2026  |  | 
|  Windows Server 2025 Full  |  01/27/2026  |  | 
|  Windows Server 2022 Core  |  10/17/2022  |  | 
|  Windows Server 2022 Full  |  10/17/2022  |  | 
|  Windows Server 20H2 Core  |  8/12/2021  |  8/9/2022  | 
|  Windows Server 2004 Core  |  8/19/2020  |  12/14/2021  | 
|  Windows Server 2019 Core  |  10/7/2019  |  | 
|  Windows Server 2019 Full  |  10/7/2019  |  | 
|  Windows Server 1909 Core  |  10/7/2019  |  12/8/2020  | 

## 引导脚本配置参数
<a name="bootstrap-script-configuration-parameters"></a>

创建 Windows 节点时，节点上有一个允许配置不同参数的脚本。根据您的设置，可以在节点上类似于以下位置：`C:\Program Files\Amazon\EKS\Start-EKSBootstrap.ps1` 找到此脚本。您可以通过将自定义参数值指定为引导脚本的参数。例如，您可以更新启动模板中的用户数据。有关更多信息，请参阅 [Amazon EC2 用户数据](launch-templates.md#launch-template-user-data)。

此脚本包含以下命令行参数：
+  `-EKSClusterName`：指定此 Worker 节点要加入的 Amazon EKS 集群名称。
+  `-KubeletExtraArgs`：为 `kubelet` 指定额外的参数（可选）。
+  `-KubeProxyExtraArgs`：为 `kube-proxy` 指定额外的参数（可选）。
+  `-APIServerEndpoint`：指定 Amazon EKS 集群 API 服务器端点（可选）。仅在与 `-Base64ClusterCA` 一起使用时才有效。绕过调用 `Get-EKSCluster`。
+  `-Base64ClusterCA`：指定 base64 编码的集群 CA 内容（可选）。仅在与 `-APIServerEndpoint` 一起使用时才有效。绕过调用 `Get-EKSCluster`。
+  `-DNSClusterIP`：覆盖用于集群内 DNS 查询的 IP 地址（可选）。基于主接口的 IP 地址，默认值为 `10.100.0.10` 或 `172.20.0.10`。
+  `-ServiceCIDR` – 覆盖从中寻址集群服务的 Kubernetes 服务 IP 地址范围。基于主接口的 IP 地址，默认值为 `172.20.0.0/16` 或 `10.100.0.0/16`。
+  `-ExcludedSnatCIDRs` – 要从源网络地址转换（SNAT）中排除的 `IPv4` CIDR 列表。这意味着，VPC 可寻址的容器组（pod）私有 IP 不会转换为用于出站流量的实例 ENI 主 `IPv4` 地址的 IP 地址。默认情况下，系统会添加 Amazon EKS Windows 节点的 VPC 的 `IPv4` CIDR。为该参数指定 CIDR 还会另外排除所指定的 CIDR。有关更多信息，请参阅 [为容器组（pod）启用出站互联网访问权限](external-snat.md)。

除了命令行参数之外，您还可以指定一些环境变量参数。指定命令行参数时，它优先于相应的环境变量。环境变量应定义为机器（或系统）作用范围，因为引导脚本只会读取机器范围的变量。

该脚本考虑以下环境变量：
+  `SERVICE_IPV4_CIDR` — 有关定义，请参阅 `ServiceCIDR` 命令行参数。
+  `EXCLUDED_SNAT_CIDRS` — 应为以逗号分隔的字符串。有关定义，请参阅 `ExcludedSnatCIDRs` 命令行参数。

### gMSA 身份验证支持
<a name="ad-and-gmsa-support"></a>

Amazon EKS Windows 容器组（pod）允许不同类型的组托管服务账户（gMSA）身份验证。
+ Amazon EKS 支持使用 Active Directory 域身份进行身份验证。有关加入域的 gMSA 的更多信息，请参阅 AWS 博客上的 [Windows Authentication on Amazon EKS Windows pods](https://aws.amazon.com/blogs/containers/windows-authentication-on-amazon-eks-windows-pods)。
+ Amazon EKS 提供一个插件，可让未加入域的 Windows 节点使用移动用户标识号检索 gMSA 凭证。有关无域 gMSA 的更多信息，请参阅 AWS 博客上的 [Domainless Windows Authentication for Amazon EKS Windows pods](https://aws.amazon.com/blogs/containers/domainless-windows-authentication-for-amazon-eks-windows-pods)。

## 缓存的容器映像
<a name="windows-cached-container-images"></a>

Amazon EKS Windows 优化版 AMI 缓存了某些容器映像，用于 `containerd` 运行时。使用 Amazon 托管的构建组件构建自定义 AMI 时，系统会缓存容器映像。有关更多信息，请参阅 [使用 Amazon 托管的构建组件](eks-custom-ami-windows.md#custom-windows-ami-build-component)。

以下缓存的容器映像适用于 `containerd` 运行时系统：
+  `amazonaws.com/eks/pause-windows` 
+  `mcr.microsoft.com/windows/nanoserver` 
+  `mcr.microsoft.com/windows/servercore` 

## 更多信息
<a name="windows-more-information"></a>

有关使用 Amazon EKS 优化版 Windows AMI 的更多信息，请参阅以下章节：
+ 有关在 Amazon EKS 优化加速型 Windows AMI 上运行工作负载的详细信息，请参阅[运行 GPU 加速容器（EC2 G 系列上的 Windows）](ml-eks-windows-optimized-ami.md)。
+ 要将 Windows 与托管节点组一起使用，请参阅[使用托管式节点组简化节点生命周期](managed-node-groups.md)。
+ 要启动自主管理型 Windows 节点，请参阅[创建自主管理型 Microsoft Windows 节点](launch-windows-workers.md)。
+ 有关版本信息，请参阅 [检索 Windows AMI 版本信息](eks-ami-versions-windows.md)。
+ 要检索 Amazon EKS 优化版 Windows AMI 的最新 ID，请参阅[检索建议的 Microsoft Windows AMI ID](retrieve-windows-ami-id.md)。
+ 要使用 Amazon EC2 Image Builder 创建自定义 Amazon EKS 优化版 Windows AMI，请参阅[使用 Image Builder 构建自定义 Windows AMI](eks-custom-ami-windows.md)。
+ 有关最佳实践，请参阅 *EKS 最佳实践指南*中的[Amazon EKS 优化版 Windows AMI 管理](https://aws.github.io/aws-eks-best-practices/windows/docs/ami/)。