Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/validate-windows-binary-signature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ on:
- 'vhdbuilder/packer/windows/components_json_helpers.ps1'

jobs:
check-files-for-ws2019:
name: Check for Windows 2019
runs-on: windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@v6
- name: Run check script for 2019-containerd
shell: powershell
run: |
./vhdbuilder/packer/test/windows-files-check.ps1 2019-containerd

check-files-for-ws2022:
name: Check for Windows 2022
runs-on: windows-latest
Expand Down
1 change: 0 additions & 1 deletion .pipelines/.vsts-Marketpalce-win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ stages:
- template: ./templates/.builder-Marketplace-win-template.yaml
parameters:
artifactName: 2019-containerd
# Marketplace?
2 changes: 2 additions & 0 deletions .pipelines/.vsts-vhd-builder-pr-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ stages:
useOverrides: False
enableBackfillCleanup: True
buildVmSize: Standard_D16ds_v5
# 2019 only supports gen1, so build that for PRs
build2019containerd: True
# 2022 gen1 is the default, so build that for PRs
build2022containerd: True
build2022containerdgen2: False
Expand Down
5 changes: 5 additions & 0 deletions .pipelines/.vsts-vhd-builder-release-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ variables:
value: ${{ variables.SKIP_EXTENSION_CHECK }}

parameters:
- name: build2019containerd
displayName: Build 2019 containerd
type: boolean
default: True
- name: build2022containerd
displayName: Build 2022 containerd
type: boolean
Expand Down Expand Up @@ -102,6 +106,7 @@ stages:
vhddebug: ${{ parameters.vhddebug }}
dryrun: ${{ parameters.dryrun }}
buildVmSize: ${{ parameters.buildVmSize }}
build2019containerd: ${{ parameters.build2019containerd }}
build2022containerd: ${{ parameters.build2022containerd }}
build2022containerdgen2: ${{ parameters.build2022containerdgen2 }}
build23H2: ${{ parameters.build23H2 }}
Expand Down
26 changes: 26 additions & 0 deletions .pipelines/templates/.build-and-test-windows-vhds-template.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
parameters:
- name: build2019containerd
displayName: Build 2019 containerd
type: boolean
- name: build2022containerd
displayName: Build 2022 containerd
type: boolean
Expand Down Expand Up @@ -78,6 +81,29 @@ stages:
inputs:
artifactName: windows-cse-package
targetPath: ${{ parameters.csePublishDir }}
- template: ./.build-and-test-windows-vhd-template.yaml
parameters:
stageName: win_2019_v1
artifactName: 2019-containerd
imageName: windows-2019-containerd
windowsSku: 2019-containerd
hyperVGeneration: V1
architecture: X86_64
build: ${{ parameters.build2019containerd }}
vhddebug: ${{ parameters.vhddebug }}
dryrun: ${{ parameters.dryrun }}
buildVmSize: ${{ parameters.buildVmSize }}
installOpenSshServer: ${{ parameters.installOpenSshServer }}
skipExtensionCheck: ${{ parameters.skipExtensionCheck }}
windowsBaseImageUrl: $(WINDOWS_2019_BASE_IMAGE_URL)
windowsNanoImageUrl: $(WINDOWS_2019_NANO_IMAGE_URL)
windowsCoreImageUrl: $(WINDOWS_2019_CORE_IMAGE_URL)
windowsContainerImageJsonUrl: ${{ parameters.windowsContainerImageJsonUrl }}
overrideBranch: ${{ parameters.overrideBranch }}
useOverrides: ${{ parameters.useOverrides }}
csePackageDir: ${{ parameters.csePublishDir }}
cseFileName: ${{ parameters.cseFileName }}

- template: ./.build-and-test-windows-vhd-template.yaml
parameters:
stageName: win_2022_v1
Expand Down
19 changes: 19 additions & 0 deletions e2e/components/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import (
"github.com/stretchr/testify/require"
)

// this is mostly for WS2019 - as WS2019 doesn't support anything after 1.32.
func TestVersion1_32IsCached(t *testing.T) {
version := GetKubeletVersionByMinorVersion("v1.32")
require.NotEmpty(t, version)
}

