mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 19:21:37 +00:00
kubeadm: add warning about 'upgrade apply/plan --config'
The flag has been problematic and abused by users. While perhaps its original purpose was to be able to feed a new version of the control-plane it also made it possible to apply modifications to the ClusterConfiguration object in the cluster. The lack of a feature in kubeadm for reconfiguration of running clusters resulted in users using this flag for the same purpose. While it works for certain scenarios like updating a static Pod for this control-plane only, it can result in unexpected behavior if the user has for example fed a node name different than the host name, when originally they created this node. kubeadm 1.16 introduced the "kustomize" feature that is a potential replacement for this user demand. Add warning that this flag should not be used.
This commit is contained in:
@@ -91,6 +91,7 @@ func enforceRequirements(flags *applyPlanFlags, dryRun bool, newK8sVersion strin
|
||||
|
||||
var cfg *kubeadmapi.InitConfiguration
|
||||
if flags.cfgPath != "" {
|
||||
klog.Warning("WARNING: Usage of the --config flag for reconfiguring the cluster during upgrade is not recommended!")
|
||||
cfg, err = configutil.LoadInitConfigurationFromFile(flags.cfgPath)
|
||||
} else {
|
||||
cfg, err = configutil.FetchInitConfigurationFromCluster(client, os.Stdout, "upgrade/config", false)
|
||||
|
Reference in New Issue
Block a user