Skip to content

Commit 5a4505e

Browse files
feat: add ACL VHD build, provisioning, and e2e support
Signed-off-by: Aadhar Agarwal <aadagarwal@microsoft.com>
1 parent 657dc49 commit 5a4505e

File tree

115 files changed

+2844
-184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2844
-184
lines changed

.pipelines/.vsts-vhd-builder-release.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ parameters:
133133
displayName: Build Flatcar Gen2 ARM64
134134
type: boolean
135135
default: true
136+
- name: buildacltlgen2
137+
displayName: Build ACL TL Gen2
138+
type: boolean
139+
default: true
136140

137141
variables:
138142
- name: MODE
@@ -846,6 +850,30 @@ stages:
846850
useOverrides: ${{ parameters.useOverrides }}
847851
overrideBranch: ${{ parameters.overrideBranch }}
848852
artifactName: flatcar-gen2-arm64
853+
- job: buildacltlgen2
854+
condition: eq('${{ parameters.buildacltlgen2 }}', true)
855+
dependsOn: [ ]
856+
timeoutInMinutes: 360
857+
steps:
858+
- bash: |
859+
echo '##vso[task.setvariable variable=OS_SKU]AzureContainerLinux'
860+
echo '##vso[task.setvariable variable=OS_VERSION]acl'
861+
echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2'
862+
echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5'
863+
echo '##vso[task.setvariable variable=FEATURE_FLAGS]None'
864+
echo '##vso[task.setvariable variable=ARCHITECTURE]X86_64'
865+
echo '##vso[task.setvariable variable=ENABLE_FIPS]false'
866+
echo '##vso[task.setvariable variable=ENABLE_TRUSTED_LAUNCH]True'
867+
echo '##vso[task.setvariable variable=ENABLE_CGROUPV2]True'
868+
echo '##vso[task.setvariable variable=SIG_SOURCE_GALLERY_UNIQUE_NAME]035db282-f1c8-4ce7-b78f-2a7265d5398c-ACLDEVEL'
869+
echo '##vso[task.setvariable variable=SIG_SOURCE_IMAGE_NAME]acl'
870+
echo '##vso[task.setvariable variable=SIG_SOURCE_IMAGE_VERSION]0.20260227.1058781'
871+
displayName: Setup Build Variables
872+
- template: ./templates/.builder-release-template.yaml
873+
parameters:
874+
useOverrides: ${{ parameters.useOverrides }}
875+
overrideBranch: ${{ parameters.overrideBranch }}
876+
artifactName: acl-tl-gen2
849877
- job: build2404arm64gb200gen2containerd
850878
condition: eq('${{ parameters.build2404arm64gb200gen2containerd }}', true)
851879
dependsOn: [ ]

.pipelines/templates/.builder-release-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ steps:
8282
if grep -q "cvm" <<< "$FEATURE_FLAGS"; then SKU_NAME="${SKU_NAME}CVM"; fi && \
8383
if [[ "${IMG_SKU}" == *"minimal"* ]]; then SKU_NAME="${SKU_NAME}minimal"; fi && \
8484
if [[ "${ENABLE_TRUSTED_LAUNCH}" == "True" ]]; then SKU_NAME="${SKU_NAME}TL"; fi && \
85-
if [[ ${OS_SKU} != "CBLMariner" && ${OS_SKU} != "AzureLinux" && ${OS_SKU} != "AzureLinuxOSGuard" && ${OS_SKU} != "Flatcar" ]]; then SKU_NAME="${SKU_NAME}containerd"; fi && \
85+
if [[ ${OS_SKU} != "CBLMariner" && ${OS_SKU} != "AzureLinux" && ${OS_SKU} != "AzureLinuxOSGuard" && ${OS_SKU} != "Flatcar" && ${OS_SKU} != "AzureContainerLinux" ]]; then SKU_NAME="${SKU_NAME}containerd"; fi && \
8686
SKU_NAME=$(echo ${SKU_NAME} | tr -d '.') && \
8787
echo "##vso[task.setvariable variable=SKU_NAME]$SKU_NAME"
8888
echo "Set SKU_NAME to $SKU_NAME"

e2e/config/vhd.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ var (
4242
OSMariner OS = "mariner"
4343
OSAzureLinux OS = "azurelinux"
4444
OSFlatcar OS = "flatcar"
45+
OSACL OS = "acl"
4546
)
4647