func TestImagesAreFullySpecified(t *testing.T) {
images := GetWindowsContainerImages("mcr.microsoft.com/windows/servercore:*", "2025-gen2")
tags := getWindowsContainerImageTags("mcr.microsoft.com/windows/servercore:*", "2025-gen2")
Expand Down Expand Up @@ -88,6 +94,18 @@ func TestWs2022NanoserverGen2(t *testing.T) {
require.Len(t, serverCoreVersions, 1)
}

func TestWs2019ServerCore(t *testing.T) {
serverCoreVersions := GetWindowsContainerImages("mcr.microsoft.com/windows/servercore:*", "2019-containerd")
t.Logf("found servercore version %v", serverCoreVersions)
require.Len(t, serverCoreVersions, 2)
}

func TestWs2019Nanoserver(t *testing.T) {
serverCoreVersions := GetWindowsContainerImages("mcr.microsoft.com/windows/nanoserver:*", "2019-containerd")
t.Logf("found servercore version %v", serverCoreVersions)
require.Len(t, serverCoreVersions, 1)
}

func TestWindowsImagesHaveServercoreAndNanoserverSpecified(t *testing.T) {
// This test ensures that all Windows images have the servercore tag specified.
// If this test fails, it means that a new Windows image has been added without the servercore tag.
Expand All @@ -99,6 +117,7 @@ func TestWindowsImagesHaveServercoreAndNanoserverSpecified(t *testing.T) {
config.VHDWindows23H2Gen2,
config.VHDWindows2025,
config.VHDWindows2025Gen2,
config.VHDWindows2019Containerd,
}

for _, image := range windowsImages {
Expand Down
8 changes: 8 additions & 0 deletions e2e/config/vhd.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ var (
OSDiskSizeGB: 60,
}

VHDWindows2019Containerd = &Image{
Name: "windows-2019-containerd",
OS: "windows",
Arch: "amd64",
Distro: datamodel.AKSWindows2019Containerd,
Gallery: imageGalleryWindows,
}

VHDWindows2022Containerd = &Image{
Name: "windows-2022-containerd",
OS: "windows",
Expand Down
49 changes: 49 additions & 0 deletions e2e/scenario_win_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ func DualStackConfigMutator(configuration *datamodel.NodeBootstrappingConfigurat
properties.FeatureFlags.EnableIPv6DualStack = true
}

func Windows2019BootstrapConfigMutator(t *testing.T, configuration *datamodel.NodeBootstrappingConfiguration) {
// 2019 is not supported in 1.33+
version := components.GetKubeletVersionByMinorVersion("v1.32")
require.NotEmpty(t, version)
configuration.ContainerService.Properties.OrchestratorProfile.OrchestratorVersion = components.RemoveLeadingV(version)
}

func Windows2025BootstrapConfigMutator(t *testing.T, configuration *datamodel.NodeBootstrappingConfiguration) {
// 2025 supported in 1.32+ - a kubelet bug impacts networking in most of 1.32 and 1.33.0, .1
version := components.GetKubeletVersionByMinorVersion("v1.33")
Expand Down Expand Up @@ -50,6 +57,29 @@ func DualStackVMConfigMutator(set *armcompute.VirtualMachineScaleSet) {
}
}

// WS2019 doesn't support IPv6, so we don't test it with dual-stack.
func Test_Windows2019AzureNetwork(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Windows Server 2019 Azure Network",
Config: Config{
Cluster: ClusterAzureNetwork,
VHD: config.VHDWindows2019Containerd,
VMConfigMutator: EmptyVMConfigMutator,
BootstrapConfigMutator: func(configuration *datamodel.NodeBootstrappingConfiguration) {
Windows2019BootstrapConfigMutator(t, configuration)
},
Validator: func(ctx context.Context, s *Scenario) {
ValidateWindowsVersionFromWindowsSettings(ctx, s, "2019-containerd")
ValidateWindowsProductName(ctx, s, "Windows Server 2019 Datacenter")
ValidateFileHasContent(ctx, s, "/k/kubeletstart.ps1", "--container-runtime=remote")
ValidateWindowsProcessHasCliArguments(ctx, s, "kubelet.exe", []string{"--rotate-certificates=true", "--client-ca-file=c:\\k\\ca.crt"})
ValidateCiliumIsNotRunningWindows(ctx, s)
ValidateFileHasContent(ctx, s, "/AzureData/CustomDataSetupScript.log", "CSEScriptsPackageUrl used for provision is https://packages.aks.azure.com/aks/windows/cse/aks-windows-cse-scripts-current.zip")
},
},
})
}

func Test_Windows2022_AzureNetwork(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Windows Server 2022 Azure Network",
Expand Down Expand Up @@ -256,6 +286,25 @@ func Test_Windows2022CachingRegression(t *testing.T) {
})
}

func Test_Windows2019CachingRegression(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Windows 2019 VHD built before local cache enabled should still work - overwrite the CSE scripts package URL",
Config: Config{
Cluster: ClusterAzureNetwork,
VHD: config.VHDWindows2019Containerd,
VMConfigMutator: EmptyVMConfigMutator,
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
nbc.ContainerService.Properties.WindowsProfile.CseScriptsPackageURL = "https://packages.aks.azure.com/aks/windows/cse/aks-windows-cse-scripts-v0.0.52.zip"
// Secure TLS Bootstrapping isn't supported on this CSE script package version
nbc.SecureTLSBootstrappingConfig.Enabled = false
},
Validator: func(ctx context.Context, s *Scenario) {
ValidateFileHasContent(ctx, s, "/AzureData/CustomDataSetupScript.log", "CSEScriptsPackageUrl used for provision is https://packages.aks.azure.com/aks/windows/cse/aks-windows-cse-scripts-v0.0.52.zip")
},
},
})
}

