// sets the data builder function, that will be used by the runner
Use:"experimental-control-plane",
// both when running the entire workflow or single phases
Short:"Upgrade the control plane instance deployed on this node. IMPORTANT. This command should be executed after executing `kubeadm upgrade apply` on another control plane instance",
cmd.Flags().BoolVar(&flags.dryRun,options.DryRun,flags.dryRun,"Do not change any state, just output the actions that would be performed.")
cmd.Flags().BoolVar(&flags.etcdUpgrade,"etcd-upgrade",flags.etcdUpgrade,"Perform the upgrade of etcd.")
cmd.Flags().BoolVar(&flags.renewCerts,"certificate-renewal",flags.renewCerts,"Perform the renewal of certificates used by component changed during upgrades.")
returncmd
returncmd
}
}
// RunUpgradeNodeConfig is executed when `kubeadm upgrade node config` runs.
// newNodeOptions returns a struct ready for being used for creating cmd kubeadm upgrade node flags.
flagSet.BoolVar(&nodeOptions.dryRun,options.DryRun,nodeOptions.dryRun,"Do not change any state, just output the actions that would be performed.")
flagSet.StringVar(&nodeOptions.kubeletVersion,options.KubeletVersion,nodeOptions.kubeletVersion,"The *desired* version for the kubelet config after the upgrade. If not specified, the KubernetesVersion from the kubeadm-config ConfigMap will be used")
}
// Set up the kubelet directory to use. If dry-running, use a fake directory
// newNodeData returns a new nodeData struct to be used for the execution of the kubeadm upgrade node workflow.
// NewCmdUpgradeControlPlane returns the cobra.Command for upgrading the controlplane instance on this node
// TODO: to remove when 1.16 is released
funcNewCmdUpgradeControlPlane()*cobra.Command{
nodeOptions:=newNodeOptions()
nodeRunner:=workflow.NewRunner()
cmd:=&cobra.Command{
Use:"experimental-control-plane",
Short:"Upgrade the control plane instance deployed on this node. IMPORTANT. This command should be executed after executing `kubeadm upgrade apply` on another control plane instance",
Deprecated:"this command is deprecated. Use \"kubeadm upgrade node\" instead",
Run:func(cmd*cobra.Command,args[]string){
err:=nodeRunner.Run(args)
kubeadmutil.CheckErr(err)
},
}
}
fmt.Println("[upgrade] The control plane instance for this node was successfully updated!")
cmd.Flags().BoolVar(&nodeOptions.dryRun,options.DryRun,nodeOptions.dryRun,"Do not change any state, just output the actions that would be performed.")
cmd.Flags().BoolVar(&nodeOptions.etcdUpgrade,"etcd-upgrade",nodeOptions.etcdUpgrade,"Perform the upgrade of etcd.")
cmd.Flags().BoolVar(&nodeOptions.renewCerts,"certificate-renewal",nodeOptions.renewCerts,"Perform the renewal of certificates used by component changed during upgrades.")
// initialize the workflow runner with the list of phases
nodeRunner.AppendPhase(phases.NewControlPlane())
// sets the data builder function, that will be used by the runner
// both when running the entire workflow or single phases