From 66e71ac99b158b892f97617cec887d7e97bbc1a6 Mon Sep 17 00:00:00 2001 From: Mark Rossetti Date: Wed, 19 Jan 2022 12:17:48 -0800 Subject: [PATCH] feat: Add 1.24 support Signed-off-by: Mark Rossetti --- pkg/api/common/versions.go | 1 + pkg/api/defaults-kubelet.go | 7 +++ pkg/api/defaults-kubelet_test.go | 12 ++++ pkg/api/k8s_versions.go | 96 ++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+) diff --git a/pkg/api/common/versions.go b/pkg/api/common/versions.go index ff444ead0f..d4b8ce36bc 100644 --- a/pkg/api/common/versions.go +++ b/pkg/api/common/versions.go @@ -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 diff --git a/pkg/api/defaults-kubelet.go b/pkg/api/defaults-kubelet.go index f5a254f3a4..6f223b1a3b 100644 --- a/pkg/api/defaults-kubelet.go +++ b/pkg/api/defaults-kubelet.go @@ -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) { diff --git a/pkg/api/defaults-kubelet_test.go b/pkg/api/defaults-kubelet_test.go index 0ffa7d9bfc..5e53ca03a7 100644 --- a/pkg/api/defaults-kubelet_test.go +++ b/pkg/api/defaults-kubelet_test.go @@ -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 { diff --git a/pkg/api/k8s_versions.go b/pkg/api/k8s_versions.go index 717e37d97e..0605d89d7d 100644 --- a/pkg/api/k8s_versions.go +++ b/pkg/api/k8s_versions.go @@ -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", @@ -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", @@ -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,