4748
var (
@@ -217,6 +218,16 @@ var (
217218
OSDiskSizeGB: 60,
218219
}
219220

221+
VHDACLGen2TL = &Image{
222+
Name: "aclgen2TL",
223+
OS: OSACL,
224+
Arch: "amd64",
225+
Distro: datamodel.AKSACLGen2TL,
226+
Gallery: imageGalleryLinux,
227+
Flatcar: true,
228+
OSDiskSizeGB: 60,
229+
}
230+
220231
VHDWindows2019Containerd = &Image{
221232
Name: "windows-2019-containerd",
222233
OS: "windows",

e2e/node_config.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func nbcToAKSNodeConfigV1(nbc *datamodel.NodeBootstrappingConfiguration) *aksnod
162162
return &aksnodeconfigv1.Configuration{
163163
Version: "v1",
164164
BootstrappingConfig: bootstrappingConfig,
165-
DisableCustomData: nbc.AgentPoolProfile.IsFlatcar(),
165+
DisableCustomData: nbc.AgentPoolProfile.IsFlatcar() || nbc.AgentPoolProfile.IsACL(),
166166
LinuxAdminUsername: "azureuser",
167167
VmSize: config.Config.DefaultVMSKU,
168168
ClusterConfig: &aksnodeconfigv1.ClusterConfig{
@@ -748,6 +748,10 @@ func baseTemplateLinux(t testing.TB, location string, k8sVersion string, arch st
748748
GalleryName: "aksflatcar",
749749
ResourceGroup: "resourcegroup",
750750
},
751+
"AKSACL": {
752+
GalleryName: "aksacl",
753+
ResourceGroup: "resourcegroup",
754+
},
751755
},
752756
},
753757
IsARM64: false,
@@ -957,6 +961,10 @@ DXRqvV7TWO2hndliQq3BW385ZkiephlrmpUVM= r2k1@arturs-mbp.lan`,
957961
GalleryName: "aksflatcar",
958962
ResourceGroup: "resourcegroup",
959963
},
964+
"AKSACL": {
965+
GalleryName: "aksacl",
966+
ResourceGroup: "resourcegroup",
967+
},
960968
},
961969
},
962970
}

e2e/scenario_test.go

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,175 @@ func Test_Flatcar_SecureTLSBootstrapping_BootstrapToken_Fallback(t *testing.T) {
180180
})
181181
}
182182

183+
func Test_ACL(t *testing.T) {
184+
RunScenario(t, &Scenario{
185+
Description: "Tests that a node using an ACL VHD can be properly bootstrapped",
186+
Config: Config{
187+
Cluster: ClusterKubenet,
188+
VHD: config.VHDACLGen2TL,
189+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
190+
},
191+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
192+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
193+
},
194+
Validator: func(ctx context.Context, s *Scenario) {
195+
ValidateFileHasContent(ctx, s, "/etc/os-release", "ID=acl")
196+
ValidateFileExists(ctx, s, "/etc/ssl/certs/ca-certificates.crt")
197+
},
198+
},
199+
})
200+
}
201+
202+
func Test_ACL_Scriptless(t *testing.T) {
203+
RunScenario(t, &Scenario{
204+
Description: "Tests that a node using ACL and the self-contained installer can be properly bootstrapped",
205+
Config: Config{
206+
Cluster: ClusterKubenet,
207+
VHD: config.VHDACLGen2TL,
208+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
209+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
210+
},
211+
Validator: func(ctx context.Context, s *Scenario) {
212+
ValidateFileHasContent(ctx, s, "/var/log/azure/aks-node-controller.log", "aks-node-controller finished successfully")
213+
},
214+
AKSNodeConfigMutator: func(config *aksnodeconfigv1.Configuration) {
215+
},
216+
},
217+
})
218+
}
219+
220+
func Test_ACL_CustomCATrust(t *testing.T) {
221+
RunScenario(t, &Scenario{
222+
Description: "Tests that a node using an ACL VHD can be properly bootstrapped and custom CA was correctly added",
223+
Config: Config{
224+
Cluster: ClusterKubenet,
225+
VHD: config.VHDACLGen2TL,
226+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
227+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
228+
},
229+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
230+
nbc.CustomCATrustConfig = &datamodel.CustomCATrustConfig{
231+
CustomCATrustCerts: []string{
232+
encodedTestCert,
233+
},
234+
}
235+
},
236+
Validator: func(ctx context.Context, s *Scenario) {
237+
// ACL uses Azure Linux CA trust paths under /etc (read-only /usr via dm-verity)
238+
ValidateNonEmptyDirectory(ctx, s, "/etc/pki/ca-trust/source/anchors")
239+
},
240+
},
241+
})
242+
}
243+
244+
func Test_ACL_AzureCNI(t *testing.T) {
245+
RunScenario(t, &Scenario{
246+
Description: "ACL scenario on a cluster configured with Azure CNI",
247+
Config: Config{
248+
Cluster: ClusterAzureNetwork,
249+
VHD: config.VHDACLGen2TL,
250+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
251+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
252+
},
253+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
254+
nbc.ContainerService.Properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin = string(armcontainerservice.NetworkPluginAzure)
255+
nbc.AgentPoolProfile.KubernetesConfig.NetworkPlugin = string(armcontainerservice.NetworkPluginAzure)
256+
},
257+
},
258+
})
259+
}
260+
261+
func Test_ACL_AzureCNI_ChronyRestarts(t *testing.T) {
262+
RunScenario(t, &Scenario{
263+
Description: "Test ACL scenario on a cluster configured with Azure CNI and the chrony service restarts if it is killed",
264+
Config: Config{
265+
Cluster: ClusterAzureNetwork,
266+
VHD: config.VHDACLGen2TL,
267+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
268+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
269+
},
270+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
271+
nbc.ContainerService.Properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin = string(armcontainerservice.NetworkPluginAzure)
272+
nbc.AgentPoolProfile.KubernetesConfig.NetworkPlugin = string(armcontainerservice.NetworkPluginAzure)
273+
},
274+
Validator: func(ctx context.Context, s *Scenario) {
275+
ServiceCanRestartValidator(ctx, s, "chronyd", 10)
276+
ValidateFileHasContent(ctx, s, "/etc/systemd/system/chronyd.service.d/10-chrony-restarts.conf", "Restart=always")
277+
ValidateFileHasContent(ctx, s, "/etc/systemd/system/chronyd.service.d/10-chrony-restarts.conf", "RestartSec=5")
278+
},
279+
},
280+
})
281+
}
282+
283+
func Test_ACL_SecureTLSBootstrapping_BootstrapToken_Fallback(t *testing.T) {
284+
RunScenario(t, &Scenario{
285+
Description: "Tests that a node using an ACL VHD can be properly bootstrapped even if secure TLS bootstrapping fails",
286+
Tags: Tags{
287+
BootstrapTokenFallback: true,
288+
},
289+
Config: Config{
290+
Cluster: ClusterKubenet,
291+
VHD: config.VHDACLGen2TL,
292+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
293+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
294+
},
295+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
296+
nbc.SecureTLSBootstrappingConfig = &datamodel.SecureTLSBootstrappingConfig{
297+
Enabled: true,
298+
Deadline: (10 * time.Second).String(),
299+
UserAssignedIdentityID: "invalid", // use an unexpected user-assigned identity ID to force a secure TLS bootstrapping failure
300+
}
301+
},
302+
},
303+
})
304+
}
305+
306+
func Test_ACL_AzureCNI_ChronyRestarts_Scriptless(t *testing.T) {
307+
RunScenario(t, &Scenario{
308+
Description: "Test ACL scenario on a cluster configured with Azure CNI and the chrony service restarts if it is killed",
309+
Tags: Tags{
310+
Scriptless: true,
311+
},
312+
Config: Config{
313+
Cluster: ClusterAzureNetwork,
314+
VHD: config.VHDACLGen2TL,
315+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
316+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
317+
},
318+
AKSNodeConfigMutator: func(config *aksnodeconfigv1.Configuration) {
319+
config.NetworkConfig.NetworkPlugin = aksnodeconfigv1.NetworkPlugin_NETWORK_PLUGIN_AZURE
320+
},
321+
Validator: func(ctx context.Context, s *Scenario) {
322+
ServiceCanRestartValidator(ctx, s, "chronyd", 10)
323+
ValidateFileHasContent(ctx, s, "/etc/systemd/system/chronyd.service.d/10-chrony-restarts.conf", "Restart=always")
324+
ValidateFileHasContent(ctx, s, "/etc/systemd/system/chronyd.service.d/10-chrony-restarts.conf", "RestartSec=5")
325+
},
326+
},
327+
})
328+
}
329+
330+
func Test_ACL_DisableSSH(t *testing.T) {
331+
RunScenario(t, &Scenario{
332+
Description: "Tests that a node using ACL VHD with SSH disabled can be properly bootstrapped and SSH daemon is disabled",
333+
Config: Config{
334+
Cluster: ClusterKubenet,
335+
VHD: config.VHDACLGen2TL,
336+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
337+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
338+
},
339+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
340+
nbc.SSHStatus = datamodel.SSHOff
341+
},
342+
SkipSSHConnectivityValidation: true, // Skip SSH connectivity validation since SSH is down
343+
SkipDefaultValidation: true, // Skip default validation since it requires SSH connectivity
344+
Validator: func(ctx context.Context, s *Scenario) {
345+
// Validate SSH daemon is disabled via RunCommand
346+
ValidateSSHServiceDisabled(ctx, s)
347+
},
348+
},
349+
})
350+
}
351+
183352
func Test_AzureLinuxV3_SecureTLSBootstrapping_BootstrapToken_Fallback(t *testing.T) {
184353
RunScenario(t, &Scenario{
185354
Description: "Tests that a node using a AzureLinuxV3 Gen2 VHD can be properly bootstrapped even if secure TLS bootstrapping fails",

e2e/validators.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,16 +1870,20 @@ func ValidateKernelLogs(ctx context.Context, s *Scenario) {
18701870
patterns := map[string]categoryPattern{
18711871
"PANIC/CRASH": {
18721872
pattern: `(kernel: )?(panic|oops|call trace|backtrace|general protection fault|BUG:|RIP:)`,
1873-
// exclude boot parameter logs like "Kernel command line: ... panic=-1 ...", which are normal and not indicative of a kernel panic
1874-
exclude: `panic=`,
1873+
// exclude boot parameters like "panic=-1" and dm-verity's "panic-on-corruption" (used by ACL for verified boot)
1874+
exclude: `panic[-=]`,
18751875
},
18761876
"LOCKUP/STALL": {pattern: `(soft|hard) lockup|rcu.*(stall|detected stalls)|hung task|watchdog.*(detected|stuck)`},
18771877
"MEMORY": {pattern: `oom[- ]killer|Out of memory:|page allocation failure|memory corruption`},
18781878
"IO/FS": {
18791879
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)`,
18801880
// 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.
18811881
// "Shutdown timeout set to" is an informational message from the NVMe driver during initialization, not an error.
1882-
exclude: `sr[0-9]|Shutdown timeout set to`,
1882+
// "duplicate device" is a benign BTRFS warning from udev-workers racing to scan the same block device during boot (seen on ACL).
1883+
// loop[0-9] is used by ACL for sysext images backed by loop devices. Transient I/O errors on loop devices during sysext
1884+
// initialization are benign — they are caused by kernel block-layer read-ahead overshooting the squashfs backing file
1885+
// boundary. systemd-sysext completes successfully and squashfs's own internal checksums catch actual data corruption.
1886+
exclude: `sr[0-9]|Shutdown timeout set to|duplicate device|loop[0-9]`,
18831887
},
18841888
}
18851889

