Skip to content

Commit bc59818

Browse files
authored
chore: add agentbaker artifact streaming combo e2es (#8332)
1 parent 05e4149 commit bc59818

2 files changed

Lines changed: 155 additions & 0 deletions

File tree

e2e/config/vhd.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ var (
6060
Distro: datamodel.AKSUbuntuContainerd2204Gen2,
6161
Gallery: imageGalleryLinux,
6262
}
63+
VHDUbuntu2204Gen2TLContainerd = &Image{
64+
Name: "2204gen2TLcontainerd",
65+
OS: OSUbuntu,
66+
Arch: "amd64",
67+
Distro: datamodel.AKSUbuntuContainerd2204TLGen2,
68+
Gallery: imageGalleryLinux,
69+
}
6370
VHDUbuntu2004FIPSContainerd = &Image{
6471
Name: "2004fipscontainerd",
6572
OS: OSUbuntu,

e2e/scenario_test.go

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,154 @@ func Test_Ubuntu2404_ArtifactStreaming_ARM64_Scriptless(t *testing.T) {
13501350
})
13511351
}
13521352

1353+
func Test_Ubuntu2204_ArtifactStreaming_TrustedLaunch(t *testing.T) {
1354+
RunScenario(t, &Scenario{
1355+
Description: "tests that a new ubuntu 2204 node using artifact streaming with trusted launch can be properly bootstrapped",
1356+
Config: Config{
1357+
Cluster: ClusterKubenet,
1358+
VHD: config.VHDUbuntu2204Gen2TLContainerd,
1359+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
1360+
nbc.EnableArtifactStreaming = true
1361+
},
1362+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
1363+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
1364+
},
1365+
Validator: func(ctx context.Context, s *Scenario) {
1366+
ValidateNonEmptyDirectory(ctx, s, "/etc/overlaybd")
1367+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-snapshotter.service")
1368+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-tcmu.service")
1369+
ValidateSystemdUnitIsRunning(ctx, s, "acr-mirror.service")
1370+
ValidateSystemdUnitIsRunning(ctx, s, "containerd.service")
1371+
},
1372+
},
1373+
})
1374+
}
1375+
1376+
func Test_Ubuntu2204_ArtifactStreaming_TrustedLaunch_Scriptless(t *testing.T) {
1377+
RunScenario(t, &Scenario{
1378+
Description: "tests that a new ubuntu 2204 node using artifact streaming with trusted launch can be properly bootstrapped",
1379+
Tags: Tags{
1380+
Scriptless: true,
1381+
},
1382+
Config: Config{
1383+
Cluster: ClusterKubenet,
1384+
VHD: config.VHDUbuntu2204Gen2TLContainerd,
1385+
AKSNodeConfigMutator: func(config *aksnodeconfigv1.Configuration) {
1386+
config.EnableArtifactStreaming = true
1387+
},
1388+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
1389+
vmss.Properties = addTrustedLaunchToVMSS(vmss.Properties)
1390+
},
1391+
Validator: func(ctx context.Context, s *Scenario) {
1392+
ValidateNonEmptyDirectory(ctx, s, "/etc/overlaybd")
1393+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-snapshotter.service")
1394+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-tcmu.service")
1395+
ValidateSystemdUnitIsRunning(ctx, s, "acr-mirror.service")
1396+
ValidateSystemdUnitIsRunning(ctx, s, "containerd.service")
1397+
},
1398+
},
1399+
})
1400+
}
1401+
1402+
func Test_Ubuntu2204_ArtifactStreaming_FIPS(t *testing.T) {
1403+
RunScenario(t, &Scenario{
1404+
Description: "tests that a new ubuntu 2204 FIPS node using artifact streaming can be properly bootstrapped",
1405+
Config: Config{
1406+
Cluster: ClusterKubenet,
1407+
VHD: config.VHDUbuntu2204Gen2FIPSContainerd,
1408+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
1409+
nbc.EnableArtifactStreaming = true
1410+
},
1411+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
1412+
vmss.Properties.AdditionalCapabilities = &armcompute.AdditionalCapabilities{
1413+
EnableFips1403Encryption: to.Ptr(true),
1414+
}
1415+
settings := vmss.Properties.VirtualMachineProfile.ExtensionProfile.Extensions[0].Properties.ProtectedSettings
1416+
vmss.Properties.VirtualMachineProfile.ExtensionProfile.Extensions[0].Properties.Settings = settings
1417+
vmss.Properties.VirtualMachineProfile.ExtensionProfile.Extensions[0].Properties.ProtectedSettings = nil
1418+
},
1419+
Validator: func(ctx context.Context, s *Scenario) {
1420+
ValidateNonEmptyDirectory(ctx, s, "/etc/overlaybd")
1421+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-snapshotter.service")
1422+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-tcmu.service")
1423+
ValidateSystemdUnitIsRunning(ctx, s, "acr-mirror.service")
1424+
ValidateSystemdUnitIsRunning(ctx, s, "containerd.service")
1425+
},
1426+
},
1427+
})
1428+
}
1429+
1430+
func Test_Ubuntu2204_ArtifactStreaming_FIPS_Scriptless(t *testing.T) {
1431+
RunScenario(t, &Scenario{
1432+
Description: "tests that a new ubuntu 2204 FIPS node using artifact streaming can be properly bootstrapped",
1433+
Tags: Tags{
1434+
Scriptless: true,
1435+
},
1436+
Config: Config{
1437+
Cluster: ClusterKubenet,
1438+
VHD: config.VHDUbuntu2204Gen2FIPSContainerd,
1439+
AKSNodeConfigMutator: func(config *aksnodeconfigv1.Configuration) {
1440+
config.EnableArtifactStreaming = true
1441+
},
1442+
VMConfigMutator: func(vmss *armcompute.VirtualMachineScaleSet) {
1443+
vmss.Properties.AdditionalCapabilities = &armcompute.AdditionalCapabilities{
1444+
EnableFips1403Encryption: to.Ptr(true),
1445+
}
1446+
settings := vmss.Properties.VirtualMachineProfile.ExtensionProfile.Extensions[0].Properties.ProtectedSettings
1447+
vmss.Properties.VirtualMachineProfile.ExtensionProfile.Extensions[0].Properties.Settings = settings
1448+
vmss.Properties.VirtualMachineProfile.ExtensionProfile.Extensions[0].Properties.ProtectedSettings = nil
1449+
},
1450+
Validator: func(ctx context.Context, s *Scenario) {
1451+
ValidateNonEmptyDirectory(ctx, s, "/etc/overlaybd")
1452+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-snapshotter.service")
1453+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-tcmu.service")
1454+
ValidateSystemdUnitIsRunning(ctx, s, "acr-mirror.service")
1455+
ValidateSystemdUnitIsRunning(ctx, s, "containerd.service")
1456+
},
1457+
},
1458+
})
1459+
}
1460+
1461+
func Test_Ubuntu2204_ArtifactStreaming_NetworkIsolatedCluster(t *testing.T) {
1462+
RunScenario(t, &Scenario{
1463+
Description: "tests that a new ubuntu 2204 node in a network isolated cluster using artifact streaming can be properly bootstrapped",
1464+
Tags: Tags{
1465+
NetworkIsolated: true,
1466+
NonAnonymousACR: true,
1467+
},
1468+
Config: Config{
1469+
Cluster: ClusterAzureNetworkIsolated,
1470+
VHD: config.VHDUbuntu2204Gen2Containerd,
1471+
BootstrapConfigMutator: func(nbc *datamodel.NodeBootstrappingConfiguration) {
1472+
nbc.EnableArtifactStreaming = true
1473+
nbc.OutboundType = datamodel.OutboundTypeBlock
1474+
nbc.ContainerService.Properties.SecurityProfile = &datamodel.SecurityProfile{
1475+
PrivateEgress: &datamodel.PrivateEgress{
1476+
Enabled: true,
1477+
ContainerRegistryServer: fmt.Sprintf("%s.azurecr.io/aks-managed-repository", config.PrivateACRNameNotAnon(config.Config.DefaultLocation)),
1478+
},
1479+
}
1480+
nbc.ContainerService.Properties.OrchestratorProfile.KubernetesConfig.UseManagedIdentity = true
1481+
nbc.AgentPoolProfile.KubernetesConfig.UseManagedIdentity = true
1482+
nbc.K8sComponents.LinuxCredentialProviderURL = fmt.Sprintf(
1483+
"https://packages.aks.azure.com/cloud-provider-azure/v%s/binaries/azure-acr-credential-provider-linux-amd64-v%s.tar.gz",
1484+
nbc.ContainerService.Properties.OrchestratorProfile.OrchestratorVersion,
1485+
nbc.ContainerService.Properties.OrchestratorProfile.OrchestratorVersion)
1486+
nbc.KubeletConfig["--image-credential-provider-config"] = "/var/lib/kubelet/credential-provider-config.yaml"
1487+
nbc.KubeletConfig["--image-credential-provider-bin-dir"] = "/var/lib/kubelet/credential-provider"
1488+
},
1489+
Validator: func(ctx context.Context, s *Scenario) {
1490+
ValidateDirectoryContent(ctx, s, "/opt/azure", []string{"outbound-check-skipped"})
1491+
ValidateNonEmptyDirectory(ctx, s, "/etc/overlaybd")
1492+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-snapshotter.service")
1493+
ValidateSystemdUnitIsRunning(ctx, s, "overlaybd-tcmu.service")
1494+
ValidateSystemdUnitIsRunning(ctx, s, "acr-mirror.service")
1495+
ValidateSystemdUnitIsRunning(ctx, s, "containerd.service")
1496+
},
1497+
},
1498+
})
1499+
}
1500+
13531501
func Test_Ubuntu2204_ChronyRestarts_Taints_And_Tolerations(t *testing.T) {
13541502
RunScenario(t, &Scenario{
13551503
Description: "Tests that the chrony service restarts if it is killed. Also tests taints and tolerations",

0 commit comments

Comments
 (0)