From 276665c1a0fcdfb5a7278b1ac5846727d6e27b00 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 5 Oct 2019 22:14:23 +0300 Subject: [PATCH] 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. --- cmd/kubeadm/app/cmd/upgrade/common.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/kubeadm/app/cmd/upgrade/common.go b/cmd/kubeadm/app/cmd/upgrade/common.go index d7f2004b6ef..48efbe54cac 100644 --- a/cmd/kubeadm/app/cmd/upgrade/common.go +++ b/cmd/kubeadm/app/cmd/upgrade/common.go @@ -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)