Kubernetes 中的 Windows
支持的版本: Kubernetes 1.32, 1.33, 1.34 最后更新: February 11, 2026
Kubernetes 最初是为 Linux 容器设计的,但从 1.14 版本开始增加了对 Windows 容器的生产支持。本章将探讨如何在 Kubernetes 中运行 Windows 工作负载、相关架构、限制,以及 Amazon EKS 中的 Windows 支持。
目录
- Windows 容器概述
- Kubernetes Windows 支持架构
- Windows 节点限制
- Windows 节点设置
- 部署 Windows 容器
- 网络
- 存储
- 监控和日志记录
- 安全性
- Amazon EKS 中的 Windows 支持
- 最佳实践
- 结论
Windows 容器概述
Windows 容器是在 Windows 操作系统上运行的容器,可让您将 Windows 应用程序容器化并进行部署。
Windows 容器类型
Windows 容器有两种类型:
Windows Server Containers:与 Linux 容器类似,它们共享主机 OS 内核。它们轻量且启动迅速,但要求与主机使用相同的 Windows 版本。
Hyper-V Isolation Containers:每个容器都在轻量级 VM 中运行,提供更高级别的隔离。它们可以运行与主机不同的 Windows 版本,但会使用更多资源。
下图展示了两种 Windows 容器类型之间的架构差异:
Windows 容器镜像
Windows 容器镜像基于 Microsoft 提供的基础镜像:
- Windows Server Core:提供最小 Windows Server 环境的轻量级镜像
- Nano Server:占用空间更小的超轻量级镜像
- Windows:提供完整 Windows Server 环境的镜像
Dockerfile 示例:
FROM mcr.microsoft.com/windows/servercore:ltsc2019
WORKDIR /app
COPY . .
RUN powershell -Command "Install-WindowsFeature Web-Server"
EXPOSE 80
CMD ["powershell", "-Command", "Start-Service W3SVC; Get-Content -Path 'C:\\inetpub\\logs\\LogFiles\\W3SVC1\\u_ex*' -Wait"]Kubernetes Windows 支持架构
Kubernetes 中的 Windows 支持基于混合环境。控制平面组件始终在 Linux 上运行,而工作节点可以是 Linux 或 Windows。
架构概述
Kubernetes 中的 Windows 支持架构如下:
- Linux 控制平面:kube-apiserver、kube-controller-manager、kube-scheduler 和 etcd 始终在 Linux 上运行。
- Linux 工作节点:运行系统组件(CoreDNS、metrics-server 等)。
- Windows 工作节点:运行 Windows 应用程序工作负载。
Windows 节点组件
在 Windows 节点上运行的 Kubernetes 组件:
- kubelet:管理节点上的 Pod 和容器
- kube-proxy:管理网络规则
- CNI Plugin:网络配置
- CSI Plugin:存储管理
Windows 节点限制
在 Kubernetes 中使用 Windows 节点时,需要注意若干限制。
功能限制
- 特权容器:Windows 不支持特权容器。
- 主机网络模式:Windows Pod 无法使用主机网络模式。
- Pod 安全上下文:不支持部分安全上下文功能(runAsUser、fsGroup 等)。
- DaemonSet:在 Windows 节点上运行的 DaemonSet 需要特殊考虑。
- emptyDir 卷:Windows 不支持基于内存的 emptyDir 卷。
- 资源限制:CPU 限制在 Windows 上的应用方式不同。
网络限制
- 网络模式:Windows 仅支持 L3 网络。
- Service 类型:Windows 节点对某些 Service 类型存在限制。
- 负载均衡:某些负载均衡功能可能受限。
操作系统版本兼容性
Windows 容器与主机 OS 版本之间存在重要的兼容性注意事项:
| 容器基础镜像 | 兼容的主机 OS 版本 |
|---|---|
| Windows Server 2019 | Windows Server 2019 |
| Windows Server 2022 | Windows Server 2022 |
Hyper-V 隔离可以放宽这些限制,但需要额外资源。
Windows 节点设置
让我们了解将 Windows 节点添加到 Kubernetes 集群的过程。
前提条件
在设置 Windows 节点之前,请确认以下条件:
- Kubernetes 版本:1.14 或更高版本
- Windows 版本:Windows Server 2019 或更高版本
- 网络插件:支持 Windows 的 CNI 插件(Calico、Flannel 等)
- 容器运行时:Docker、containerd 等
准备 Windows 节点
准备 Windows 节点的步骤:
- 安装 Windows Server:安装 Windows Server 2019 或更高版本
- 启用容器功能:
Install-WindowsFeature -Name Containers
Restart-Computer -Force- 安装 Docker:
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name Docker -ProviderName DockerMsftProvider -Force
Restart-Computer -Force- 安装 Kubernetes 组件:
# Create directory
mkdir -p c:\k
# Download kubelet, kubeadm, kubectl
curl.exe -LO https://dl.k8s.io/v1.22.0/bin/windows/amd64/kubelet.exe
curl.exe -LO https://dl.k8s.io/v1.22.0/bin/windows/amd64/kubectl.exe
curl.exe -LO https://dl.k8s.io/v1.22.0/bin/windows/amd64/kube-proxy.exe
curl.exe -LO https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/wins.exe
# Move files to C:\k
mv kubelet.exe C:\k
mv kubectl.exe C:\k
mv kube-proxy.exe C:\k
mv wins.exe C:\k- 配置网络:
# Set firewall rules
New-NetFirewallRule -Name kubelet -DisplayName 'kubelet' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 10250
New-NetFirewallRule -Name https -DisplayName 'https' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 443
New-NetFirewallRule -Name http -DisplayName 'http' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 80使用 kubeadm 加入 Windows 节点
在 Linux 控制平面上生成加入令牌:
kubeadm token create --print-join-command在 Windows 节点上运行加入命令:
# Run kubeadm join command
kubeadm join <control-plane-host>:<control-plane-port> --token <token> --discovery-token-ca-cert-hash sha256:<hash>
# Register and start kubelet service
sc.exe create kubelet binPath= "C:\k\kubelet.exe --windows-service --kubeconfig=C:\k\config"
Start-Service kubelet设置 Windows 节点标签
在 Windows 节点上设置适当的标签以控制工作负载调度:
kubectl label node <windows-node-name> kubernetes.io/os=windows
kubectl label node <windows-node-name> kubernetes.io/arch=amd64部署 Windows 容器
让我们了解如何将 Windows 容器部署到 Kubernetes。
使用节点选择器
部署 Windows 工作负载时,使用节点选择器以确保它们被调度到 Windows 节点:
apiVersion: apps/v1
kind: Deployment
metadata:
name: iis-deployment
spec:
replicas: 2
selector:
matchLabels:
app: iis
template:
metadata:
labels:
app: iis
spec:
nodeSelector:
kubernetes.io/os: windows
containers:
- name: iis
image: mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019
resources:
limits:
cpu: 1
memory: 800Mi
requests:
cpu: .1
memory: 300Mi
ports:
- containerPort: 80资源请求和限制
Windows 容器的资源请求和限制与 Linux 容器的处理方式不同:
- CPU 限制:CPU 限制在 Windows 上的应用方式不同。例如,CPU 限制为 1 表示可以使用单个 CPU 核心的 100%。
- 内存限制:Windows 容器会遵守内存限制,但某些系统进程可能会导致额外开销。
容器自定义
在 Windows 容器中运行自定义脚本:
apiVersion: v1
kind: Pod
metadata:
name: windows-custom-script
spec:
nodeSelector:
kubernetes.io/os: windows
containers:
- name: windows-container
image: mcr.microsoft.com/windows/servercore:ltsc2019
command:
- powershell.exe
- -Command
- |
while ($true) {
Write-Host "Hello from Windows container"
Start-Sleep -Seconds 10
}多容器 Pod
Windows 也支持多容器 Pod,但存在一些限制:
apiVersion: v1
kind: Pod
metadata:
name: windows-multi-container
spec:
nodeSelector:
kubernetes.io/os: windows
containers:
- name: web
image: mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019
ports:
- containerPort: 80
- name: logger
image: mcr.microsoft.com/windows/servercore:ltsc2019
command:
- powershell.exe
- -Command
- |
while ($true) {
Get-Content -Path 'C:\inetpub\logs\LogFiles\W3SVC1\u_ex*' -Wait
}网络
Windows 节点上的网络与 Linux 节点具有不同的特性。
下图展示了具有混合 Windows 和 Linux 节点的 Kubernetes 集群的网络架构:
支持的网络插件
Windows 节点支持的网络插件:
- Flannel:VXLAN 或 host-gw 模式
- Calico:VXLAN 模式
- Antrea:基于 OVS 的网络
- Azure CNI:用于 Azure 环境
- AWS VPC CNI:用于 AWS 环境
Flannel 设置示例
使用 Flannel 设置 Windows 网络:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kube-flannel-ds-windows
namespace: kube-system
labels:
tier: node
app: flannel
spec:
selector:
matchLabels:
app: flannel
template:
metadata:
labels:
tier: node
app: flannel
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- windows
hostNetwork: true
containers:
- name: kube-flannel
image: sigwindowstools/flannel:v0.13.0
command:
- powershell
args:
- -file
- /opt/bin/flannel-host.ps1
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumeMounts:
- name: host-run
mountPath: /run
- name: cni
mountPath: /etc/cni/net.d
- name: flannel-cfg
mountPath: /etc/kube-flannel/
volumes:
- name: host-run
hostPath:
path: /run
- name: cni
hostPath:
path: /etc/cni/net.d
- name: flannel-cfg
configMap:
name: kube-flannel-cfg暴露 Service
如何在 Windows 节点上暴露 Service:
apiVersion: v1
kind: Service
metadata:
name: iis-service
spec:
selector:
app: iis
ports:
- port: 80
targetPort: 80
type: LoadBalancer网络策略
要在 Windows 节点上使用网络策略,您需要支持网络策略的 CNI 插件(例如 Calico):
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-frontend-to-backend
namespace: default
spec:
podSelector:
matchLabels:
app: backend
os: windows
ingress:
- from:
- podSelector:
matchLabels:
app: frontend
ports:
- protocol: TCP
port: 80存储
让我们了解 Windows 节点上可用的存储选项。
下图展示了 Windows 节点上可用的各种存储选项:
支持的卷类型
Windows 节点支持的卷类型:
- emptyDir:临时存储(不支持基于内存的 emptyDir)
- hostPath:主机节点文件系统
- configMap:配置数据
- secret:敏感数据
- azureFile:Azure File 存储
- awsElasticBlockStore:AWS EBS 卷
- azureDisk:Azure Disk 存储
- CSI:Container Storage Interface 驱动程序
emptyDir 卷示例
apiVersion: v1
kind: Pod
metadata:
name: windows-emptydir
spec:
nodeSelector:
kubernetes.io/os: windows
containers:
- name: windows-container
image: mcr.microsoft.com/windows/servercore:ltsc2019
volumeMounts:
- name: temp-volume
mountPath: C:\temp
command:
- powershell.exe
- -Command
- |
Set-Content -Path C:\temp\test.txt -Value "Hello from Windows"
while ($true) {
Get-Content -Path C:\temp\test.txt
Start-Sleep -Seconds 10
}
volumes:
- name: temp-volume
emptyDir: {}hostPath 卷示例
apiVersion: v1
kind: Pod
metadata:
name: windows-hostpath
spec:
nodeSelector:
kubernetes.io/os: windows
containers:
- name: windows-container
image: mcr.microsoft.com/windows/servercore:ltsc2019
volumeMounts:
- name: logs-volume
mountPath: C:\logs
command:
- powershell.exe
- -Command
- |
Set-Content -Path C:\logs\app.log -Value "Application log"
while ($true) {
Add-Content -Path C:\logs\app.log -Value "Log entry at $(Get-Date)"
Start-Sleep -Seconds 10
}
volumes:
- name: logs-volume
hostPath:
path: C:\k\logs
type: DirectoryOrCreateConfigMap 和 Secret 卷示例
apiVersion: v1
kind: ConfigMap
metadata:
name: windows-config
data:
config.json: |
{
"setting1": "value1",
"setting2": "value2"
}
---
apiVersion: v1
kind: Secret
metadata:
name: windows-secret
type: Opaque
data:
username: YWRtaW4= # admin
password: cGFzc3dvcmQ= # password
---
apiVersion: v1
kind: Pod
metadata:
name: windows-config-secret
spec:
nodeSelector:
kubernetes.io/os: windows
containers:
- name: windows-container
image: mcr.microsoft.com/windows/servercore:ltsc2019
volumeMounts:
- name: config-volume
mountPath: C:\config
- name: secret-volume
mountPath: C:\secret
command:
- powershell.exe
- -Command
- |
Get-Content -Path C:\config\config.json
Get-Content -Path C:\secret\username
Get-Content -Path C:\secret\password
while ($true) { Start-Sleep -Seconds 10 }
volumes:
- name: config-volume
configMap:
name: windows-config
- name: secret-volume
secret:
secretName: windows-secret使用 CSI 驱动程序
在 Windows 上使用 CSI 驱动程序的示例:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: windows-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: windows-csi
---
apiVersion: v1
kind: Pod
metadata:
name: windows-csi-pod
spec:
nodeSelector:
kubernetes.io/os: windows
containers:
- name: windows-container
image: mcr.microsoft.com/windows/servercore:ltsc2019
volumeMounts:
- name: data-volume
mountPath: C:\data
command:
- powershell.exe
- -Command
- |
Set-Content -Path C:\data\file.txt -Value "Persistent data"
while ($true) { Start-Sleep -Seconds 10 }
volumes:
- name: data-volume
persistentVolumeClaim:
claimName: windows-pvc监控和日志记录
让我们了解 Windows 节点和容器的监控与日志记录方法。
监控
用于监控 Windows 节点的工具:
- Prometheus Windows Exporter:收集 Windows 节点指标
- metrics-server:提供基本资源使用指标
- Datadog、Dynatrace、New Relic:商业监控解决方案
在 Windows 节点上安装 Prometheus Windows Exporter:
# Download Windows Exporter
Invoke-WebRequest -Uri https://github.com/prometheus-community/windows_exporter/releases/download/v0.16.0/windows_exporter-0.16.0-amd64.msi -OutFile windows_exporter.msi
# Install Windows Exporter
Start-Process msiexec.exe -ArgumentList '/i', 'windows_exporter.msi', 'ENABLED_COLLECTORS=cpu,memory,disk,net,service,os,system', '/quiet' -WaitPrometheus 配置:
scrape_configs:
- job_name: 'windows-nodes'
static_configs:
- targets: ['windows-node-1:9182', 'windows-node-2:9182']日志记录
用于收集 Windows 容器日志的工具:
- Fluent Bit:轻量级日志收集器
- Fluentd:日志收集和转发
- Elasticsearch:日志存储和搜索
- Azure Monitor:用于 Azure 环境
- CloudWatch Logs:用于 AWS 环境
在 Windows 节点上安装 Fluent Bit:
# Download Fluent Bit
Invoke-WebRequest -Uri https://fluentbit.io/releases/1.8/fluent-bit-1.8.11-win64.zip -OutFile fluent-bit.zip
# Extract
Expand-Archive -Path fluent-bit.zip -DestinationPath C:\fluent-bit
# Create configuration file
@"
[SERVICE]
Flush 5
Daemon Off
Log_Level info
[INPUT]
Name winlog
Channels Application,System,Security
[OUTPUT]
Name es
Match *
Host elasticsearch-host
Port 9200
Index windows_logs
"@ | Out-File -FilePath C:\fluent-bit\conf\fluent-bit.conf -Encoding ascii
# Register service
sc.exe create fluent-bit binPath= "C:\fluent-bit\bin\fluent-bit.exe -c C:\fluent-bit\conf\fluent-bit.conf"
Start-Service fluent-bit应用程序日志收集
收集 Windows 容器应用程序日志:
apiVersion: v1
kind: Pod
metadata:
name: windows-logging
spec:
nodeSelector:
kubernetes.io/os: windows
containers:
- name: iis
image: mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019
volumeMounts:
- name: logs
mountPath: C:\inetpub\logs\LogFiles
- name: log-collector
image: mcr.microsoft.com/windows/servercore:ltsc2019
command:
- powershell.exe
- -Command
- |
while ($true) {
Get-Content -Path 'C:\inetpub\logs\LogFiles\W3SVC1\u_ex*' -Wait
}
volumeMounts:
- name: logs
mountPath: C:\inetpub\logs\LogFiles
volumes:
- name: logs
emptyDir: {}安全性
让我们了解 Windows 节点和容器的安全注意事项。
Windows 节点安全性
Windows 节点安全性建议:
- 应用最新更新:定期应用 Windows 安全更新
- 防火墙配置:正确配置 Windows Defender Firewall
- 最小权限原则:仅授予必要的最小权限
- 防病毒软件:安装适当的防病毒软件
- 组策略:应用组策略以强化安全性
Windows 容器安全性
Windows 容器安全性建议:
- 最小基础镜像:使用尽可能小的基础镜像(Nano Server 等)
- 镜像扫描:扫描容器镜像中的漏洞
- ReadOnlyRootFilesystem:尽可能使用只读根文件系统
- 非特权用户:以非特权用户身份运行应用程序
- 网络策略:应用适当的网络策略
RunAsUsername
在 Windows 容器中,您可以使用 runAsUsername 而非 runAsUser 来指定在容器内运行的用户:
apiVersion: v1
kind: Pod
metadata:
name: windows-runasusername
spec:
nodeSelector:
kubernetes.io/os: windows
securityContext:
windowsOptions:
runAsUserName: "ContainerUser"
containers:
- name: windows-container
image: mcr.microsoft.com/windows/servercore:ltsc2019
command:
- powershell.exe
- -Command
- |
whoami
while ($true) { Start-Sleep -Seconds 10 }组托管服务帐户 (gMSA)
gMSA 用于 Windows 容器中 Active Directory 身份验证的配置:
- 在 Active Directory 中创建 gMSA:
# Create gMSA
New-ADServiceAccount -Name WebApp1 -DNSHostName WebApp1.contoso.com -ServicePrincipalNames http/WebApp1.contoso.com -PrincipalsAllowedToRetrieveManagedPassword "Domain Controllers", "Domain Computers"- 在 Kubernetes 中存储 gMSA 凭证:
apiVersion: v1
kind: Secret
metadata:
name: gmsa-cred-spec
type: microsoft.com/gmsa-credential-spec
data:
credspec.json: <base64-encoded-credential-spec>- 将 gMSA 配置应用于 Pod:
apiVersion: v1
kind: Pod
metadata:
name: windows-gmsa
spec:
nodeSelector:
kubernetes.io/os: windows
securityContext:
windowsOptions:
gmsaCredentialSpecName: gmsa-cred-spec
containers:
- name: windows-container
image: mcr.microsoft.com/windows/servercore:ltsc2019
command:
- powershell.exe
- -Command
- |
whoami
while ($true) { Start-Sleep -Seconds 10 }Amazon EKS 中的 Windows 支持
让我们了解如何在 Amazon EKS 中运行 Windows 工作负载。
下图展示了 Amazon EKS 中的 Windows 支持架构:
在 EKS 中启用 Windows 支持
在 Amazon EKS 中启用 Windows 支持的步骤:
- 更新 VPC CNI Plugin:
kubectl apply -f https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/release-1.11/config/master/vpc-resource-controller.yaml- 安装 Windows VPC Admission Webhook:
kubectl apply -f https://raw.githubusercontent.com/aws/amazon-vpc-cni-k8s/release-1.11/config/master/vpc-admission-webhook.yaml创建 Windows 节点组
使用 eksctl 创建 Windows 节点组:
eksctl create nodegroup \
--cluster my-cluster \
--region us-west-2 \
--name windows-ng \
--node-type t3.large \
--nodes 2 \
--nodes-min 1 \
--nodes-max 4 \
--managed \
--node-ami-family WindowsServer2019FullContainer使用 AWS Management Console 创建 Windows 节点组:
- 在 EKS 控制台中选择集群
- 选择“Compute”选项卡
- 单击“Add node group”
- 输入节点组详细信息
- 选择“Windows”作为 AMI 类型
- 配置其余设置并创建
在 EKS 中部署 Windows 应用程序
在 EKS 中部署 Windows 应用程序的示例:
apiVersion: apps/v1
kind: Deployment
metadata:
name: windows-server-iis
spec:
selector:
matchLabels:
app: windows-server-iis
tier: backend
track: stable
replicas: 2
template:
metadata:
labels:
app: windows-server-iis
tier: backend
track: stable
spec:
nodeSelector:
kubernetes.io/os: windows
containers:
- name: windows-server-iis
image: mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019
ports:
- name: http
containerPort: 80
resources:
limits:
cpu: 1
memory: 800Mi
requests:
cpu: .1
memory: 300Mi
---
apiVersion: v1
kind: Service
metadata:
name: windows-server-iis-service
labels:
app: windows-server-iis
spec:
ports:
- port: 80
protocol: TCP
selector:
app: windows-server-iis
type: LoadBalancerEKS 中的 Windows 容器日志记录
使用 CloudWatch Logs 收集 Windows 容器日志:
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-config
namespace: amazon-cloudwatch
data:
fluent-bit.conf: |
[SERVICE]
Flush 5
Log_Level info
Daemon off
[INPUT]
Name tail
Tag kube.*
Path /var/log/containers/*.log
Parser docker
DB /var/fluent-bit/state/flb_container.db
Mem_Buf_Limit 50MB
[FILTER]
Name kubernetes
Match kube.*
Kube_URL https://kubernetes.default.svc:443
Merge_Log On
[OUTPUT]
Name cloudwatch_logs
Match kube.*
region us-west-2
log_group_name /aws/eks/my-cluster/windows-logs
log_stream_prefix windows-
auto_create_group true最佳实践
让我们了解在 Kubernetes 中运行 Windows 工作负载的最佳实践。
集群设计最佳实践
- 混合节点池:适当混合使用 Linux 和 Windows 节点
- 节点标签和 Taint:使用适当的节点标签和 Taint 分隔工作负载
- 版本兼容性:验证 Kubernetes 版本与 Windows 版本之间的兼容性
- 网络插件选择:选择支持 Windows 的适当网络插件
- 高可用性:为关键工作负载配置高可用性
应用程序设计最佳实践
- 容器镜像优化:使用小巧高效的容器镜像
- 资源请求和限制:设置适当的资源请求和限制
- 无状态设计:尽可能设计无状态应用程序
- 日志记录和监控:配置有效的日志记录和监控
- 安全强化:应用适当的安全上下文和网络策略
运维最佳实践
- 定期更新:定期更新 Windows 节点和容器镜像
- 自动化:自动化部署和管理任务
- 备份和恢复:定期备份重要数据
- 故障排除工具:构建适当的故障排除工具和流程
- 文档:记录配置和流程
EKS 特定最佳实践
- 托管节点组:尽可能使用托管节点组
- IAM Roles for Service Accounts (IRSA):按 Pod 管理 IAM 权限
- VPC CNI 配置:根据网络需求配置 VPC CNI
- 安全组:配置适当的安全组
- 成本优化:选择适当的实例类型和大小
结论
Kubernetes 中的 Windows 支持不断演进,现在您可以在生产环境中运行 Windows 工作负载。Windows 节点可以与 Linux 节点在同一集群中并行运行,使您能够在单个 Kubernetes 集群中管理多样化的工作负载。
Windows 容器使 .NET Framework 应用程序、Windows 服务和其他 Windows 特定工作负载能够容器化,从而利用 Kubernetes 编排功能。然而,与 Linux 容器相比仍存在一些限制,因此务必适当地了解并解决这些限制。
Amazon EKS 为 Windows 节点提供托管服务,可轻松部署和管理 Windows 工作负载。利用 EKS 的 Windows 支持,可以简化将 Windows 应用程序迁移到现代容器环境的过程。
要在 Kubernetes 中成功实施 Windows,遵循适当的规划、设计和运维最佳实践至关重要。这使您能够高效地管理 Windows 和 Linux 工作负载,并充分利用 Kubernetes 的所有优势。
测验
要测试您在本章中学到的内容,请尝试 Kubernetes 中的 Windows 测验。




