Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 904b3ff

Browse files
authored
Add new Linux VHDs (#5041)
1 parent 5c2febf commit 904b3ff

15 files changed

+1673
-15
lines changed

.pipelines/e2e-job-template.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
MSI_USER_ASSIGNED_ID: '$(MSI_USER_ASSIGNED_ID_AKS_ENGINE_E2E)'
3636
CONTAINER_RUNTIME: ${{ parameters.containerRuntime }}
3737
BLOCK_SSH: ${{ parameters.runSSHTests }}
38+
DISTRO: ${{ parameters.distro }}
3839

3940
steps:
4041
- template: e2e-step-template.yaml

.pipelines/pr-e2e.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,14 @@ jobs:
132132
enableKMSEncryption: false
133133
containerRuntime: 'containerd'
134134
runSSHTests: true
135+
136+
- template: e2e-job-template.yaml
137+
parameters:
138+
name: 'k8s_1_24_2004_e2e'
139+
k8sRelease: '1.24'
140+
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json'
141+
createVNET: false
142+
enableKMSEncryption: false
143+
containerRuntime: 'containerd'
144+
distro: 'aks-ubuntu-20.04'
145+
runSSHTests: true

pkg/api/azenvtypes.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,15 @@ var (
148148
ImageOffer: "aks",
149149
ImageSku: "aks-engine-ubuntu-1804-202112",
150150
ImagePublisher: "microsoft-aks",
151-
ImageVersion: "2022.12.12",
151+
ImageVersion: "2023.01.10",
152+
}
153+
154+
// AKSUbuntu2004OSImageConfig is the AKS Engine image based on Ubuntu 20.04-LTS.
155+
AKSUbuntu2004OSImageConfig = AzureOSImageConfig{
156+
ImageOffer: "aks",
157+
ImageSku: "aks-engine-ubuntu-2004-202301",
158+
ImagePublisher: "microsoft-aks",
159+
ImageVersion: "2023.01.10",
152160
}
153161

154162
// AKSWindowsServer2019OSImageConfig is the aks-engine image based on Windows Server 2019
@@ -205,6 +213,7 @@ var (
205213
AKS1604Deprecated: AKSUbuntu1604OSImageConfig, // for back-compat
206214
AKSUbuntu1804: AKSUbuntu1804OSImageConfig,
207215
AKS1804Deprecated: AKSUbuntu1804OSImageConfig, // for back-compat
216+
AKSUbuntu2004: AKSUbuntu2004OSImageConfig,
208217
ACC1604: ACC1604OSImageConfig,
209218
},
210219
}
@@ -248,6 +257,7 @@ var (
248257
AKS1604Deprecated: AKSUbuntu1604OSImageConfig, // for back-compat
249258
AKSUbuntu1804: AKSUbuntu1804OSImageConfig,
250259
AKS1804Deprecated: AKSUbuntu1804OSImageConfig, // for back-compat
260+
AKSUbuntu2004: AKSUbuntu2004OSImageConfig,
251261
},
252262
}
253263

@@ -290,6 +300,7 @@ var (
290300
AKS1604Deprecated: AKSUbuntu1604OSImageConfig, // for back-compat
291301
AKSUbuntu1804: AKSUbuntu1804OSImageConfig,
292302
AKS1804Deprecated: AKSUbuntu1804OSImageConfig, // for back-compat
303+
AKSUbuntu2004: AKSUbuntu2004OSImageConfig,
293304
},
294305
}
295306

pkg/api/const.go

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const (
2828
AKSDockerEngine Distro = "aks-docker-engine" // deprecated docker-engine distro.
2929
AKSUbuntu1604 Distro = "aks-ubuntu-16.04"
3030
AKSUbuntu1804 Distro = "aks-ubuntu-18.04"
31+
AKSUbuntu2004 Distro = "aks-ubuntu-20.04"
3132
ACC1604 Distro = "acc-16.04"
3233
)
3334