packer.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ endif
5656
else ifeq (${OS_SKU},Flatcar)
5757
@echo "Using packer template file vhd-image-builder-flatcar.json"
5858
@packer build -timestamp-ui -var-file=vhdbuilder/packer/settings.json vhdbuilder/packer/vhd-image-builder-flatcar.json
59+
else ifeq (${OS_SKU},AzureContainerLinux)
60+
@echo "Using packer template file vhd-image-builder-acl.json"
61+
@packer build -timestamp-ui -var-file=vhdbuilder/packer/settings.json vhdbuilder/packer/vhd-image-builder-acl.json
5962
else
6063
$(error OS_SKU was invalid ${OS_SKU})
6164
endif
@@ -142,6 +145,10 @@ generate-flatcar-customdata: vhdbuilder/packer/flatcar-customdata.json
142145
vhdbuilder/packer/flatcar-customdata.json: vhdbuilder/packer/flatcar-customdata.yaml | hack/tools/bin/butane
143146
@hack/tools/bin/butane --strict $< -o $@
144147

148+
generate-acl-customdata: vhdbuilder/packer/acl-customdata.json
149+
vhdbuilder/packer/acl-customdata.json: vhdbuilder/packer/acl-customdata.yaml | hack/tools/bin/butane
150+
@hack/tools/bin/butane --strict $< -o $@
151+
145152
publish-imagecustomizer:
146153
@echo "Publishing VHD generated by imagecustomizer"
147154
@./vhdbuilder/packer/imagecustomizer/scripts/publish-imagecustomizer-image.sh
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
echo "Sourcing cse_helpers_distro.sh for ACL"
4+
5+
stub() {
6+
echo "${FUNCNAME[1]} stub"
7+
}
8+
9+
dnfversionlockWALinuxAgent() {
10+
stub
11+
}
12+
13+
aptmarkWALinuxAgent() {
14+
stub
15+
}
16+
17+
apt_get_update() {
18+
stub
19+
}
20+
21+
apt_get_dist_upgrade() {
22+
stub
23+
}
24+
25+
#EOF

0 commit comments

Comments
 (0)