Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
7ecbb04
feat(linux): onboard Ubuntu 26.04 minimal image builds for AMD64 + ARM64
cameronmeissner Jun 26, 2026
1487043
chore: update SKU naming logic for mimimal
cameronmeissner Jun 26, 2026
bc081a3
chore: add installMinimalBuildDeps
cameronmeissner Jun 26, 2026
836c76d
chore: cleanup
cameronmeissner Jun 26, 2026
9252eea
chore: eliminate build retries for debugging
cameronmeissner Jun 26, 2026
29e805f
chore: typo
cameronmeissner Jun 26, 2026
bd236c7
chore: remove gawk usage
cameronmeissner Jun 26, 2026
a4308bb
chore: install gpg
cameronmeissner Jun 26, 2026
d65eaa1
chore: conflicts
cameronmeissner Jul 6, 2026
5bb99f6
chore: cleanup install-deps.sh and temporarily skip package/binary ca…
cameronmeissner Jul 6, 2026
404dcbc
chore: always updateAptWithMicrosoftPkg + installDeps
cameronmeissner Jul 6, 2026
8fe04f0
chore: more changes
cameronmeissner Jul 6, 2026
15fb65c
chore: fix diff
cameronmeissner Jul 6, 2026
6cc28a6
chore: address feedback
cameronmeissner Jul 6, 2026
2f4236f
chore: debug
cameronmeissner Jul 6, 2026
cd1005d
chore: use correct aznfs version
cameronmeissner Jul 6, 2026
623faa7
chore: skip linux-modules-extra-
cameronmeissner Jul 7, 2026
d35b776
chore: fix
cameronmeissner Jul 7, 2026
ecf21af
chore: add nvidia repo support
cameronmeissner Jul 7, 2026
6d285ff
chore: debug
cameronmeissner Jul 7, 2026
8dd80e4
chore: bcc fixes
cameronmeissner Jul 7, 2026
2444539
chore: add missing packages for bcc install
cameronmeissner Jul 7, 2026
23f68b4
chore: purge after bcc install
cameronmeissner Jul 7, 2026
2ad1ba4
chore: handle nvidia repo gpg
cameronmeissner Jul 7, 2026
7bb7b43
chore: enable LSM configuration with BPF
cameronmeissner Jul 7, 2026
ce500a3
chore: cleanup trivy scanning
cameronmeissner Jul 7, 2026
f390a4f
chore: typo
cameronmeissner Jul 7, 2026
b90651b
chore: bump bcc
cameronmeissner Jul 7, 2026
3acc692
chore: bcc v0.37.0
cameronmeissner Jul 7, 2026
26eb488
chore: add libpolly-22-dev for bcc install
cameronmeissner Jul 7, 2026
34ac5aa
chore: typo
cameronmeissner Jul 7, 2026
3991257
chore: downgrade to llvm-18
cameronmeissner Jul 7, 2026
1fa7fd2
chore: cleanup
cameronmeissner Jul 7, 2026
3da8f5c
chore: tweaks
cameronmeissner Jul 8, 2026
d69de07
chore: more tweaks
cameronmeissner Jul 8, 2026
c8ea241
chore: fix logs
cameronmeissner Jul 8, 2026
93afcf1
chore: upload release notes
cameronmeissner Jul 8, 2026
3441fa7
chore: add components entries for 2604
cameronmeissner Jul 8, 2026
a6a3b2f
chore: typo
cameronmeissner Jul 8, 2026
53fd795
chore: finalized pin to aznfs=3.0.18
cameronmeissner Jul 8, 2026
5011079
chore: download release notes after post-install-deps
cameronmeissner Jul 8, 2026
39935b5
chore: uncomment unsupported func calls to test other VHDs
cameronmeissner Jul 9, 2026
0e8ec07
Merge branch 'main' of https://github.com/Azure/AgentBaker into camei…
cameronmeissner Jul 9, 2026
2b5eb8e
chore: reorder BCC + nvidia kernel module prebake to avoid running ou…
cameronmeissner Jul 9, 2026
c66a233
chore: more reordering
cameronmeissner Jul 9, 2026
b55a4e1
chore: add correct gpg key for 26.04 PMC repos
cameronmeissner Jul 10, 2026
2a082c3
chore: skip ebpf installs
cameronmeissner Jul 14, 2026
7c0836c
chore: skip unpublished packages temporarily
cameronmeissner Jul 15, 2026
9052aed
chore: correct package versions
cameronmeissner Jul 15, 2026
ee43421
Merge branch 'main' of https://github.com/Azure/AgentBaker into camei…
cameronmeissner Jul 15, 2026
417863b
chore: correct package version for dra-driver-nvidia-gpu
cameronmeissner Jul 15, 2026
ad02eb3
chore: fix
cameronmeissner Jul 15, 2026
3f3932c
chore: revert packer template
cameronmeissner Jul 15, 2026
6e2e083
chore: don't download bcc tools logs
cameronmeissner Jul 15, 2026
9cd3b11
chore: fix renovate tag
cameronmeissner Jul 15, 2026
f2df495
chore: fix quoting
cameronmeissner Jul 15, 2026
7584119
chore: feedback
cameronmeissner Jul 15, 2026
3558624
chore: more feedback
cameronmeissner Jul 15, 2026
91004ca
chore: fix typo
cameronmeissner Jul 15, 2026
3b2165f
chore: update assignRootPW for 26.04's python3.14
cameronmeissner Jul 15, 2026
c2a256b
chore: fix python syntax
cameronmeissner Jul 15, 2026
aee624e
chore: don't use sudo-rs
cameronmeissner Jul 15, 2026
c821ec9
chore: cleanup
cameronmeissner Jul 15, 2026
a0d2647
Merge branch 'main' of https://github.com/Azure/AgentBaker into camei…
cameronmeissner Jul 16, 2026
06530d8
chore: cleanup, add dcgm-exporter support
cameronmeissner Jul 16, 2026
de75f55
chore: update dcgm deps
cameronmeissner Jul 16, 2026
4d99a10
chore: remove TODO
cameronmeissner Jul 16, 2026
268bd9c
chore: fix nvidia package versioning consistency
cameronmeissner Jul 16, 2026
b37bff2
chore: clenaup components
cameronmeissner Jul 16, 2026
9b5777c
chore: fix packagekit purge, add E2Es
cameronmeissner Jul 16, 2026
ca9d069
Merge branch 'main' of https://github.com/Azure/AgentBaker into camei…
cameronmeissner Jul 16, 2026
5bdeaea
chore: skip testBccTools
cameronmeissner Jul 16, 2026
84374b6
chore: correctly install azcli on 26.04 scanning VM
cameronmeissner Jul 16, 2026
b49bcbd
chore: use python venv for azcli installation
cameronmeissner Jul 16, 2026
9457045
chore: fixes
cameronmeissner Jul 16, 2026
607b7df
chore: fix trivy-scan.sh
cameronmeissner Jul 17, 2026
4b33829
chore: support aks-secure-tls-bootstrap-client
cameronmeissner Jul 17, 2026
1196c49
refactor: trivy-scan.sh azcli installation
cameronmeissner Jul 17, 2026
b920ffc
chore: conflicts
cameronmeissner Jul 17, 2026
00361d7
chore: fix e2e
cameronmeissner Jul 17, 2026
62c12ba
chore: fix lint
cameronmeissner Jul 17, 2026
ae483d1
chore: fix scanning
cameronmeissner Jul 17, 2026
5802933
chore: skip CIS for 26.04 since no benchmarks are yet available
cameronmeissner Jul 17, 2026
eae6da2
chore: cleanup
cameronmeissner Jul 17, 2026
207709a
chore: fix azcli installation during trivy scans on arm64
cameronmeissner Jul 20, 2026
544dfa8
chore: conflicts
cameronmeissner Jul 20, 2026
fe1f1f5
chore: remove redundant scriptless scenarios
cameronmeissner Jul 20, 2026
0432d8b
chore: fix diff
cameronmeissner Jul 20, 2026
c3fec43
chore: add test
cameronmeissner Jul 20, 2026
6e4603e
chore: skip acr-mirror + blobfuse2 for now
cameronmeissner Jul 22, 2026
777dff5
chore: ignore missing blobfuse2 in e2e
cameronmeissner Jul 22, 2026
bfb57a1
chore: fix e2e
cameronmeissner Jul 22, 2026
bb31515
chore: cleanup
cameronmeissner Jul 22, 2026
057f329
chore: add bpf at the end of lsm= grub config
cameronmeissner Jul 22, 2026
f13f691
chore: fix kernel panic validation
cameronmeissner Jul 23, 2026
f946987
chore: always install libc6-dev for gpu driver installation to work
cameronmeissner Jul 23, 2026
8b47b7c
chore: use correct VM size for arm64 E2E
cameronmeissner Jul 23, 2026
c974de6
Merge branch 'main' of https://github.com/Azure/AgentBaker into camei…
cameronmeissner Jul 23, 2026
b0ee4ea
chore: fix tests, remove GPU scenarios for now
cameronmeissner Jul 23, 2026
8af4179
chore: remove more GPU tests
cameronmeissner Jul 23, 2026
85042dd
chore: revert GPU additions
cameronmeissner Jul 23, 2026
8216bc2
chore: revert more GPU additions
cameronmeissner Jul 23, 2026
5d5c624
chore: more reversions
cameronmeissner Jul 23, 2026
be88c53
chore: content tests
cameronmeissner Jul 23, 2026
911cb81
chore: fixes
cameronmeissner Jul 23, 2026
90f364e
chore: more e2e fixes
cameronmeissner Jul 23, 2026
2e4cb96
chore: remove nvidia-device-plugin + dra-driver-nvidia-gpu:
cameronmeissner Jul 23, 2026
02bece5
Merge branch 'main' of https://github.com/Azure/AgentBaker into camei…
cameronmeissner Jul 23, 2026
983812a
chore: fix nbc/anc diffs
cameronmeissner Jul 24, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/no-sudo-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
| grep -v ':[[:space:]]*#' \
| grep -v 'sudo\.log' \
| grep -v 'sudoers' \
| grep -v 'update-alternatives' \
| grep -v 'logrotate\.d/sudo' || true)
if [ -n "$matches" ]; then
echo "::error::Found sudo command invocations in CSE provisioning scripts."
Expand Down
42 changes: 21 additions & 21 deletions .pipelines/.vsts-vhd-builder-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ parameters:
displayName: Build 2204 TL Gen2 Containerd
type: boolean
default: true
- name: build2204minimalgen1containerd
displayName: Build 2204 Minimal Gen1 Containerd
- name: build2604minimalgen2containerd
displayName: Build 2604 Minimal Gen2 Containerd
type: boolean
default: false
- name: build2204minimalgen2containerd
displayName: Build 2204 Minimal Gen2 Containerd
- name: build2604minimalarm64gen2containerd
displayName: Build 2604 Minimal ARM64 Gen2 Containerd
type: boolean
default: false
- name: buildacltlgen2
Expand Down Expand Up @@ -763,21 +763,21 @@ stages:
useOverrides: ${{ parameters.useOverrides }}
overrideBranch: ${{ parameters.overrideBranch }}
artifactName: 2204-tl-gen2-containerd
- job: build2204minimalgen1containerd
condition: eq('${{ parameters.build2204minimalgen1containerd }}', true)
- job: build2604minimalgen2containerd
condition: eq('${{ parameters.build2604minimalgen2containerd }}', true)
dependsOn: [ ]
timeoutInMinutes: 360
steps:
- bash: |
echo '##vso[task.setvariable variable=OS_SKU]Ubuntu'
echo '##vso[task.setvariable variable=OS_VERSION]22.04'
echo '##vso[task.setvariable variable=OS_VERSION]26.04'
echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical'
echo '##vso[task.setvariable variable=IMG_OFFER]0001-com-ubuntu-minimal-jammy-aks-daily-preview'
echo '##vso[task.setvariable variable=IMG_SKU]minimal-aks-22_04-daily-lts'
echo '##vso[task.setvariable variable=IMG_OFFER]ubuntu-26_04-lts'
echo '##vso[task.setvariable variable=IMG_SKU]minimal'
echo '##vso[task.setvariable variable=IMG_VERSION]latest'
echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1'
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=FEATURE_FLAGS]minimal'
echo '##vso[task.setvariable variable=ARCHITECTURE]X86_64'
echo '##vso[task.setvariable variable=ENABLE_FIPS]False'
echo '##vso[task.setvariable variable=ENABLE_TRUSTED_LAUNCH]False'
Expand All @@ -786,31 +786,31 @@ stages:
parameters:
useOverrides: ${{ parameters.useOverrides }}
overrideBranch: ${{ parameters.overrideBranch }}
artifactName: 2204-minimal-gen1-containerd
- job: build2204minimalgen2containerd
condition: eq('${{ parameters.build2204minimalgen2containerd }}', true)
artifactName: 2604-minimal-gen2-containerd
- job: build2604minimalarm64gen2containerd
condition: eq('${{ parameters.build2604minimalarm64gen2containerd }}', true)
dependsOn: [ ]
timeoutInMinutes: 360
steps:
- bash: |
echo '##vso[task.setvariable variable=OS_SKU]Ubuntu'
echo '##vso[task.setvariable variable=OS_VERSION]22.04'
echo '##vso[task.setvariable variable=OS_VERSION]26.04'
echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical'
echo '##vso[task.setvariable variable=IMG_OFFER]0001-com-ubuntu-minimal-jammy-aks-daily-preview'
echo '##vso[task.setvariable variable=IMG_SKU]minimal-aks-22_04-daily-lts-gen2'
echo '##vso[task.setvariable variable=IMG_OFFER]ubuntu-26_04-lts'
echo '##vso[task.setvariable variable=IMG_SKU]minimal-arm64'
echo '##vso[task.setvariable variable=IMG_VERSION]latest'
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=AZURE_VM_SIZE]Standard_D16pds_v5'
echo '##vso[task.setvariable variable=FEATURE_FLAGS]minimal'
echo '##vso[task.setvariable variable=ARCHITECTURE]ARM64'
echo '##vso[task.setvariable variable=ENABLE_FIPS]False'
echo '##vso[task.setvariable variable=ENABLE_TRUSTED_LAUNCH]False'
displayName: Setup Build Variables
- template: ./templates/.builder-release-template.yaml
parameters:
useOverrides: ${{ parameters.useOverrides }}
overrideBranch: ${{ parameters.overrideBranch }}
artifactName: 2204-minimal-gen2-containerd
artifactName: 2604-minimal-arm64-gen2-containerd
- job: buildacltlgen2
condition: eq('${{ parameters.buildacltlgen2 }}', 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 @@ -75,12 +75,12 @@ steps:
- bash: |
SKU_NAME=${OS_VERSION} && \
if grep -q "minimal" <<< "$FEATURE_FLAGS"; then SKU_NAME="${SKU_NAME}minimal"; fi && \
if [[ "${HYPERV_GENERATION,,}" == "v2" ]]; then SKU_NAME="${SKU_NAME}gen2"; fi && \
if [[ "${ARCHITECTURE,,}" == "arm64" ]]; then SKU_NAME="${SKU_NAME}arm64"; fi && \
if grep -q "NVIDIA_GB" <<< "$FEATURE_FLAGS"; then SKU_NAME="${SKU_NAME}gb"; fi && \
if [[ "${ENABLE_FIPS,,}" == "true" ]]; then SKU_NAME="${SKU_NAME}fips"; fi && \
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" && ${OS_SKU} != "AzureContainerLinux" ]]; then SKU_NAME="${SKU_NAME}containerd"; fi && \
SKU_NAME=$(echo ${SKU_NAME} | tr -d '.') && \
Expand Down
168 changes: 91 additions & 77 deletions e2e/aks_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,57 +22,6 @@ import (
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns"
)

// getLatestGAKubernetesVersion returns the highest GA Kubernetes version for the given location.
func getLatestGAKubernetesVersion(ctx context.Context, location string) (string, error) {
versions, err := config.Azure.AKS.ListKubernetesVersions(context.Background(), location, nil)
if err != nil {
return "", fmt.Errorf("failed to list Kubernetes versions: %w", err)
}
if len(versions.Values) == 0 {
return "", fmt.Errorf("no Kubernetes versions available")
}

var latestPatchVersion string
msg := fmt.Sprintf("Available Kubernetes versions for location %s:\n", location)
defer func() { toolkit.Logf(ctx, "%s", msg) }()
// Iterate through the available versions to find the latest GA version
for _, k8sVersion := range versions.Values {
if k8sVersion == nil {
continue
}
msg += fmt.Sprintf("- %s\n", *k8sVersion.Version)

// Skip preview versions
if k8sVersion.IsPreview != nil && *k8sVersion.IsPreview {
msg += " - - is in preview, skipping\n"
continue
}
for patchVersion := range k8sVersion.PatchVersions {
if patchVersion == "" {
continue
}
msg += fmt.Sprintf(" - - %s\n", patchVersion)
// Initialize latestVersion with first GA version found
if latestPatchVersion == "" {
latestPatchVersion = patchVersion
msg += fmt.Sprintf(" - - first latest found, updating to: %s\n", latestPatchVersion)
continue
}
// Compare versions
if agent.IsKubernetesVersionGe(patchVersion, latestPatchVersion) {
latestPatchVersion = patchVersion
msg += fmt.Sprintf(" - - new latest found, updating to: %s\n", latestPatchVersion)
}
}
}

if latestPatchVersion == "" {
return "", fmt.Errorf("no GA Kubernetes version found")
}
msg += fmt.Sprintf("Latest GA Kubernetes version for location %s: %s\n", location, latestPatchVersion)
return latestPatchVersion, nil
}

// getLatestKubernetesVersionClusterModel returns a cluster model with the latest GA Kubernetes version.
func getLatestKubernetesVersionClusterModel(ctx context.Context, name, location, k8sSystemPoolSKU string) (*armcontainerservice.ManagedCluster, error) {
version, err := getLatestGAKubernetesVersion(ctx, location)
Expand All @@ -85,26 +34,52 @@ func getLatestKubernetesVersionClusterModel(ctx context.Context, name, location,
}

func getKubenetClusterModel(name, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
model := getBaseClusterModel(name, location, k8sSystemPoolSKU)
return kubenetClusterModelMutator(getBaseClusterModel(name, location, k8sSystemPoolSKU))
}

func getAzureOverlayNetworkClusterModel(name, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
return azureOverlayNetworkClusterModelMutator(getBaseClusterModel(name, location, k8sSystemPoolSKU))
}

func getAzureOverlayNetworkDualStackClusterModel(name, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
return azureOverlayNetworkClusterModelMutator(getBaseClusterModel(name, location, k8sSystemPoolSKU))
}

func getAzureNetworkClusterModel(name, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
return azureNetworkClusterModelMutator(getBaseClusterModel(name, location, k8sSystemPoolSKU))
}

func getCiliumNetworkClusterModel(name, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
return ciliumNetworkClusterModelMutator(getBaseClusterModel(name, location, k8sSystemPoolSKU))
}

func kubenetClusterModelMutator(model *armcontainerservice.ManagedCluster) *armcontainerservice.ManagedCluster {
model.Properties.NetworkProfile.NetworkPlugin = to.Ptr(armcontainerservice.NetworkPluginKubenet)
return model
}

func getAzureOverlayNetworkClusterModel(name, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
model := getBaseClusterModel(name, location, k8sSystemPoolSKU)
func azureNetworkClusterModelMutator(model *armcontainerservice.ManagedCluster) *armcontainerservice.ManagedCluster {
model.Properties.NetworkProfile.NetworkPlugin = to.Ptr(armcontainerservice.NetworkPluginAzure)
model.Properties.NetworkProfile.NetworkPluginMode = to.Ptr(armcontainerservice.NetworkPluginModeOverlay)
if model.Properties.AgentPoolProfiles != nil {
for _, app := range model.Properties.AgentPoolProfiles {
app.MaxPods = to.Ptr[int32](30)
}
}
return model
}

func getAzureOverlayNetworkDualStackClusterModel(name, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
model := getAzureOverlayNetworkClusterModel(name, location, k8sSystemPoolSKU)
func azureOverlayNetworkClusterModelMutator(model *armcontainerservice.ManagedCluster) *armcontainerservice.ManagedCluster {
model.Properties.NetworkProfile.NetworkPlugin = to.Ptr(armcontainerservice.NetworkPluginAzure)
model.Properties.NetworkProfile.NetworkPluginMode = to.Ptr(armcontainerservice.NetworkPluginModeOverlay)
return model
}

func azureOverlayNetworkDualStackClusterModelMutator(model *armcontainerservice.ManagedCluster) *armcontainerservice.ManagedCluster {
model = azureOverlayNetworkClusterModelMutator(model)
model.Properties.NetworkProfile.IPFamilies = []*armcontainerservice.IPFamily{
to.Ptr(armcontainerservice.IPFamilyIPv4),
to.Ptr(armcontainerservice.IPFamilyIPv6),
}

networkProfile := model.Properties.NetworkProfile
networkProfile.PodCidr = to.Ptr("10.244.0.0/16")
networkProfile.PodCidrs = []*string{
Expand All @@ -116,31 +91,19 @@ func getAzureOverlayNetworkDualStackClusterModel(name, location, k8sSystemPoolSK
networkProfile.ServiceCidr,
to.Ptr("fd12:3456:789a:1::/108"),
}

return model
}

func getAzureNetworkClusterModel(name, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
cluster := getBaseClusterModel(name, location, k8sSystemPoolSKU)
cluster.Properties.NetworkProfile.NetworkPlugin = to.Ptr(armcontainerservice.NetworkPluginAzure)
if cluster.Properties.AgentPoolProfiles != nil {
for _, app := range cluster.Properties.AgentPoolProfiles {
app.MaxPods = to.Ptr[int32](30)
}
}
return cluster
}
func getCiliumNetworkClusterModel(name, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
cluster := getBaseClusterModel(name, location, k8sSystemPoolSKU)
cluster.Properties.NetworkProfile.NetworkPlugin = to.Ptr(armcontainerservice.NetworkPluginAzure)
cluster.Properties.NetworkProfile.NetworkDataplane = to.Ptr(armcontainerservice.NetworkDataplaneCilium)
cluster.Properties.NetworkProfile.NetworkPolicy = to.Ptr(armcontainerservice.NetworkPolicyCilium)
if cluster.Properties.AgentPoolProfiles != nil {
for _, app := range cluster.Properties.AgentPoolProfiles {
func ciliumNetworkClusterModelMutator(model *armcontainerservice.ManagedCluster) *armcontainerservice.ManagedCluster {
model.Properties.NetworkProfile.NetworkPlugin = to.Ptr(armcontainerservice.NetworkPluginAzure)
model.Properties.NetworkProfile.NetworkDataplane = to.Ptr(armcontainerservice.NetworkDataplaneCilium)
model.Properties.NetworkProfile.NetworkPolicy = to.Ptr(armcontainerservice.NetworkPolicyCilium)
if model.Properties.AgentPoolProfiles != nil {
for _, app := range model.Properties.AgentPoolProfiles {
app.MaxPods = to.Ptr[int32](30)
}
}
return cluster
return model
}

func getBaseClusterModel(clusterName, location, k8sSystemPoolSKU string) *armcontainerservice.ManagedCluster {
Expand Down Expand Up @@ -192,6 +155,57 @@ func getBaseClusterModel(clusterName, location, k8sSystemPoolSKU string) *armcon
}
}

// getLatestGAKubernetesVersion returns the highest GA Kubernetes version for the given location.
func getLatestGAKubernetesVersion(ctx context.Context, location string) (string, error) {
versions, err := config.Azure.AKS.ListKubernetesVersions(context.Background(), location, nil)
if err != nil {
return "", fmt.Errorf("failed to list Kubernetes versions: %w", err)
}
if len(versions.Values) == 0 {
return "", fmt.Errorf("no Kubernetes versions available")
}

var latestPatchVersion string
msg := fmt.Sprintf("Available Kubernetes versions for location %s:\n", location)
defer func() { toolkit.Logf(ctx, "%s", msg) }()
// Iterate through the available versions to find the latest GA version
for _, k8sVersion := range versions.Values {
if k8sVersion == nil {
continue
}
msg += fmt.Sprintf("- %s\n", *k8sVersion.Version)

// Skip preview versions
if k8sVersion.IsPreview != nil && *k8sVersion.IsPreview {
msg += " - - is in preview, skipping\n"
continue
}
for patchVersion := range k8sVersion.PatchVersions {
if patchVersion == "" {
continue
}
msg += fmt.Sprintf(" - - %s\n", patchVersion)
// Initialize latestVersion with first GA version found
if latestPatchVersion == "" {
latestPatchVersion = patchVersion
msg += fmt.Sprintf(" - - first latest found, updating to: %s\n", latestPatchVersion)
continue
}
// Compare versions
if agent.IsKubernetesVersionGe(patchVersion, latestPatchVersion) {
latestPatchVersion = patchVersion
msg += fmt.Sprintf(" - - new latest found, updating to: %s\n", latestPatchVersion)
}
}
}

if latestPatchVersion == "" {
return "", fmt.Errorf("no GA Kubernetes version found")
}
msg += fmt.Sprintf("Latest GA Kubernetes version for location %s: %s\n", location, latestPatchVersion)
return latestPatchVersion, nil
}

func getFirewall(ctx context.Context, location, firewallSubnetID, publicIPID string) *armnetwork.AzureFirewall {
var (
natRuleCollections []*armnetwork.AzureFirewallNatRuleCollection
Expand Down
36 changes: 34 additions & 2 deletions e2e/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,46 @@ var ClusterLatestKubernetesVersion = cachedFunc(clusterLatestKubernetesVersion)

// clusterLatestKubernetesVersion creates a cluster with the latest available Kubernetes version
func clusterLatestKubernetesVersion(ctx context.Context, request ClusterRequest) (*Cluster, error) {
model, err := getLatestKubernetesVersionClusterModel(ctx, "abe2e-latest-kubernetes-version-v2", request.Location, request.K8sSystemPoolSKU)
model, err := getLatestKubernetesVersionClusterModel(ctx, "abe2e-latest-k8s-v2", request.Location, request.K8sSystemPoolSKU)
if err != nil {
return nil, fmt.Errorf("getting latest kubernetes version cluster model: %w", err)
}
return prepareCluster(ctx, model, false, false)
}

var ClusterLatestKubernetesVersionKubenet = cachedFunc(clusterLatestKubernetesVersionKubenet)

func clusterLatestKubernetesVersionKubenet(ctx context.Context, request ClusterRequest) (*Cluster, error) {
model, err := getLatestKubernetesVersionClusterModel(ctx, "abe2e-latest-k8s-kubenet-v1", request.Location, request.K8sSystemPoolSKU)
if err != nil {
return nil, fmt.Errorf("getting latest kubernetes version cluster model: %w", err)
}
model = kubenetClusterModelMutator(model)
return prepareCluster(ctx, model, false, false)
}

var ClusterLatestKubernetesVersionAzureNetwork = cachedFunc(clusterLatestKubernetesVersionAzureNetwork)

func clusterLatestKubernetesVersionAzureNetwork(ctx context.Context, request ClusterRequest) (*Cluster, error) {
model, err := getLatestKubernetesVersionClusterModel(ctx, "abe2e-latest-k8s-azure-network-v1", request.Location, request.K8sSystemPoolSKU)
if err != nil {
return nil, fmt.Errorf("getting latest kubernetes version cluster model: %w", err)
}
model = azureNetworkClusterModelMutator(model)
return prepareCluster(ctx, model, false, false)
}

var ClusterLatestKubernetesVersionAzureOverlayNetworkDualStack = cachedFunc(clusterLatestKubernetesVersionAzureOverlayNetworkDualStack)

func clusterLatestKubernetesVersionAzureOverlayNetworkDualStack(ctx context.Context, request ClusterRequest) (*Cluster, error) {
model, err := getLatestKubernetesVersionClusterModel(ctx, "abe2e-latest-k8s-azure-overlay-dualstack-v1", request.Location, request.K8sSystemPoolSKU)
if err != nil {
return nil, fmt.Errorf("getting latest kubernetes version cluster model: %w", err)
}
model = azureOverlayNetworkDualStackClusterModelMutator(model)
return prepareCluster(ctx, model, false, false)
}

var ClusterKubenet = cachedFunc(clusterKubenet)

// clusterKubenet creates a basic cluster using kubenet networking with shared VNet
Expand Down Expand Up @@ -196,7 +229,6 @@ func clusterAzureOverlayNetwork(ctx context.Context, request ClusterRequest) (*C

var ClusterAzureOverlayNetworkDualStack = cachedFunc(clusterAzureOverlayNetworkDualStack)

// clusterAzureOverlayNetworkDualStack creates a dual-stack (IPv4+IPv6) Azure CNI Overlay cluster
func clusterAzureOverlayNetworkDualStack(ctx context.Context, request ClusterRequest) (*Cluster, error) {
model := getAzureOverlayNetworkDualStackClusterModel("abe2e-azure-overlay-dualstack-v6", request.Location, request.K8sSystemPoolSKU)
return prepareCluster(ctx, model, false, false)
Expand Down
Loading
Loading