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
28 changes: 28 additions & 0 deletions .pipelines/.vsts-vhd-builder-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ parameters:
displayName: Build Flatcar Gen2 ARM64
type: boolean
default: true
- name: buildacltlgen2
displayName: Build ACL TL Gen2
type: boolean
default: true

variables:
- name: MODE
Expand Down Expand Up @@ -846,6 +850,30 @@ stages:
useOverrides: ${{ parameters.useOverrides }}
overrideBranch: ${{ parameters.overrideBranch }}
artifactName: flatcar-gen2-arm64
- job: buildacltlgen2
condition: eq('${{ parameters.buildacltlgen2 }}', true)
dependsOn: [ ]
timeoutInMinutes: 360
steps:
- bash: |
echo '##vso[task.setvariable variable=OS_SKU]AzureContainerLinux'
echo '##vso[task.setvariable variable=OS_VERSION]acl'
echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2'
echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5'
echo '##vso[task.setvariable variable=FEATURE_FLAGS]None'
echo '##vso[task.setvariable variable=ARCHITECTURE]X86_64'
echo '##vso[task.setvariable variable=ENABLE_FIPS]false'
echo '##vso[task.setvariable variable=ENABLE_TRUSTED_LAUNCH]True'
echo '##vso[task.setvariable variable=ENABLE_CGROUPV2]True'
echo '##vso[task.setvariable variable=SIG_SOURCE_GALLERY_UNIQUE_NAME]035db282-f1c8-4ce7-b78f-2a7265d5398c-ACLDEVEL'
echo '##vso[task.setvariable variable=SIG_SOURCE_IMAGE_NAME]acl'
echo '##vso[task.setvariable variable=SIG_SOURCE_IMAGE_VERSION]0.20260227.1058781'
displayName: Setup Build Variables
- template: ./templates/.builder-release-template.yaml
parameters:
useOverrides: ${{ parameters.useOverrides }}
overrideBranch: ${{ parameters.overrideBranch }}
artifactName: acl-tl-gen2
- job: build2404arm64gb200gen2containerd
condition: eq('${{ parameters.build2404arm64gb200gen2containerd }}', true)
dependsOn: [ ]
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/.builder-release-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ steps:
if grep -q "cvm" <<< "$FEATURE_FLAGS"; then SKU_NAME="${SKU_NAME}CVM"; fi && \
if [[ "${IMG_SKU}" == *"minimal"* ]]; then SKU_NAME="${SKU_NAME}minimal"; fi && \
if [[ "${ENABLE_TRUSTED_LAUNCH}" == "True" ]]; then SKU_NAME="${SKU_NAME}TL"; fi && \
if [[ ${OS_SKU} != "CBLMariner" && ${OS_SKU} != "AzureLinux" && ${OS_SKU} != "AzureLinuxOSGuard" && ${OS_SKU} != "Flatcar" ]]; then SKU_NAME="${SKU_NAME}containerd"; fi && \
if [[ ${OS_SKU} != "CBLMariner" && ${OS_SKU} != "AzureLinux" && ${OS_SKU} != "AzureLinuxOSGuard" && ${OS_SKU} != "Flatcar" && ${OS_SKU} != "AzureContainerLinux" ]]; then SKU_NAME="${SKU_NAME}containerd"; fi && \
SKU_NAME=$(echo ${SKU_NAME} | tr -d '.') && \
echo "##vso[task.setvariable variable=SKU_NAME]$SKU_NAME"
echo "Set SKU_NAME to $SKU_NAME"
Expand Down
11 changes: 11 additions & 0 deletions e2e/config/vhd.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var (
OSMariner OS = "mariner"
OSAzureLinux OS = "azurelinux"
OSFlatcar OS = "flatcar"
OSACL OS = "acl"
)

var (
Expand Down Expand Up @@ -217,6 +218,16 @@ var (
OSDiskSizeGB: 60,
}

VHDACLGen2TL = &Image{
Name: "aclgen2TL",
OS: OSACL,
Arch: "amd64",
Distro: datamodel.AKSACLGen2TL,
Gallery: imageGalleryLinux,
Flatcar: true,
OSDiskSizeGB: 60,
}

VHDWindows2019Containerd = &Image{
Name: "windows-2019-containerd",
OS: "windows",
Expand Down
2 changes: 1 addition & 1 deletion e2e/node_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func nbcToAKSNodeConfigV1(nbc *datamodel.NodeBootstrappingConfiguration) *aksnod
return &aksnodeconfigv1.Configuration{
Version: "v1",
BootstrappingConfig: bootstrappingConfig,
DisableCustomData: nbc.AgentPoolProfile.IsFlatcar(),
DisableCustomData: nbc.AgentPoolProfile.IsFlatcar() || nbc.AgentPoolProfile.IsACL(),
LinuxAdminUsername: "azureuser",
VmSize: config.Config.DefaultVMSKU,
ClusterConfig: &aksnodeconfigv1.ClusterConfig{
Expand Down
169 changes: 169 additions & 0 deletions e2e/scenario_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,175 @@ func Test_Flatcar_SecureTLSBootstrapping_BootstrapToken_Fallback(t *testing.T) {
})
}

func Test_ACL(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Tests that a node using an ACL VHD can be properly bootstrapped",
Config: Config{
Cluster: ClusterKubenet,
VHD: config.VHDACLGen2TL,
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
},
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
},
Validator: func(ctx context.Context, s *Scenario) {
ValidateFileHasContent(ctx, s, "/etc/os-release", "ID=acl")
ValidateFileExists(ctx, s, "/etc/ssl/certs/ca-certificates.crt")
},
},
})
}

