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:
Lubomir I. Ivanov
2019-10-05 22:14:23 +03:00
parent 8f968c41d2
commit 276665c1a0

View File

@@ -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)