mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
Replace --init-config-dir with --config
This commit is contained in:
@@ -101,11 +101,11 @@ type KubeletFlags struct {
|
||||
// To use this flag, the DynamicKubeletConfig feature gate must be enabled.
|
||||
DynamicConfigDir flag.StringFlag
|
||||
|
||||
// The Kubelet will look in this directory for an init configuration.
|
||||
// The Kubelet will load its initial configuration from this file.
|
||||
// The path may be absolute or relative; relative paths are under the Kubelet's current working directory.
|
||||
// Omit this flag to use the combination of built-in default configuration values and flags.
|
||||
// To use this flag, the KubeletConfigFile feature gate must be enabled.
|
||||
InitConfigDir flag.StringFlag
|
||||
KubeletConfigFile flag.StringFlag
|
||||
|
||||
// registerNode enables automatic registration with the apiserver.
|
||||
RegisterNode bool
|
||||
@@ -229,9 +229,9 @@ func ValidateKubeletFlags(f *KubeletFlags) error {
|
||||
if f.DynamicConfigDir.Provided() && !utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) {
|
||||
return fmt.Errorf("the DynamicKubeletConfig feature gate must be enabled in order to use the --dynamic-config-dir flag")
|
||||
}
|
||||
// ensure that nobody sets InitConfigDir if the KubeletConfigFile feature gate is turned off
|
||||
if f.InitConfigDir.Provided() && !utilfeature.DefaultFeatureGate.Enabled(features.KubeletConfigFile) {
|
||||
return fmt.Errorf("the KubeletConfigFile feature gate must be enabled in order to use the --init-config-dir flag")
|
||||
// ensure that nobody sets KubeletConfigFile if the KubeletConfigFile feature gate is turned off
|
||||
if f.KubeletConfigFile.Provided() && !utilfeature.DefaultFeatureGate.Enabled(features.KubeletConfigFile) {
|
||||
return fmt.Errorf("the KubeletConfigFile feature gate must be enabled in order to use the --config flag")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -325,7 +325,7 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&f.RootDirectory, "root-dir", f.RootDirectory, "Directory path for managing kubelet files (volume mounts,etc).")
|
||||
|
||||
fs.Var(&f.DynamicConfigDir, "dynamic-config-dir", "The Kubelet will use this directory for checkpointing downloaded configurations and tracking configuration health. The Kubelet will create this directory if it does not already exist. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Providing this flag enables dynamic Kubelet configuration. Presently, you must also enable the DynamicKubeletConfig feature gate to pass this flag.")
|
||||
fs.Var(&f.InitConfigDir, "init-config-dir", "The Kubelet will look in this directory for the init configuration. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Omit this argument to use the built-in default configuration values. Presently, you must also enable the KubeletConfigFile feature gate to pass this flag.")
|
||||
fs.Var(&f.KubeletConfigFile, "config", "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. You must also enable the KubeletConfigFile feature gate to pass this flag.")
|
||||
|
||||
fs.BoolVar(&f.RegisterNode, "register-node", f.RegisterNode, "Register the node with the apiserver. If --kubeconfig is not provided, this flag is irrelevant, as the Kubelet won't have an apiserver to register with. Default=true.")
|
||||
fs.Var(utiltaints.NewTaintsVar(&f.RegisterWithTaints), "register-with-taints", "Register the node with the given list of taints (comma separated \"<key>=<value>:<effect>\"). No-op if register-node is false.")
|
||||
|
||||
Reference in New Issue
Block a user