pkg/api/defaults-kubelet_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ func TestProtectKernelDefaults(t *testing.T) {
760760
// Validate that --protect-kernel-defaults is "true" by default for relevant distros
761761
for _, distro := range DistroValues {
762762
switch distro {
763-
case AKSUbuntu1604, AKSUbuntu1804:
763+
case AKSUbuntu1604, AKSUbuntu1804, AKSUbuntu2004:
764764
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
765765
cs.Properties.MasterProfile.Distro = distro
766766
cs.Properties.AgentPoolProfiles[0].Distro = distro
@@ -839,7 +839,7 @@ func TestProtectKernelDefaults(t *testing.T) {
839839
// Validate that --protect-kernel-defaults is overridable
840840
for _, distro := range DistroValues {
841841
switch distro {
842-
case Ubuntu, Ubuntu2004, Ubuntu2004Gen2, Ubuntu1804, Ubuntu1804Gen2, AKSUbuntu1604, AKSUbuntu1804:
842+
case Ubuntu, Ubuntu2004, Ubuntu2004Gen2, Ubuntu1804, Ubuntu1804Gen2, AKSUbuntu1604, AKSUbuntu1804, AKSUbuntu2004:
843843
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
844844
cs.Properties.MasterProfile.Distro = "ubuntu"
845845
cs.Properties.AgentPoolProfiles[0].Distro = "ubuntu"

pkg/api/defaults.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
// DistroValues is a list of currently supported distros
28-
var DistroValues = []Distro{"", Ubuntu, Ubuntu2004, Ubuntu2004Gen2, Ubuntu1804, Flatcar, AKSUbuntu1604, AKSUbuntu1804, Ubuntu1804Gen2, ACC1604}
28+
var DistroValues = []Distro{"", Ubuntu, Ubuntu2004, Ubuntu2004Gen2, Ubuntu1804, Flatcar, AKSUbuntu1604, AKSUbuntu1804, Ubuntu1804Gen2, AKSUbuntu2004, ACC1604}
2929

3030
// PropertiesDefaultsParams is the parameters when we set the properties defaults for ContainerService.
3131
type PropertiesDefaultsParams struct {

pkg/api/types.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ func (m *MasterProfile) IsStorageAccount() bool {
12861286

12871287
// IsVHDDistro returns true if the distro uses VHD SKUs
12881288
func (m *MasterProfile) IsVHDDistro() bool {
1289-
return m.Distro == AKSUbuntu1604 || m.Distro == AKSUbuntu1804
1289+
return m.Distro == AKSUbuntu1604 || m.Distro == AKSUbuntu1804 || m.Distro == AKSUbuntu2004
12901290
}
12911291

12921292
// IsAuditDEnabled returns true if the master profile is configured for auditd
@@ -1361,7 +1361,7 @@ func (m *MasterProfile) IsUbuntu1804() bool {
13611361
// IsUbuntu2004 returns true if the master profile distro is based on Ubuntu 20.04
13621362
func (m *MasterProfile) IsUbuntu2004() bool {
13631363
switch m.Distro {
1364-
case Ubuntu2004, Ubuntu2004Gen2:
1364+
case AKSUbuntu2004, Ubuntu2004, Ubuntu2004Gen2:
13651365
return true
13661366
default:
13671367
return false
@@ -1430,7 +1430,7 @@ func (a *AgentPoolProfile) IsFlatcar() bool {
14301430

14311431
// IsVHDDistro returns true if the distro uses VHD SKUs
14321432
func (a *AgentPoolProfile) IsVHDDistro() bool {
1433-
return a.Distro == AKSUbuntu1604 || a.Distro == AKSUbuntu1804
1433+
return a.Distro == AKSUbuntu1604 || a.Distro == AKSUbuntu1804 || a.Distro == AKSUbuntu2004
14341434
}
14351435

14361436
// IsAuditDEnabled returns true if the master profile is configured for auditd
@@ -1513,7 +1513,7 @@ func (a *AgentPoolProfile) IsUbuntu1804() bool {
15131513
func (a *AgentPoolProfile) IsUbuntu2004() bool {
15141514
if a.OSType != Windows {
15151515
switch a.Distro {
1516-
case Ubuntu2004, Ubuntu2004Gen2:
1516+
case AKSUbuntu2004, Ubuntu2004, Ubuntu2004Gen2:
15171517
return true
15181518
default:
15191519
return false

pkg/api/vlabs/const.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const (
3333
AKSDockerEngine Distro = "aks-docker-engine" // deprecated docker-engine distro.
3434
AKSUbuntu1604 Distro = "aks-ubuntu-16.04"
3535
AKSUbuntu1804 Distro = "aks-ubuntu-18.04"
36+
AKSUbuntu2004 Distro = "aks-ubuntu-20.04"
3637
ACC1604 Distro = "acc-16.04"
3738
)
3839

@@ -100,7 +101,7 @@ var (
100101
ContainerRuntimeValues = [...]string{"", Docker, Containerd}
101102

102103
// DistroValues holds the valid values for OS distros
103-
DistroValues = []Distro{"", Ubuntu, Ubuntu2004, Ubuntu2004Gen2, Ubuntu1804, Ubuntu1804Gen2, Flatcar, AKSUbuntu1604, AKSUbuntu1804, ACC1604}
104+
DistroValues = []Distro{"", Ubuntu, Ubuntu2004, Ubuntu2004Gen2, Ubuntu1804, Ubuntu1804Gen2, Flatcar, AKSUbuntu1604, AKSUbuntu1804, AKSUbuntu2004, ACC1604}
104105

105106
// DependenciesLocationValues holds the valid values for dependencies location
106107
DependenciesLocationValues = []DependenciesLocation{"", AzureCustomCloudDependenciesLocationPublic, AzureCustomCloudDependenciesLocationChina, AzureCustomCloudDependenciesLocationGerman, AzureCustomCloudDependenciesLocationUSGovernment}

pkg/api/vlabs/types.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ func (m *MasterProfile) IsUbuntu1804() bool {
750750
// IsUbuntu2004 returns true if the master profile distro is based on Ubuntu 20.04
751751
func (m *MasterProfile) IsUbuntu2004() bool {
752752
switch m.Distro {
753-
case Ubuntu2004, Ubuntu2004Gen2:
753+
case AKSUbuntu2004, Ubuntu2004, Ubuntu2004Gen2:
754754
return true
755755
default:
756756
return false
@@ -938,7 +938,7 @@ func (a *AgentPoolProfile) IsUbuntu1804() bool {
938938
func (a *AgentPoolProfile) IsUbuntu2004() bool {
939939
if a.OSType != Windows {
940940
switch a.Distro {
941-
case Ubuntu2004, Ubuntu2004Gen2:
941+
case AKSUbuntu2004, Ubuntu2004, Ubuntu2004Gen2:
942942
return true
943943
default:
944944
return false

pkg/api/vlabs/validate_test.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
250250
Count: 10,
251251
Distro: AKSUbuntu1804,
252252
},
253+
{
254+
Name: "ubuntu2004pool",
255+
Count: 10,
256+
Distro: AKSUbuntu2004,
257+
},
253258
},
254259
},
255260
},
@@ -4460,7 +4465,7 @@ func TestAgentPoolProfile_ValidateAuditDEnabled(t *testing.T) {
44604465
if err := cs.Properties.validateAgentPoolProfiles(false); err.Error() != expectedMsg {
44614466
t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error())
44624467
}
4463-
case Ubuntu, Ubuntu1804, Ubuntu1804Gen2, AKSUbuntu1604, AKSUbuntu1804, ACC1604:
4468+
case Ubuntu, Ubuntu1804, Ubuntu1804Gen2, AKSUbuntu1604, AKSUbuntu1804, AKSUbuntu2004, ACC1604:
44644469
if err := cs.Properties.validateAgentPoolProfiles(false); err != nil {
44654470
t.Errorf("AuditDEnabled should work with distro %s, got error %s", distro, err.Error())
44664471
}
@@ -4483,7 +4488,7 @@ func TestMasterProfile_ValidateAuditDEnabled(t *testing.T) {
44834488
if err := cs.Properties.validateMasterProfile(false); err.Error() != expectedMsg {
44844489
t.Errorf("expected error with message : %s, but got %s", expectedMsg, err.Error())
44854490
}
4486-
case Ubuntu, Ubuntu1804, Ubuntu1804Gen2, AKSUbuntu1604, AKSUbuntu1804, ACC1604:
4491+
case Ubuntu, Ubuntu1804, Ubuntu1804Gen2, AKSUbuntu1604, AKSUbuntu1804, AKSUbuntu2004, ACC1604:
44874492
if err := cs.Properties.validateMasterProfile(false); err != nil {
44884493
t.Errorf("AuditDEnabled should work with distro %s, got error %s", distro, err.Error())
44894494
}

pkg/armhelpers/support_validator.go

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ func toImageConfig(distro api.Distro) api.AzureOSImageConfig {
9090
return api.AKSUbuntu1604OSImageConfig
9191
case api.AKSUbuntu1804:
9292
return api.AKSUbuntu1804OSImageConfig
93+
case api.AKSUbuntu2004:
94+
return api.AKSUbuntu2004OSImageConfig
9395
case api.ACC1604:
9496
return api.ACC1604OSImageConfig
9597
default:

test/e2e/engine/template.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
//+build test
1+
//go:build test
2+
// +build test
3+
24
// Copyright (c) Microsoft Corporation. All rights reserved.
35
// Licensed under the MIT license.
46

@@ -428,7 +430,7 @@ func Build(cfg *config.Config, masterSubnetID string, agentSubnetIDs []string, i
428430
if config.Distro != "" {
429431
prop.MasterProfile.Distro = vlabs.Distro(config.Distro)
430432
for _, pool := range prop.AgentPoolProfiles {
431-
if !pool.IsWindows() {
433+
if !pool.IsWindows() && pool.Distro == "" {
432434
pool.Distro = vlabs.Distro(config.Distro)
433435
}
434436
}

0 commit comments

Comments
 (0)