Merge pull request #108027 from neolit123/1.24-update-unversioned-kubelet-cm-fg

kubeadm: switch UnversionedKubeletConfigMap to true
This commit is contained in:
Kubernetes Prow Robot 2022-02-14 10:59:52 -08:00 committed by GitHub
commit d374c954de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 15 deletions

View File

@ -218,7 +218,7 @@ type NodeRegistrationOptions struct {
Taints []v1.Taint Taints []v1.Taint
// KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file // KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file
// kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap // kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config ConfigMap
// Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. // Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on.
// A key in this map is the flag name as it appears on the // A key in this map is the flag name as it appears on the
// command line except without leading dash(es). // command line except without leading dash(es).

View File

@ -207,7 +207,7 @@ type NodeRegistrationOptions struct {
Taints []v1.Taint `json:"taints"` Taints []v1.Taint `json:"taints"`
// KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file // KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file
// kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap // kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config ConfigMap
// Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. // Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on.
// A key in this map is the flag name as it appears on the // A key in this map is the flag name as it appears on the
// command line except without leading dash(es). // command line except without leading dash(es).

View File

@ -221,7 +221,7 @@ type NodeRegistrationOptions struct {
Taints []corev1.Taint `json:"taints"` Taints []corev1.Taint `json:"taints"`
// KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file // KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file
// kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap // kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config ConfigMap
// Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. // Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on.
// A key in this map is the flag name as it appears on the // A key in this map is the flag name as it appears on the
// command line except without leading dash(es). // command line except without leading dash(es).

View File

@ -49,8 +49,8 @@ var (
`) `)
uploadKubeletConfigLongDesc = cmdutil.LongDesc(` uploadKubeletConfigLongDesc = cmdutil.LongDesc(`
Upload kubelet configuration extracted from the kubeadm InitConfiguration object to a ConfigMap Upload the kubelet configuration extracted from the kubeadm InitConfiguration object
of the form kubelet-config-1.X in the cluster, where X is the minor version of the current (API Server) Kubernetes version. to a kubelet-config ConfigMap in the cluster
`) `)
uploadKubeletConfigExample = cmdutil.Examples(` uploadKubeletConfigExample = cmdutil.Examples(`

View File

@ -41,9 +41,7 @@ import (
var ( var (
kubeletConfigLongDesc = cmdutil.LongDesc(` kubeletConfigLongDesc = cmdutil.LongDesc(`
Download the kubelet configuration from a ConfigMap of the form "kubelet-config-1.X" in the cluster, Download the kubelet configuration from the kubelet-config ConfigMap stored in the cluster
where X is the minor version of the kubelet. kubeadm uses the KuberneteVersion field in the kubeadm-config
ConfigMap to determine what the _desired_ kubelet version is.
`) `)
) )

View File

@ -33,7 +33,7 @@ const (
PublicKeysECDSA = "PublicKeysECDSA" PublicKeysECDSA = "PublicKeysECDSA"
// RootlessControlPlane is expected to be in alpha in v1.22 // RootlessControlPlane is expected to be in alpha in v1.22
RootlessControlPlane = "RootlessControlPlane" RootlessControlPlane = "RootlessControlPlane"
// UnversionedKubeletConfigMap is expected to be alpha in 1.23 // UnversionedKubeletConfigMap is expected to be beta in 1.24
UnversionedKubeletConfigMap = "UnversionedKubeletConfigMap" UnversionedKubeletConfigMap = "UnversionedKubeletConfigMap"
) )
@ -41,7 +41,7 @@ const (
var InitFeatureGates = FeatureList{ var InitFeatureGates = FeatureList{
PublicKeysECDSA: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}}, PublicKeysECDSA: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}},
RootlessControlPlane: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}}, RootlessControlPlane: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}},
UnversionedKubeletConfigMap: {FeatureSpec: featuregate.FeatureSpec{Default: false, PreRelease: featuregate.Alpha}}, UnversionedKubeletConfigMap: {FeatureSpec: featuregate.FeatureSpec{Default: true, PreRelease: featuregate.Beta}},
} }
// Feature represents a feature being gated // Feature represents a feature being gated

View File

@ -262,7 +262,7 @@ func TestCreateKubeConfigFileIfNotExists(t *testing.T) {
kubeConfig: configWithAnotherClusterCa, kubeConfig: configWithAnotherClusterCa,
expectedError: true, expectedError: true,
}, },
{ // if KubeConfig is not equal to the existingKubeConfig - tollerate custom server addresses { // if KubeConfig is not equal to the existingKubeConfig - tolerate custom server addresses
name: "KubeConfig referst to the cluster with another address", name: "KubeConfig referst to the cluster with another address",
existingKubeConfig: config, existingKubeConfig: config,
kubeConfig: configWithAnotherClusterAddress, kubeConfig: configWithAnotherClusterAddress,
@ -484,7 +484,7 @@ func TestValidateKubeConfig(t *testing.T) {
configWithAnotherServerURL := setupdKubeConfigWithClientAuth(t, caCert, caKey, "https://4.3.2.1:4321", "test-cluster", "myOrg1") configWithAnotherServerURL := setupdKubeConfigWithClientAuth(t, caCert, caKey, "https://4.3.2.1:4321", "test-cluster", "myOrg1")
// create a valid config but with whitespace around the CA PEM. // create a valid config but with whitespace around the CA PEM.
// validateKubeConfig() should tollerate that. // validateKubeConfig() should tolerate that.
configWhitespace := config.DeepCopy() configWhitespace := config.DeepCopy()
configWhitespaceCtx := configWhitespace.Contexts[configWhitespace.CurrentContext] configWhitespaceCtx := configWhitespace.Contexts[configWhitespace.CurrentContext]
configWhitespaceCA := string(configWhitespace.Clusters[configWhitespaceCtx.Cluster].CertificateAuthorityData) configWhitespaceCA := string(configWhitespace.Clusters[configWhitespaceCtx.Cluster].CertificateAuthorityData)

View File

@ -82,11 +82,9 @@ var _ = Describe("kubelet-config ConfigMap", func() {
// Extract the value of the UnversionedKubeletConfigMap feature gate if its present. // Extract the value of the UnversionedKubeletConfigMap feature gate if its present.
// TODO: remove this after the UnversionedKubeletConfigMap feature gate goes GA: // TODO: remove this after the UnversionedKubeletConfigMap feature gate goes GA:
// https://github.com/kubernetes/kubeadm/issues/1582 // https://github.com/kubernetes/kubeadm/issues/1582
var UnversionedKubeletConfigMap bool UnversionedKubeletConfigMap := true
if _, ok := m["featureGates"]; ok { if _, ok := m["featureGates"]; ok {
if featureGates, ok := m["featureGates"].(map[interface{}]interface{}); ok { if featureGates, ok := m["featureGates"].(map[interface{}]interface{}); ok {
// TODO: update the default to true once this graduates to Beta.
UnversionedKubeletConfigMap = false
if val, ok := featureGates["UnversionedKubeletConfigMap"]; ok { if val, ok := featureGates["UnversionedKubeletConfigMap"]; ok {
if valBool, ok := val.(bool); ok { if valBool, ok := val.(bool); ok {
UnversionedKubeletConfigMap = valBool UnversionedKubeletConfigMap = valBool