Elastic Container Instance (ECI) supports Windows-based instances. If your containers require a Windows environment, you can add a Windows virtual node to your cluster and schedule Pods to it. This action creates Windows-based ECI Pods (ECI instances) to run your containers.
Windows instances are in invitational preview. To use this feature, submit a ticket.
Prerequisites
The version of Virtual Kubelet (the ACK Virtual Node component) in your cluster is v2.11.0-rc.0 or later. For more information, see Manage components and ACK Virtual Node.
Limitations
-
When you create a Windows-based ECI instance, the instance type must have at least 2 vCPUs and 4 GiB of memory. GPU-accelerated instance types, instance types with local disks, and ARM-based instance types are not supported.
-
The Windows container image version must be 10.0.20348.* (Windows Server 2022).
Add a Windows virtual node
To add a Windows virtual node to your cluster, modify the eci-profile.
-
Modify the eci-profile.
kubectl edit -n kube-system cm/eci-profileIn the data section of the eci-profile, set enableWindowsAmd64Node to "true". The following example shows the configuration:
data: ...... enableWindowsAmd64Node: "true" # Enable the Windows node. ...... -
Verify that the Windows virtual node is created.
kubectl get nodes -l kubernetes.io/os=windowsThe output confirms that the Windows virtual nodes were automatically created in the cluster.
kubectl get nodes -l kubernetes.io/os=windows NAME STATUS ROLES AGE VERSION virtual-kubelet-cn-beijing-g-windows-amd64 Ready agent 34s v1.28.3-aliyun.1 virtual-kubelet-cn-beijing-h-windows-amd64 Ready agent 34s v1.28.3-aliyun.1
Create a Windows Pod
Windows virtual nodes have the "kubernetes.io/os": windows label. Use a nodeSelector to schedule the Pod to a Windows virtual node. This action creates a Windows-based ECI Pod to run your containers.
nodeSelector:
kubernetes.io/os: windows
Example YAML:
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-windows
labels:
app: test
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
name: nginx-test
labels:
app: nginx
alibabacloud.com/eci: "true"
annotations:
k8s.aliyun.com/eci-with-eip: "true" # Associate an Elastic IP Address (EIP) to pull public images.
k8s.aliyun.com/eci-use-specs: "ecs.c6.4xlarge" # Specify the instance type.
spec:
containers:
- name: test
image: mcr.microsoft.com/windows/nanoserver:ltsc2022 # Use a Windows container image.
command: ["ping","-t","localhost" ]
nodeSelector:
kubernetes.io/os: windows # Schedule the Pod to the Windows virtual node.