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

Commit

Permalink
feat: add support for Kubernetes v1.21.0-alpha.1 (#4178)
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma authored Jan 20, 2021
1 parent 83b3b57 commit 1cd06c6
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .pipelines/pr-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ jobs:
containerRuntime: 'docker'
runSSHTests: true

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_21_docker_e2e'
k8sRelease: '1.21'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition.json'
createVNET: true
enableKMSEncryption: false
containerRuntime: 'docker'
runSSHTests: true

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_18_containerd_e2e'
Expand Down Expand Up @@ -117,3 +127,13 @@ jobs:
enableKMSEncryption: false
containerRuntime: 'containerd'
runSSHTests: true

- template: e2e-job-template.yaml
parameters:
name: 'k8s_1_21_containerd_e2e'
k8sRelease: '1.21'
apimodel: 'examples/e2e-tests/kubernetes/release/default/definition-no-vnet.json'
createVNET: false
enableKMSEncryption: false
containerRuntime: 'containerd'
runSSHTests: true
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defaultEnv = [
VALIDATE_CPU_LOAD: false,
] + params

def k8sVersions = ["1.16", "1.17", "1.18", "1.19", "1.20"]
def k8sVersions = ["1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
def latestReleasedVersion = "1.20"
def tasks = [:]
def testConfigs = []
Expand Down
5 changes: 5 additions & 0 deletions cmd/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,11 @@ func TestExampleAPIModels(t *testing.T) {
apiModelPath: "../examples/kubernetes-releases/kubernetes1.20.json",
setArgs: defaultSet,
},
{
name: "1.21 example",
apiModelPath: "../examples/kubernetes-releases/kubernetes1.21.json",
setArgs: defaultSet,
},
{
name: "vmss",
apiModelPath: "../examples/kubernetes-vmss/kubernetes.json",
Expand Down
30 changes: 30 additions & 0 deletions examples/kubernetes-releases/kubernetes1.21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.21"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_D2_v3"
},
"agentPoolProfiles": [
{
"name": "agentpool1",
"count": 3,
"vmSize": "Standard_D2_v3"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
}
}
}
1 change: 1 addition & 0 deletions pkg/api/common/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ var AllKubernetesSupportedVersions = map[string]bool{
"1.20.0-rc.0": false,
"1.20.0": true,
"1.20.1": true,
"1.21.0-alpha.1": true,
}

// AllKubernetesSupportedVersionsAzureStack is a hash table of all supported Kubernetes version strings on Azure Stack
Expand Down
97 changes: 97 additions & 0 deletions pkg/api/k8s_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ func getDefaultImage(image, kubernetesImageBaseType string) string {
// The map supports GCR or MCR image string flavors
var kubernetesImageBaseVersionedImages = map[string]map[string]map[string]string{
common.KubernetesImageBaseTypeGCR: {
"1.21": {
common.AddonResizerComponentName: "addon-resizer:1.8.7",
common.MetricsServerAddonName: "metrics-server/metrics-server:v0.4.1",
common.AddonManagerComponentName: "kube-addon-manager-amd64:v9.1.1",
common.ClusterAutoscalerAddonName: "cluster-autoscaler:v1.18.0",
},
"1.20": {
common.AddonResizerComponentName: "addon-resizer:1.8.7",
common.MetricsServerAddonName: "metrics-server/metrics-server:v0.4.1",
Expand Down Expand Up @@ -227,6 +233,12 @@ var kubernetesImageBaseVersionedImages = map[string]map[string]map[string]string
},
},
common.KubernetesImageBaseTypeMCR: {
"1.21": {
common.AddonResizerComponentName: "oss/kubernetes/autoscaler/addon-resizer:1.8.7",
common.MetricsServerAddonName: "oss/kubernetes/metrics-server:v0.3.7",
common.AddonManagerComponentName: "oss/kubernetes/kube-addon-manager:v9.1.1",
common.ClusterAutoscalerAddonName: "oss/kubernetes/autoscaler/cluster-autoscaler:v1.19.1",
},
"1.20": {
common.AddonResizerComponentName: "oss/kubernetes/autoscaler/addon-resizer:1.8.7",
common.MetricsServerAddonName: "oss/kubernetes/metrics-server:v0.3.7",
Expand Down Expand Up @@ -455,6 +467,91 @@ func getK8sVersionComponents(version, kubernetesImageBaseType string, overrides
var ret map[string]string
k8sComponent := kubernetesImageBaseVersionedImages[kubernetesImageBaseType][majorMinor]
switch majorMinor {
case "1.21":
ret = map[string]string{
common.APIServerComponentName: getDefaultImage(common.APIServerComponentName, kubernetesImageBaseType) + ":v" + version,
common.ControllerManagerComponentName: getDefaultImage(common.ControllerManagerComponentName, kubernetesImageBaseType) + ":v" + version,
common.KubeProxyAddonName: getDefaultImage(common.KubeProxyAddonName, kubernetesImageBaseType) + ":v" + version,
common.SchedulerComponentName: getDefaultImage(common.SchedulerComponentName, kubernetesImageBaseType) + ":v" + version,
common.CloudControllerManagerComponentName: azureCloudControllerManagerImageReference,
common.CloudNodeManagerAddonName: azureCloudNodeManagerImageReference,
common.WindowsArtifactComponentName: "v" + version + "/windowszip/v" + version + "-1int.zip",
common.WindowsArtifactAzureStackComponentName: "v" + version + common.AzureStackSuffix + "/windowszip/v" + version + common.AzureStackSuffix + "-1int.zip",
common.DashboardAddonName: dashboardImageReference,
common.DashboardMetricsScraperContainerName: dashboardMetricsScraperImageReference,
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.CoreDNSAddonName: getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
common.CoreDNSAutoscalerName: clusterProportionalAutoscalerImageReference,
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
common.DNSSidecarComponentName: getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
common.CiliumEtcdOperatorContainerName: ciliumEtcdOperatorImageReference,
common.AntreaControllerContainerName: antreaControllerImageReference,
common.AntreaAgentContainerName: antreaAgentImageReference,
common.AntreaOVSContainerName: antreaOVSImageReference,
"antrea" + common.AntreaInstallCNIContainerName: antreaInstallCNIImageReference,
common.NMIContainerName: aadPodIdentityNMIImageReference,
common.MICContainerName: aadPodIdentityMICImageReference,
common.AzurePolicyAddonName: azurePolicyImageReference,
common.GatekeeperContainerName: gatekeeperImageReference,
common.NodeProblemDetectorAddonName: nodeProblemDetectorImageReference,
common.CSIProvisionerContainerName: csiProvisionerImageReference,
common.CSIAttacherContainerName: csiAttacherImageReference,
common.CSILivenessProbeContainerName: csiLivenessProbeImageReference,
common.CSILivenessProbeWindowsContainerName: csiLivenessProbeWindowsImageReference,
common.CSINodeDriverRegistrarContainerName: csiNodeDriverRegistrarImageReference,
common.CSINodeDriverRegistrarWindowsContainerName: csiNodeDriverRegistrarWindowsImageReference,
common.CSISnapshotterContainerName: csiSnapshotterImageReference,
common.CSISnapshotControllerContainerName: csiSnapshotControllerImageReference,
common.CSIResizerContainerName: csiResizerImageReference,
common.CSIAzureDiskContainerName: csiAzureDiskImageReference,
common.CSIAzureFileContainerName: csiAzureFileImageReference,
common.KubeFlannelContainerName: kubeFlannelImageReference,
"flannel" + common.FlannelInstallCNIContainerName: flannelInstallCNIImageReference,
common.KubeRBACProxyContainerName: KubeRBACProxyImageReference,
common.ScheduledMaintenanceManagerContainerName: ScheduledMaintenanceManagerImageReference,
"nodestatusfreq": DefaultKubernetesNodeStatusUpdateFrequency,
"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
"podeviction": DefaultKubernetesCtrlMgrPodEvictionTimeout,
"routeperiod": DefaultKubernetesCtrlMgrRouteReconciliationPeriod,
"backoffretries": strconv.Itoa(DefaultKubernetesCloudProviderBackoffRetries),
"backoffjitter": strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffJitter, 'f', -1, 64),
"backoffduration": strconv.Itoa(DefaultKubernetesCloudProviderBackoffDuration),
"backoffexponent": strconv.FormatFloat(DefaultKubernetesCloudProviderBackoffExponent, 'f', -1, 64),
"ratelimitqps": strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPS, 'f', -1, 64),
"ratelimitqpswrite": strconv.FormatFloat(DefaultKubernetesCloudProviderRateLimitQPSWrite, 'f', -1, 64),
"ratelimitbucket": strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucket),
"ratelimitbucketwrite": strconv.Itoa(DefaultKubernetesCloudProviderRateLimitBucketWrite),
"gchighthreshold": strconv.Itoa(DefaultKubernetesGCHighThreshold),
"gclowthreshold": strconv.Itoa(DefaultKubernetesGCLowThreshold),
common.NVIDIADevicePluginAddonName: nvidiaDevicePluginImageReference,
common.CSISecretsStoreProviderAzureContainerName: csiSecretsStoreProviderAzureImageReference,
common.CSISecretsStoreDriverContainerName: csiSecretsStoreDriverImageReference,
common.AzureArcOnboardingAddonName: azureArcOnboardingImageReference,
common.AzureKMSProviderComponentName: azureKMSProviderImageReference,
}
case "1.20":
ret = map[string]string{
common.APIServerComponentName: getDefaultImage(common.APIServerComponentName, kubernetesImageBaseType) + ":v" + version,
Expand Down
3 changes: 2 additions & 1 deletion vhd/packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ function Get-FilesToCacheOnVHD {
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.19.6/windowszip/v1.19.6-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.19.7/windowszip/v1.19.7-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.20.0/windowszip/v1.20.0-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.20.1/windowszip/v1.20.1-1int.zip"
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.20.1/windowszip/v1.20.1-1int.zip",
"https://kubernetesartifacts.azureedge.net/kubernetes/v1.21.0-alpha.1/windowszip/v1.21.0-alpha.1-1int.zip"
);
"c:\akse-cache\win-vnet-cni\" = @(
"https://kubernetesartifacts.azureedge.net/azure-cni/v1.1.6/binaries/azure-vnet-cni-singletenancy-windows-amd64-v1.1.6.zip",
Expand Down
1 change: 1 addition & 0 deletions vhd/packer/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ pullContainerImage "docker" "busybox"
echo " - busybox" >> ${VHD_LOGS_FILEPATH}

K8S_VERSIONS="
1.21.0-alpha.1
1.20.1
1.20.0
1.19.7
Expand Down

0 comments on commit 1cd06c6

Please sign in to comment.