*: promote KubeletConfigDropInDir feature to beta

This change removes the environment variable set during
the Alpha phase and prepares the feature for beta graduation.

xref: https://github.com/kubernetes/enhancements/pull/4419

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
This commit is contained in:
Sohan Kunkerkar 2024-01-22 10:34:38 -05:00
parent 24267f6aa7
commit b40b5f86d8
3 changed files with 1 additions and 7 deletions

View File

@ -285,7 +285,7 @@ func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) {
f.addOSFlags(fs) f.addOSFlags(fs)
fs.StringVar(&f.KubeletConfigFile, "config", f.KubeletConfigFile, "The Kubelet will load its initial configuration from this file. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Omit this flag to use the built-in default configuration values. Command-line flags override configuration from this file.") fs.StringVar(&f.KubeletConfigFile, "config", f.KubeletConfigFile, "The Kubelet will load its initial configuration from this file. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Omit this flag to use the built-in default configuration values. Command-line flags override configuration from this file.")
fs.StringVar(&f.KubeletDropinConfigDirectory, "config-dir", "", "Path to a directory to specify drop-ins, allows the user to optionally specify additional configs to overwrite what is provided by default and in the KubeletConfigFile flag. Note: Set the 'KUBELET_CONFIG_DROPIN_DIR_ALPHA' environment variable to specify the directory. [default='']") fs.StringVar(&f.KubeletDropinConfigDirectory, "config-dir", "", "Path to a directory to specify drop-ins, allows the user to optionally specify additional configs to overwrite what is provided by default and in the KubeletConfigFile flag. [default='']")
fs.StringVar(&f.KubeConfig, "kubeconfig", f.KubeConfig, "Path to a kubeconfig file, specifying how to connect to the API server. Providing --kubeconfig enables API server mode, omitting --kubeconfig enables standalone mode.") fs.StringVar(&f.KubeConfig, "kubeconfig", f.KubeConfig, "Path to a kubeconfig file, specifying how to connect to the API server. Providing --kubeconfig enables API server mode, omitting --kubeconfig enables standalone mode.")
fs.StringVar(&f.BootstrapKubeconfig, "bootstrap-kubeconfig", f.BootstrapKubeconfig, "Path to a kubeconfig file that will be used to get client certificate for kubelet. "+ fs.StringVar(&f.BootstrapKubeconfig, "bootstrap-kubeconfig", f.BootstrapKubeconfig, "Path to a kubeconfig file that will be used to get client certificate for kubelet. "+

View File

@ -214,10 +214,6 @@ is checked every 20 seconds (also configurable with a flag).`,
} }
// Merge the kubelet configurations if --config-dir is set // Merge the kubelet configurations if --config-dir is set
if len(kubeletFlags.KubeletDropinConfigDirectory) > 0 { if len(kubeletFlags.KubeletDropinConfigDirectory) > 0 {
_, ok := os.LookupEnv("KUBELET_CONFIG_DROPIN_DIR_ALPHA")
if !ok {
return fmt.Errorf("flag %s specified but environment variable KUBELET_CONFIG_DROPIN_DIR_ALPHA not set, cannot start kubelet", kubeletFlags.KubeletDropinConfigDirectory)
}
if err := mergeKubeletConfigurations(kubeletConfig, kubeletFlags.KubeletDropinConfigDirectory); err != nil { if err := mergeKubeletConfigurations(kubeletConfig, kubeletFlags.KubeletDropinConfigDirectory); err != nil {
return fmt.Errorf("failed to merge kubelet configs: %w", err) return fmt.Errorf("failed to merge kubelet configs: %w", err)
} }

View File

@ -249,8 +249,6 @@ func (e *E2EServices) startKubelet(featureGates map[string]bool) (*server, error
unitName = fmt.Sprintf("kubelet-%s.service", unitTimestamp) unitName = fmt.Sprintf("kubelet-%s.service", unitTimestamp)
cmdArgs = append(cmdArgs, cmdArgs = append(cmdArgs,
systemdRun, systemdRun,
// Set the environment variable to enable kubelet config drop-in directory.
"--setenv", "KUBELET_CONFIG_DROPIN_DIR_ALPHA=yes",
"-p", "Delegate=true", "-p", "Delegate=true",
"-p", logLocation+framework.TestContext.ReportDir+"/kubelet.log", "-p", logLocation+framework.TestContext.ReportDir+"/kubelet.log",
"--unit="+unitName, "--unit="+unitName,