Deploy workloads in Windows node pools

更新时间:
复制 MD 格式

Build a Docker image of your Windows application and push it to a container registry. After creating a Windows node pool in your Container Service for Kubernetes (ACK) cluster, deploy the image onto Windows nodes.

Choose a base image

Select a Windows base image based on your application's dependencies and performance requirements:

Base imageBest for
Windows Server CoreApplications that depend on Win32 APIs or the full .NET Framework
Nano ServerApplications with minimal system library dependencies (for example, .NET Core apps)
PowerShellScripts and lightweight automation tasks
Match the base image OS version to your node pool's Windows Server version. Use ltsc2019 for Windows Server 2019 nodes and ltsc2022 for Windows Server 2022 nodes.

Step 1: Build an image and push it to a container registry

Convert your application into a custom Windows container image, then push it to Alibaba Cloud Container Registry so your ACK cluster can pull it during deployment.

The following example uses Windows Server Core as the base image. The image includes an executable file test.exe and a PowerShell script hello.ps1. PowerShell scripts are commonly used during Windows application deployment for preprocessing and initialization tasks, such as configuring environment variables and copying files.

# Use Windows Server Core as the base image
FROM mcr.microsoft.com/windows/servercore:ltsc2019

# Set the working directory
WORKDIR /app

# Copy local files into the container
COPY test.exe .
COPY hello.ps1 .

# Run the PowerShell script
CMD ["powershell.exe", "./hello.ps1"]

Build the image by running docker build, then push it to your container registry by following Use Container Registry Enterprise Edition instances to build images.

Once pushed, future deployments pull the image directly from Container Registry without rebuilding.

Step 2: Create a node pool

Create a Windows node pool to manage your Windows nodes at the pool level, including node upgrades and scaling. Follow the steps in Create a Windows node pool.

Step 3: Deploy the application

For a complete deployment walkthrough, see Create a Windows application.

What's next