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

Commit

Permalink
feat: Add 1.24 support (#4813)
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
  • Loading branch information
marosset authored Jan 20, 2022
1 parent 8f41133 commit a9b67a4
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/api/common/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ var AllKubernetesSupportedVersions = map[string]bool{
"1.23.0-rc.1": false,
"1.23.0": false,
"1.23.1": true,
"1.24.0-alpha": true, // this does not actually exist but is needed to unblock k/k tests
}

// AllKubernetesSupportedVersionsAzureStack is a hash table of all supported Kubernetes version strings on Azure Stack
Expand Down
7 changes: 7 additions & 0 deletions pkg/api/defaults-kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ func removeKubeletFlags(k map[string]string, v string) {
delete(k, key)
}
}

// Remove dockershim related flags in v1.24 and up
if common.IsKubernetesVersionGe(v, "1.24.0-alpha") {
for _, key := range []string{"--image-pull-progress-deadline", "--network-plugin"} {
delete(k, key)
}
}
}

func setMissingKubeletValues(p *KubernetesConfig, d map[string]string) {
Expand Down
12 changes: 12 additions & 0 deletions pkg/api/defaults-kubelet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2420,6 +2420,18 @@ func TestRemoveKubeletFlags(t *testing.T) {
},
version: "1.9.0",
},
{
name: "v1.24.0",
kubeletConfig: map[string]string{
"--image-pull-progress-deadline": "30m",
"--network-plugin": "cni",
"--pod-max-pids": "100",
},
expected: map[string]string{
"--pod-max-pids": "100",
},
version: "1.24.0-alpha",
},
}

for _, c := range cases {
Expand Down
96 changes: 96 additions & 0 deletions pkg/api/k8s_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,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.24": {
common.AddonResizerComponentName: "addon-resizer:1.8.7",
common.MetricsServerAddonName: "metrics-server/metrics-server:v0.5.0",
common.AddonManagerComponentName: "kube-addon-manager-amd64:v9.1.5",
common.ClusterAutoscalerAddonName: "cluster-autoscaler:v1.18.0",
},
"1.23": {
common.AddonResizerComponentName: "addon-resizer:1.8.7",
common.MetricsServerAddonName: "metrics-server/metrics-server:v0.5.0",
Expand Down Expand Up @@ -244,6 +250,12 @@ var kubernetesImageBaseVersionedImages = map[string]map[string]map[string]string
},
},
common.KubernetesImageBaseTypeMCR: {
"1.24": {
common.AddonResizerComponentName: "oss/kubernetes/autoscaler/addon-resizer:1.8.7",
common.MetricsServerAddonName: "oss/kubernetes/metrics-server:v0.5.2",
common.AddonManagerComponentName: "oss/kubernetes/kube-addon-manager:v9.1.5",
common.ClusterAutoscalerAddonName: "oss/kubernetes/autoscaler/cluster-autoscaler:v1.22.1",
},
"1.23": {
common.AddonResizerComponentName: "oss/kubernetes/autoscaler/addon-resizer:1.8.7",
common.MetricsServerAddonName: "oss/kubernetes/metrics-server:v0.5.2",
Expand Down Expand Up @@ -490,6 +502,90 @@ func getK8sVersionComponents(version, kubernetesImageBaseType string, overrides
var ret map[string]string
k8sComponent := kubernetesImageBaseVersionedImages[kubernetesImageBaseType][majorMinor]
switch majorMinor {
case "1.24":
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: "oss/kubernetes/azure-cloud-controller-manager:v1.1.3",
common.CloudNodeManagerAddonName: "oss/kubernetes/azure-cloud-node-manager:v1.1.3",
common.WindowsArtifactComponentName: "v" + version + "/windowszip/v" + version + "-1int.zip",
common.WindowsArtifactAzureStackComponentName: "v" + version + "/windowszip/v" + version + "-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.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.23":
ret = map[string]string{
common.APIServerComponentName: getDefaultImage(common.APIServerComponentName, kubernetesImageBaseType) + ":v" + version,
Expand Down

0 comments on commit a9b67a4

Please sign in to comment.