-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Instruction
{
"KubernetesVersion": "1.33.5",
"RemovedFeatureGates": ["AdmissionWebhookMatchConditions", "AggregatedDiscoveryEndpoint", "APIListChunking", "AppArmor", "AppArmorFields", "CPUManager", "DisableCloudProviders", "DisableKubeletCloudCredentialProviders", "EfficientWatchResumption", "JobPodFailurePolicy", "KubeProxyDrainingTerminatingNodes", "PDBUnhealthyPodEvictionPolicy", "PersistentVolumeLastPhaseTransitionTime", "RemainingItemCount", "VolumeCapacityPriority", "WatchBookmark"],
"K8sCSIAncillaryImages":{
"csi-provisioner": "v5.3.0",
"csi-attacher": "v4.9.0",
"csi-livenessprobe": "v2.16.0",
"csi-node-driver-registrar": "v2.14.0",
"csi-snapshotter": "v8.3.0",
"csi-snapshot-controller": "v8.3.0",
"csi-resizer": "v1.14.0",
"azuredisk-csi": "v1.33.4",
"addon-resizer": "1.8.23",
"metrics-server": "v0.8.0",
"kube-addon-manager": "v9.1.8",
"cluster-autoscaler": "v1.33.1"
},
"AzureCloudManagerImages":{
"azure-cloud-controller-manager":"v1.33.1",
"azure-cloud-node-manager":"v1.33.0"
}
}Input Validation
- Retrieve the Kubernetes version from the "KubernetesVersion" field in the JSON and assign it to the
$KubernetesVersionvariable. - Retrieve the removed feature gates from the "RemovedFeatureGates" array in the JSON and assign it to the
$RemovedFeatureGatesvariable. - Retrieve the CSI and ancillary component images from the "K8sCSIAncillaryImages" field in the JSON and assign it to the
$K8sCSIAncillaryImagesvariable. - Retrieve the CSI and ancillary component images from the "AzureCloudManagerImages" field in the JSON and assign it to the
$AzureCloudManagerImagesvariable.
Processing Rule
- Process exactly one level-2 section (## ...) at a time.
- Within that section, handle impacted files strictly one file at a time, in the order listed.
- For each impacted file:
- Use only the variables ($KubernetesVersion, $RemovedFeatureGates) from the JSON block.
- Open/read the current file only; do not open/read any other impacted files yet.
- Apply the current section's "Implementation Guidance" to this file and save.
- Close the file and move to the next impacted file.
- Remove loaded file from current context
- After processing each impacted file, clear all loaded context/state for that file
- Do not pre-scan, open, or read all impacted files up front; operate strictly file-by-file.
- Finish all edits for the current section before starting the next.
- After completing a section:
- Keep only the variables; clear the context and discard everything else.
- Proceed to the next level-2 section in order.
Update supported and default Version
Description
Supported Kubernetes versions are declared in versions.go as version-to-bool maps, where true means allowed for new cluster creation.
Impacted Files
- pkg/api/common/versions.go
- pkg/api/common/const.go
Implementation Guidance
$KubernetesVersionmust follow the format[MAJOR].[MINOR].[REVISION](for example,1.32.10).- In
pkg/api/common/versions.go, update the following maps:AllKubernetesSupportedVersionsAllKubernetesSupportedVersionsAzureStackAllKubernetesWindowsSupportedVersionsAzureStack
- In
pkg/api/common/const.go, update the following constants:KubernetesDefaultReleaseKubernetesDefaultReleaseWindowsKubernetesDefaultReleaseAzureStackKubernetesDefaultReleaseWindowsAzureStack
- Logic: 0. Pre-check: If the exact
$KubernetesVersionkey ([MAJOR].[MINOR].[REVISION]) already exists in the target map(s), skip all updates (no changes toversions.goorconst.go).- For each map, check whether a placeholder key for the same minor exists:
[MAJOR].[MINOR].X. - If it exists (same minor):
- In
versions.go:- Set the existing
[MAJOR].[MINOR].Xentry tofalse. - Insert the exact
$KubernetesVersionentry directly below it and set totrue. - Keep entries grouped by minor and sorted in ascending version order;
- Set the existing
- In
const.go:- No changes (defaults do not change when there is no new minor).
- In
- If it does not exist (new minor):
- In
versions.go:- Add the exact
$KubernetesVersionentry (in source order) and set totrue. - Set the oldest currently creatable minor
[MAJOR].[MINOR-2].Xtofalseso only the latest two minors remain creatable.
- Add the exact
- In
const.go:- Set the default release constants to
[MAJOR].[MINOR-1](major.minor only, no patch).
- Set the default release constants to
- In
- For each map, check whether a placeholder key for the same minor exists:
Remove invalid feature gates
Keep only the variables; clear the context and discard everything else.
Description
Feature gates may be removed or graduate to GA in new Kubernetes minor versions. For the target version ($KubernetesVersion), remove any gates listed in $RemovedFeatureGates that are no longer valid from all component defaults to prevent invalid-flag errors and warnings.
Impacted Files
- `pkg/api/defaults-kubelet.go`
- `pkg/api/defaults-controller-manager.go`
- `pkg/api/defaults-cloud-controller-manager.go`
- `pkg/api/defaults-apiserver.go`
- `pkg/api/defaults-scheduler.go`
Implementation Guidance
-
$KubernetesVersionmust follow the format[MAJOR].[MINOR].[REVISION]. -
Iterate through the feature gates listed in
$RemovedFeatureGates, and check whether a guard likecommon.IsKubernetesVersionGe(o.OrchestratorVersion, "[MAJOR].[MINOR].0")already exists in the source code.- If such a guard exists, do not change the source code.
- If it does not exist, add the guard for
"[MAJOR].[MINOR].0"and remove the feature gate inside that guard.
-
Example:
(Note: The revision is always0in the comparison)if common.IsKubernetesVersionGe(o.OrchestratorVersion, "[MAJOR].[MINOR].0") { // Remove the invalid feature gate here }
-
When you change the source code:
-
Add a new unit test at the bottom of the corresponding test file to verify that the removed feature gates are sanitized correctly.
- Name the test
Test[Component]FeatureGates[Major][Minor]. For example: forpkg/api/defaults-apiserver.go, the test file ispkg/api/defaults-apiserver_test.go, and[Component]isAPIServer. - Code example for removed feature gates: "[FeatureGatePlaceHolder01],[FeatureGatePlaceHolder02]". Do not reuse patterns from existing tests; ensure your test follows the validation logic shown in this example:
func TestAPIServerFeatureGates[Major][Minor](t *testing.T) { // test user-overrides, removal of feature gates for k8s versions >= [Major][Minor] cs = CreateMockContainerService("testcluster", defaultTestClusterVer, 3, 2, false) cs.Properties.OrchestratorProfile.OrchestratorVersion = "[Major][Minor].0" cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig = make(map[string]string) a = cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig featuregate[Major][Minor] := "[FeatureGatePlaceHolder01]=true,[FeatureGatePlaceHolder02]=true" a["--feature-gates"] = featuregate[Major][Minor] cs.set[Component]Config() // split both strings by ", " and ensure no original item exists in the sanitized list originalList := strings.Split(featuregate131, ",") sanitizedList := strings.Split(a["--feature-gates"], ",") for _, of := range originalList { for _, sf := range sanitizedList { if of == sf { t.Fatalf("feature-gate %q should not exist in sanitized list for %s\nfeaturegate[Major][Minor] (original): %q\nfeaturegate[Major][Minor]Sanitized (actual): %q", sf, "[Major][Minor]", featuregate131, a["--feature-gates"]) } } } // test user-overrides, no removal of feature gates for k8s versions < [Major][Minor-1] cs = CreateMockContainerService("testcluster", defaultTestClusterVer, 3, 2, false) cs.Properties.OrchestratorProfile.OrchestratorVersion = "1.[Major][Minor-1].0" cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig = make(map[string]string) a = cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig a["--feature-gates"] = featuregate[Major][Minor] cs.set[Component]Config() actualList := strings.Split(a["--feature-gates"], ",") expectedList := strings.Split(featuregate[Major][Minor], ",") for _, exp := range expectedList { found := false for _, act := range actualList { if act == exp { found = true break } } if !found { t.Fatalf("missing feature-gate %q in actual '--feature-gates' for %s\nfeaturegate[Major][Minor-1] (expected subset): %q\nactual: %q", exp, "[Major][Minor-1].0", featuregate131, a["--feature-gates"]) } } }
- Name the test
-
Add or update k8s CSI and ancillary images
Keep only the variables; clear the context and discard everything else.
Description
Container Storage Interface (CSI) and ancillary component images need to be updated for new Kubernetes versions. These images include CSI drivers (provisioner, attacher, liveness probe, node driver registrar, snapshotter, snapshot controller, resizer), Azure-specific CSI drivers (Azure Disk, Azure File), and other supporting components that are version-specific.
Impacted Files
- `pkg/api/k8s_versions.go`
Implementation Guidance
$KubernetesVersionmust follow the format[MAJOR].[MINOR].[REVISION](for example,1.32.10).- In
pkg/api/k8s_versions.go, update thekubernetesImageBaseVersionedImagesmap for bothcommon.KubernetesImageBaseTypeGCRandcommon.KubernetesImageBaseTypeMCRsections. - Logic:
- Extract the major.minor version from
$KubernetesVersion(e.g.,1.32from1.32.10). - Check if an entry for
"[MAJOR].[MINOR]"already exists in thekubernetesImageBaseVersionedImagesmap. - If it exists:
- Review and update CSI component versions if newer versions are available.
- Update Azure-specific components (Azure Disk CSI) to compatible versions.
- If it does not exist (new minor version):
- Copy the most recent minor version's entries as a template.
- Add a new entry for
"[MAJOR].[MINOR]"in both GCR and MCR sections. - Update all CSI component image versions based on
$K8sCSIAncillaryImagesfor the new Kubernetes version:common.CSIProvisionerContainerName: use "csi-provisioner" value from$K8sCSIAncillaryImagescommon.CSIAttacherContainerName: use "csi-attacher" value from$K8sCSIAncillaryImagescommon.CSILivenessProbeContainerName: use "csi-livenessprobe" value from$K8sCSIAncillaryImagescommon.CSILivenessProbeWindowsContainerName: use "csi-livenessprobe" value from$K8sCSIAncillaryImagescommon.CSINodeDriverRegistrarContainerName: use "csi-node-driver-registrar" value from$K8sCSIAncillaryImagescommon.CSINodeDriverRegistrarWindowsContainerName: use "csi-node-driver-registrar" value from$K8sCSIAncillaryImagescommon.CSISnapshotterContainerName: use "csi-snapshotter" value from$K8sCSIAncillaryImagescommon.CSISnapshotControllerContainerName: use "csi-snapshot-controller" value from$K8sCSIAncillaryImagescommon.CSIResizerContainerName: use "csi-resizer" value from$K8sCSIAncillaryImagescommon.CSIAzureDiskContainerName: use "azuredisk-csi" value from$K8sCSIAncillaryImages
- Update other ancillary components using corresponding values from
$K8sCSIAncillaryImages:common.AddonResizerComponentName: use "addon-resizer" valuecommon.MetricsServerAddonName: use "metrics-server" valuecommon.AddonManagerComponentName: use "kube-addon-manager" valuecommon.ClusterAutoscalerAddonName: use "cluster-autoscaler" value
- For GCR images, prefix with appropriate registry path (e.g., "oss/kubernetes-csi/", "addon-resizer:", etc.)
- For MCR images, prefix with "oss/kubernetes/" or "oss/kubernetes-csi/" as appropriate
- Add a new case for
"[MAJOR].[MINOR]"in thegetK8sVersionComponentsfunction:- Copy the most recent minor version's case as a template
- Update the following Azure Cloud Manager images using values from
$AzureCloudManagerImages:common.CloudControllerManagerComponentName: use "azure-cloud-controller-manager" valuecommon.CloudNodeManagerAddonName: use "azure-cloud-node-manager" value (if present)
- Ensure all CSI component references use
k8sComponent[common.CSIComponentName]pattern to leverage the versioned images from the map
- Extract the major.minor version from
Update VHD install dependencies for k8s CSI and ancillary images
Keep only the variables; clear the context and discard everything else.
Description
The VHD build script install-dependencies.sh pre-pulls container images and installs binaries for Kubernetes versions and their associated CSI/ancillary components. When adding support for a new Kubernetes version, the script needs to be updated to include the appropriate component versions and container images that will be available in the VHD.
Impacted Files
- `vhd/packer/install-dependencies.sh`
Implementation Guidance
$KubernetesVersionmust follow the format[MAJOR].[MINOR].[REVISION](for example,1.32.10).- In
vhd/packer/install-dependencies.sh, update the version arrays and container image pull sections to include components for the new Kubernetes version. - Logic:
-
Get the supported Kubernetes versions from
pkg/api/common/versions.go:- Read the
AllKubernetesSupportedVersionsAzureStackmap - Extract all keys where the value is
trueinto an array and assign to variable$KubernetesSupportedVersionsAzureStack - These represent the currently supported Kubernetes versions for Azure Stack
- Read the
-
Update the
K8S_VERSIONSarray:- Replace the existing array content with values from
$KubernetesSupportedVersionsAzureStack - Sort versions in descending order (newest first) by semantic version
- Replace the existing array content with values from
-
Update CSI component version arrays using versions from the
kubernetesImageBaseVersionedImagesmap:- For each Kubernetes version in
$KubernetesSupportedVersionsAzureStack, extract the major.minor (e.g., "1.32" from "1.32.10") - From
pkg/api/k8s_versions.go, read thekubernetesImageBaseVersionedImagesmap for the corresponding major.minor version - Extract the image versions (removing registry paths and prefixes and "v" prefix) and collect them for the respective arrays:
AZUREDISK_CSI_VERSIONS: extract version fromcommon.CSIAzureDiskContainerNameimageCSI_ATTACHER_VERSIONS: extract version fromcommon.CSIAttacherContainerNameimageCSI_NODE_DRIVER_REGISTRAR_VERSIONS: extract version fromcommon.CSINodeDriverRegistrarContainerNameimageCSI_PROVISIONER_VERSIONS: extract version fromcommon.CSIProvisionerContainerNameimageLIVENESSPROBE_VERSIONS: extract version fromcommon.CSILivenessProbeContainerNameimageCSI_RESIZER_VERSIONS: extract version fromcommon.CSIResizerContainerNameimageCSI_SNAPSHOTTER_VERSIONS: extract version fromcommon.CSISnapshotterContainerNameimageSNAPSHOT_CONTROLLER_VERSIONS: extract version fromcommon.CSISnapshotControllerContainerNameimageMETRICS_SERVER_VERSIONS: extract version fromcommon.MetricsServerAddonNameimageKUBE_ADDON_MANAGER_VERSIONS: extract version fromcommon.AddonManagerComponentNameimageCLUSTER_AUTOSCALER_VERSIONS: extract version fromcommon.ClusterAutoscalerAddonNameimageCLUSTER_PROPORTIONAL_AUTOSCALER_VERSIONS: extract version fromcommon.AddonResizerComponentNameimage
- Important: Replace the entire array content with only the extracted versions (do not append to existing versions)
- Before updating the file, remove duplications in each array to ensure unique versions only
- Sort versions in descending order (newest first) by semantic version
- For each Kubernetes version in
-
Update Azure Cloud Manager version arrays using versions from the
getK8sVersionComponentsfunction:- For each Kubernetes version in
$KubernetesSupportedVersionsAzureStack, extract the major.minor (e.g., "1.32" from "1.32.10") - From
pkg/api/k8s_versions.go, read thegetK8sVersionComponentsfunction for the corresponding major.minor version case - Extract the image versions (removing registry paths and prefixes and "v" prefix) and collect them for the respective arrays:
CLOUD_CONTROLLER_MANAGER_VERSIONS: extract version fromcommon.CloudControllerManagerComponentNameimageCLOUD_NODE_MANAGER_VERSIONS: extract version fromcommon.CloudNodeManagerAddonNameimage (if present)
- Important: Replace the entire array content with only the extracted versions (do not append to existing versions)
- Before updating the file, remove duplications in each array to ensure unique versions only
- Sort versions in descending order (newest first) by semantic version
- For each Kubernetes version in
-
Update Windows VHD install dependencies for k8s CSI and ancillary images
Keep only the variables; clear the context and discard everything else.
Description
The Windows VHD build script configure-windows-vhd-phase2.ps1 pre-pulls container images for Kubernetes versions and their associated CSI/ancillary components. When adding support for a new Kubernetes version, the script needs to be updated to include the appropriate component versions and container images that will be available in the Windows VHD.
Impacted Files
- `vhd/packer/configure-windows-vhd-phase2.ps1`
Implementation Guidance
$KubernetesVersionmust follow the format[MAJOR].[MINOR].[REVISION](for example,1.32.10).- In
vhd/packer/configure-windows-vhd-phase2.ps1, update the$imagesToPullarray in theGet-ContainerImagesfunction to include container images for the new Kubernetes version. - Logic:
-
Get the supported Kubernetes versions from
pkg/api/common/versions.go:- Read the
AllKubernetesSupportedVersionsAzureStackmap - Extract all keys where the value is
trueinto an array and assign to variable$KubernetesSupportedVersionsAzureStack - These represent the currently supported Kubernetes versions for Azure Stack
- Read the
-
Extract CSI and ancillary component images from
pkg/api/k8s_versions.go:- For each Kubernetes version in
$KubernetesSupportedVersionsAzureStack, extract the major.minor (e.g., "1.32" from "1.32.10") - From the
kubernetesImageBaseVersionedImagesmap forcommon.KubernetesImageBaseTypeMCR, collect the following Windows-compatible images:- Azure Disk CSI images:
common.CSIAzureDiskContainerName(both regular and-windows-hpvariants) - CSI Node Driver Registrar images:
common.CSINodeDriverRegistrarWindowsContainerName - CSI Liveness Probe images:
common.CSILivenessProbeWindowsContainerName
- Azure Disk CSI images:
- From the
getK8sVersionComponentsfunction for the corresponding major.minor version case:- Azure Cloud Node Manager images:
common.CloudNodeManagerAddonName
- Azure Cloud Node Manager images:
- For each Kubernetes version in
-
Update the
$imagesToPullarray in theGet-ContainerImagesfunction:- Important: Replace the entire array content with a complete set of images (do not append to existing images)
- Include Windows base images (these should remain constant):
"mcr.microsoft.com/windows/servercore:ltsc2019""mcr.microsoft.com/windows/nanoserver:1809""mcr.microsoft.com/oss/kubernetes/pause:3.8""mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0"
- Include all extracted CSI and ancillary component images from step 2
- For Azure Disk CSI images, include both regular and Windows Host Process (
-windows-hp) variants when available - Before updating the file, remove duplications in the array to ensure unique images only
- Sort images alphabetically for consistency
-
Update the Kubernetes binaries download URLs in the
Get-FilesToCacheOnVHDfunction:- In the
"c:\akse-cache\win-k8s\"section of the$mapvariable - Important: Replace the entire URL list with URLs for supported Kubernetes versions
- For each version in
$KubernetesSupportedVersionsAzureStack, add the corresponding download URL:- Format:
"https://packages.aks.azure.com/kubernetes/v{VERSION}/windowszip/v{VERSION}-1int.zip" - Where
{VERSION}is the full Kubernetes version (e.g., "1.32.10")
- Format:
- Sort URLs in descending order by version (newest first)
- In the
-
Update the ACR Credential Provider URLs in the
$acrCredentialProviderUrlsarray:- For each Kubernetes version in
$KubernetesSupportedVersionsAzureStack, extract the major.minor (e.g., "1.32" from "1.32.10") - From the
getK8sVersionComponentsfunction, find the Azure Cloud Controller Manager version for the corresponding major.minor - Important: Replace the entire array content with entries for supported Kubernetes versions
- Format each entry as:
@{ Url = "https://github.com/kubernetes-sigs/cloud-provider-azure/releases/download/v{ACR_VERSION}/azure-acr-credential-provider-windows-amd64.exe"; K8sVersion = "v{MAJOR}.{MINOR}" } - Where
{ACR_VERSION}is the Azure Cloud Controller Manager version and{MAJOR}.{MINOR}is the Kubernetes major.minor version - Sort entries in descending order by Kubernetes version (newest first)
- For each Kubernetes version in
-
Update Windows VHD main script for k8s CSI and ancillary images
Keep only the variables; clear the context and discard everything else.
Description
The main Windows VHD build script configure-windows-vhd.ps1 also contains container image configuration and Kubernetes binary caching logic that needs to be updated when adding support for new Kubernetes versions. This script differs from the phase2 script as it has conditional logic based on Windows Server version (2019, 2004) and supports both containerd and docker container runtimes.
Impacted Files
- `vhd/packer/configure-windows-vhd.ps1`
Implementation Guidance
$KubernetesVersionmust follow the format[MAJOR].[MINOR].[REVISION](for example,1.32.10).- In
vhd/packer/configure-windows-vhd.ps1, update theGet-ContainerImagesfunction andGet-FilesToCacheOnVHDfunction to include components for the new Kubernetes version. - Logic:
-
Get the supported Kubernetes versions from
pkg/api/common/versions.go:- Read the
AllKubernetesSupportedVersionsAzureStackmap - Extract all keys where the value is
trueinto an array and assign to variable$KubernetesSupportedVersionsAzureStack - These represent the currently supported Kubernetes versions for Azure Stack
- Read the
-
Extract CSI and ancillary component images from
pkg/api/k8s_versions.go:- For each Kubernetes version in
$KubernetesSupportedVersionsAzureStack, extract the major.minor (e.g., "1.32" from "1.32.10") - From the
kubernetesImageBaseVersionedImagesmap forcommon.KubernetesImageBaseTypeMCR, collect the following Windows-compatible images:- Azure Disk CSI images:
common.CSIAzureDiskContainerName(both regular and-windows-hpvariants) - CSI Node Driver Registrar images:
common.CSINodeDriverRegistrarWindowsContainerName - CSI Liveness Probe images:
common.CSILivenessProbeWindowsContainerName
- Azure Disk CSI images:
- From the
getK8sVersionComponentsfunction for the corresponding major.minor version case:- Azure Cloud Node Manager images:
common.CloudNodeManagerAddonName
- Azure Cloud Node Manager images:
- For each Kubernetes version in
-
Update the
$imagesToPullarrays in theGet-ContainerImagesfunction:- Important: Update images for Windows Server 2019 case only (do not modify 2004 case unless specifically needed)
- In the
'2019'switch case, replace the entire$imagesToPullarray content with:- Windows base images (these should remain constant):
"mcr.microsoft.com/windows/servercore:ltsc2019""mcr.microsoft.com/windows/nanoserver:1809""mcr.microsoft.com/oss/kubernetes/pause:3.8""mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0"
- All extracted CSI and ancillary component images from step 2
- For Azure Disk CSI images, include both regular and Windows Host Process (
-windows-hp) variants when available
- Windows base images (these should remain constant):
- Before updating the file, remove duplications in the array to ensure unique images only
- Sort images alphabetically for consistency
-
Update the Kubernetes binaries download URLs in the
Get-FilesToCacheOnVHDfunction:- In the
"c:\akse-cache\win-k8s\"section of the$mapvariable - Important: Replace the entire URL list with URLs for supported Kubernetes versions
- For each version in
$KubernetesSupportedVersionsAzureStack, add the corresponding download URL:- Format:
"https://packages.aks.azure.com/kubernetes/v{VERSION}/windowszip/v{VERSION}-1int.zip" - Where
{VERSION}is the full Kubernetes version (e.g., "1.32.10")
- Format:
- Sort URLs in descending order by version (newest first)
- In the
-
Note: Unlike the phase2 script, the main script does not have ACR Credential Provider URLs, so no updates are needed for that section.
-
Miscellaneous Changes
Keep only the variables; clear the context and discard everything else.
Description
Impacted Files
Implementation Guidance
$KubernetesVersionmust follow the format[MAJOR].[MINOR].[REVISION](for example,1.32.10).- Logic:
- Get the supported Kubernetes versions from
pkg/api/common/versions.go:
- Read theAllKubernetesSupportedVersionsAzureStackmap
- Extract all keys where the value istrueinto an array and assign to variable$KubernetesSupportedVersionsAzureStack
- Sort the versions in descending order (newest first) - Read
examples/azure-stack/kubernetes-azurestack.jsonandexamples/azure-stack/kubernetes-windows.json, set theorchestratorReleaseandorchestratorVersionvalues to the second last (penultimate) supported Kubernetes version in$KubernetesSupportedVersionsAzureStack(e.g., if supported versions are 1.32.10 and 1.31.11, use 1.31.11):
"orchestratorRelease": "1.31",
"orchestratorVersion": "1.31.11", - Read
hack/tools/Makefileand setKUBECTL_VERSIONto the second last supported Kubernetes version in$KubernetesSupportedVersionsAzureStackwith "v" prefix (e.g., "v1.31.11") - Create release example API model if not exist:
- Extract the major.minor version from
$KubernetesVersion(e.g.,1.32from1.32.10) - Check if the file
examples/kubernetes-releases/kubernetes[MAJOR].[MINOR].jsonalready exists - If the file does not exist, create it with the following JSON structure (replace
[MAJOR].[MINOR]with actual version like1.32):
{ "apiVersion": "vlabs", "properties": { "orchestratorProfile": { "orchestratorRelease": "[MAJOR].[MINOR]" }, "masterProfile": { "count": 1, "dnsPrefix": "", "vmSize": "Standard_D2_v3" }, "agentPoolProfiles": [ { "name": "agentpool1", "count": 3, "vmSize": "Standard_D2_v3" } ], "linuxProfile": { "adminUsername": "azureuser", "ssh": { "publicKeys": [ { "keyData": "" } ] } } } }- If the file already exists, skip creation (no changes needed)
- Extract the major.minor version from
- Update generate test examples for supported versions:
- Read
cmd/generate_test.goand locate theTestExampleAPIModelsfunction - In the
testsslice, find the entries that reference../examples/kubernetes-releases/kubernetes*.jsonfiles - Important: Replace the entire set of kubernetes-releases test entries with entries for all supported Kubernetes versions
- For each major.minor version extracted from
$KubernetesSupportedVersionsAzureStack, add a test entry in the format:
{ name: "[MAJOR].[MINOR] example", apiModelPath: "../examples/kubernetes-releases/kubernetes[MAJOR].[MINOR].json", setArgs: defaultSet, },- Example: if supported versions are 1.32.10 and 1.31.11, add entries for "1.32 example" and "1.31 example"
- Sort entries in descending order by version (newest first)
- Ensure all other test entries in the slice remain unchanged
- Read
- Get the supported Kubernetes versions from