func Test_ACL_Scriptless(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Tests that a node using ACL and the self-contained installer can be properly bootstrapped",
Config: Config{
Cluster: ClusterKubenet,
VHD: config.VHDACLGen2TL,
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
},
Validator: func(ctx context.Context, s *Scenario) {
ValidateFileHasContent(ctx, s, "/var/log/azure/aks-node-controller.log", "aks-node-controller finished successfully")
},
AKSNodeConfigMutator: func(config *aksnodeconfigv1.Configuration) {
},
},
})
}

func Test_ACL_CustomCATrust(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Tests that a node using an ACL VHD can be properly bootstrapped and custom CA was correctly added",
Config: Config{
Cluster: ClusterKubenet,
VHD: config.VHDACLGen2TL,
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
},
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
nbc.CustomCATrustConfig = &datamodel.CustomCATrustConfig{
CustomCATrustCerts: []string{
encodedTestCert,
},
}
},
Validator: func(ctx context.Context, s *Scenario) {
// ACL uses Azure Linux CA trust paths under /etc (read-only /usr via dm-verity)
ValidateNonEmptyDirectory(ctx, s, "/etc/pki/ca-trust/source/anchors")
},
},
})
}

func Test_ACL_AzureCNI(t *testing.T) {
RunScenario(t, &Scenario{
Description: "ACL scenario on a cluster configured with Azure CNI",
Config: Config{
Cluster: ClusterAzureNetwork,
VHD: config.VHDACLGen2TL,
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
},
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
nbc.ContainerService.Properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin = string(armcontainerservice.NetworkPluginAzure)
nbc.AgentPoolProfile.KubernetesConfig.NetworkPlugin = string(armcontainerservice.NetworkPluginAzure)
},
},
})
}

func Test_ACL_AzureCNI_ChronyRestarts(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Test ACL scenario on a cluster configured with Azure CNI and the chrony service restarts if it is killed",
Config: Config{
Cluster: ClusterAzureNetwork,
VHD: config.VHDACLGen2TL,
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
},
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
nbc.ContainerService.Properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin = string(armcontainerservice.NetworkPluginAzure)
nbc.AgentPoolProfile.KubernetesConfig.NetworkPlugin = string(armcontainerservice.NetworkPluginAzure)
},
Validator: func(ctx context.Context, s *Scenario) {
ServiceCanRestartValidator(ctx, s, "chronyd", 10)
ValidateFileHasContent(ctx, s, "/etc/systemd/system/chronyd.service.d/10-chrony-restarts.conf", "Restart=always")
ValidateFileHasContent(ctx, s, "/etc/systemd/system/chronyd.service.d/10-chrony-restarts.conf", "RestartSec=5")
},
},
})
}

func Test_ACL_SecureTLSBootstrapping_BootstrapToken_Fallback(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Tests that a node using an ACL VHD can be properly bootstrapped even if secure TLS bootstrapping fails",
Tags: Tags{
BootstrapTokenFallback: true,
},
Config: Config{
Cluster: ClusterKubenet,
VHD: config.VHDACLGen2TL,
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
},
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{
Enabled: true,
Deadline: (10 * time.Second).String(),
UserAssignedIdentityID: "invalid", // use an unexpected user-assigned identity ID to force a secure TLS bootstrapping failure
}
},
},
})
}

func Test_ACL_AzureCNI_ChronyRestarts_Scriptless(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Test ACL scenario on a cluster configured with Azure CNI and the chrony service restarts if it is killed",
Tags: Tags{
Scriptless: true,
},
Config: Config{
Cluster: ClusterAzureNetwork,
VHD: config.VHDACLGen2TL,
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
},
AKSNodeConfigMutator: func(config *aksnodeconfigv1.Configuration) {
config.NetworkConfig.NetworkPlugin = aksnodeconfigv1.NetworkPlugin_NETWORK_PLUGIN_AZURE
},
Validator: func(ctx context.Context, s *Scenario) {
ServiceCanRestartValidator(ctx, s, "chronyd", 10)
ValidateFileHasContent(ctx, s, "/etc/systemd/system/chronyd.service.d/10-chrony-restarts.conf", "Restart=always")
ValidateFileHasContent(ctx, s, "/etc/systemd/system/chronyd.service.d/10-chrony-restarts.conf", "RestartSec=5")
},
},
})
}