func Test_Windows2025(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Windows Server 2025 with Containerd",
Expand Down
33 changes: 33 additions & 0 deletions parts/common/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
"amd64OnlyVersions": [],
"multiArchVersionsV2": [],
"windowsVersions": [
{
"comment": "Windows 2019 servercore. Should have latest version and latest version -1",
"renovateTag": "registry=https://mcr.microsoft.com, name=windows/servercore",
"latestVersion": "10.0.17763.8389",
"previousLatestVersion": "10.0.17763.8276",
"windowsSkuMatch": "2019-containerd"
},
{
"comment": "this will be cached in the previous step, we really just want to download the tag",
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "ltsc2019",
"windowsSkuMatch": "2019-containerd"
},
{
"comment": "Windows 2022 servercore. Should have latest version and latest version -1",
"renovateTag": "registry=https://mcr.microsoft.com, name=windows/servercore",
Expand Down Expand Up @@ -64,6 +77,12 @@
"amd64OnlyVersions": [],
"multiArchVersionsV2": [],
"windowsVersions": [
{
"comment": "1809 gets patches every 6 months or so. The alternative is ltsc2019 which gets patches every couple of years. Most customers use 1809, so we keep that on the VHD",
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "1809",
"windowsSkuMatch": "2019-containerd"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=windows/nanoserver",
"latestVersion": "ltsc2022",
Expand Down Expand Up @@ -1170,6 +1189,20 @@
}
},
"windows": {
"ws2019": {
"versionsV2": [
{
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "v1.6.35-azure.1"
},
{
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "v1.7.20-azure.1",
"previousLatestVersion": "v1.7.17-azure.1"
}
],
"downloadURL": "https://packages.aks.azure.com/containerd/windows/${version}/binaries/containerd-${version}-windows-amd64.tar.gz"
},
"ws2022": {
"versionsV2": [
{
Expand Down
1 change: 1 addition & 0 deletions schemas/components.cue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ package components

#WindowsOsDistro: {
default?: #ReleaseDownloadURI
ws2019?: #ReleaseDownloadURI
ws2022?: #ReleaseDownloadURI
ws23h2?: #ReleaseDownloadURI
ws2025?: #ReleaseDownloadURI
Expand Down
6 changes: 4 additions & 2 deletions schemas/windows_settings.cue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

#WindowsComments: [...string]


#WindowsBaseVersions: {
"2019-containerd": #WindowsBaseVersion
"2022-containerd": #WindowsBaseVersion
"2022-containerd-gen2": #WindowsBaseVersion
"23H2": #WindowsBaseVersion
Expand All @@ -49,5 +51,5 @@
WindowsRegistryKeys: #WindowsRegistryKeys
WindowsBaseVersions: #WindowsBaseVersions
}

#WindowsSettings
#WindowsSettings
14 changes: 14 additions & 0 deletions vhdbuilder/packer/windows/components-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,20 @@
"windowsDownloadLocation": "c:\\akse-cache\\containerd\\",
"downloadURIs": {
"windows": {
"ws2019": {
"versionsV2": [
{
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "v1.6.35-azure.1"
},
{
"renovateTag": "<DO_NOT_UPDATE>",
"latestVersion": "v1.7.20-azure.1",
"previousLatestVersion": "v1.7.17-azure.1"
}
],
"downloadURL": "https://acs-mirror.azureedge.net/containerd/windows/${version}/binaries/containerd-${version}-windows-amd64.tar.gz"
},
"ws2022": {
"versionsV2": [
{
Expand Down
Loading
Loading