func Test_ACL_DisableSSH(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Tests that a node using ACL VHD with SSH disabled can be properly bootstrapped and SSH daemon is disabled",
Config: Config{
Cluster: ClusterKubenet,
VHD: config.VHDACLGen2TL,
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
},
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
nbc.SSHStatus = datamodel.SSHOff
},
SkipSSHConnectivityValidation: true, // Skip SSH connectivity validation since SSH is down
SkipDefaultValidation: true, // Skip default validation since it requires SSH connectivity
Validator: func(ctx context.Context, s *Scenario) {
// Validate SSH daemon is disabled via RunCommand
ValidateSSHServiceDisabled(ctx, s)
},
},
})
}

func Test_AzureLinuxV3_SecureTLSBootstrapping_BootstrapToken_Fallback(t *testing.T) {
RunScenario(t, &Scenario{
Description: "Tests that a node using a AzureLinuxV3 Gen2 VHD can be properly bootstrapped even if secure TLS bootstrapping fails",
Expand Down
17 changes: 12 additions & 5 deletions e2e/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -1867,19 +1867,26 @@ func ValidateKernelLogs(ctx context.Context, s *Scenario) {
pattern string
exclude string // optional pattern to exclude false positives
}
// sr[0-9] is the virtual CD-ROM drive on Azure VMs. This error occurs when the VM tries to read from an empty virtual optical drive, which is normal and expected.
// "Shutdown timeout set to" is an informational message from the NVMe driver during initialization, not an error.
ioFSExclude := `sr[0-9]|Shutdown timeout set to`
if s.VHD != nil && s.VHD.OS == config.OSACL {
// ACL-only: exclude benign BTRFS udev race warnings ("duplicate device") and loop device I/O errors
// from sysext squashfs read-ahead overshooting the backing file boundary.
ioFSExclude += `|duplicate device|loop[0-9]`
}

patterns := map[string]categoryPattern{
"PANIC/CRASH": {
pattern: `(kernel: )?(panic|oops|call trace|backtrace|general protection fault|BUG:|RIP:)`,
// exclude boot parameter logs like "Kernel command line: ... panic=-1 ...", which are normal and not indicative of a kernel panic
exclude: `panic=`,
// exclude boot parameters like "panic=-1" and dm-verity's "panic-on-corruption" (used by ACL for verified boot)
exclude: `panic[-=]`,
},
"LOCKUP/STALL": {pattern: `(soft|hard) lockup|rcu.*(stall|detected stalls)|hung task|watchdog.*(detected|stuck)`},
"MEMORY": {pattern: `oom[- ]killer|Out of memory:|page allocation failure|memory corruption`},
"IO/FS": {
pattern: `I/O error|read-only file system|EXT[2-4]-fs error|XFS.*(ERROR|error|corruption)|BTRFS.*(error|warning)|nvme .* (timeout|reset)|ata[0-9].*(failed|error|reset)|scsi.*(error|failed)`,
// sr[0-9] is the virtual CD-ROM drive on Azure VMs. This error occurs when the VM tries to read from an empty virtual optical drive, which is normal and expected.
// "Shutdown timeout set to" is an informational message from the NVMe driver during initialization, not an error.
exclude: `sr[0-9]|Shutdown timeout set to`,
exclude: ioFSExclude,
},
}

Expand Down
7 changes: 7 additions & 0 deletions packer.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ endif
else ifeq (${OS_SKU},Flatcar)
@echo "Using packer template file vhd-image-builder-flatcar.json"
@packer build -timestamp-ui -var-file=vhdbuilder/packer/settings.json vhdbuilder/packer/vhd-image-builder-flatcar.json
else ifeq (${OS_SKU},AzureContainerLinux)
@echo "Using packer template file vhd-image-builder-acl.json"
@packer build -timestamp-ui -var-file=vhdbuilder/packer/settings.json vhdbuilder/packer/vhd-image-builder-acl.json
else
$(error OS_SKU was invalid ${OS_SKU})
endif
Expand Down Expand Up @@ -142,6 +145,10 @@ generate-flatcar-customdata: vhdbuilder/packer/flatcar-customdata.json
vhdbuilder/packer/flatcar-customdata.json: vhdbuilder/packer/flatcar-customdata.yaml | hack/tools/bin/butane
@hack/tools/bin/butane --strict $< -o $@

generate-acl-customdata: vhdbuilder/packer/acl-customdata.json
vhdbuilder/packer/acl-customdata.json: vhdbuilder/packer/acl-customdata.yaml | hack/tools/bin/butane
@hack/tools/bin/butane --strict $< -o $@

publish-imagecustomizer:
@echo "Publishing VHD generated by imagecustomizer"
@./vhdbuilder/packer/imagecustomizer/scripts/publish-imagecustomizer-image.sh
Expand Down
25 changes: 25 additions & 0 deletions parts/linux/cloud-init/artifacts/acl/cse_helpers_acl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

echo "Sourcing cse_helpers_distro.sh for ACL"

stub() {
echo "${FUNCNAME[1]} stub"
}

dnfversionlockWALinuxAgent() {
stub
}

aptmarkWALinuxAgent() {
stub
}

apt_get_update() {
stub
}

apt_get_dist_upgrade() {
stub
}

#EOF
Loading
Loading