mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #79327 from SataQiu/cleanup-experimental-1.16
kubeadm: cleanup ExperimentalControlPlane and ExperimentalUploadCerts
This commit is contained in:
commit
a5c727e26f
@ -437,7 +437,6 @@ func isAllowedFlag(flagName string) bool {
|
||||
kubeadmcmdoptions.NodeCRISocket,
|
||||
kubeadmcmdoptions.KubeconfigDir,
|
||||
kubeadmcmdoptions.UploadCerts,
|
||||
kubeadmcmdoptions.ExperimentalUploadCerts,
|
||||
"print-join-command", "rootfs", "v")
|
||||
if knownFlags.Has(flagName) {
|
||||
return true
|
||||
|
@ -263,11 +263,6 @@ func AddInitOtherFlags(flagSet *flag.FlagSet, initOptions *initOptions) {
|
||||
&initOptions.uploadCerts, options.UploadCerts, initOptions.uploadCerts,
|
||||
"Upload control-plane certificates to the kubeadm-certs Secret.",
|
||||
)
|
||||
flagSet.BoolVar(
|
||||
&initOptions.uploadCerts, options.ExperimentalUploadCerts, initOptions.uploadCerts,
|
||||
"Upload control-plane certificates to the kubeadm-certs Secret.",
|
||||
)
|
||||
flagSet.MarkDeprecated(options.ExperimentalUploadCerts, fmt.Sprintf("use --%s instead", options.UploadCerts))
|
||||
flagSet.BoolVar(
|
||||
&initOptions.skipCertificateKeyPrint, options.SkipCertificateKeyPrint, initOptions.skipCertificateKeyPrint,
|
||||
"Don't print the key used to encrypt the control-plane certificates.",
|
||||
|
@ -275,11 +275,6 @@ func addJoinOtherFlags(flagSet *flag.FlagSet, joinOptions *joinOptions) {
|
||||
&joinOptions.controlPlane, options.ControlPlane, joinOptions.controlPlane,
|
||||
"Create a new control plane instance on this node",
|
||||
)
|
||||
flagSet.BoolVar(
|
||||
&joinOptions.controlPlane, options.ExperimentalControlPlane, joinOptions.controlPlane,
|
||||
"Create a new control plane instance on this node",
|
||||
)
|
||||
flagSet.MarkDeprecated(options.ExperimentalControlPlane, fmt.Sprintf("use --%s instead", options.ControlPlane))
|
||||
}
|
||||
|
||||
// newJoinOptions returns a struct ready for being used for creating cmd join flags.
|
||||
|
@ -125,14 +125,6 @@ const (
|
||||
// UploadCerts flag instruct kubeadm to upload certificates
|
||||
UploadCerts = "upload-certs"
|
||||
|
||||
// ExperimentalControlPlane flag instruct kubeadm to create a new control plane instance on this node
|
||||
// TODO: this flag should be removed in 1.16 cycle
|
||||
ExperimentalControlPlane = "experimental-control-plane"
|
||||
|
||||
// ExperimentalUploadCerts flag instruct kubeadm to upload certificates
|
||||
// TODO: this flag should be removed in 1.16 cycle
|
||||
ExperimentalUploadCerts = "experimental-upload-certs"
|
||||
|
||||
// CertificateKey flag sets the key used to encrypt and decrypt certificate secrets
|
||||
CertificateKey = "certificate-key"
|
||||
|
||||
|
@ -38,7 +38,6 @@ func NewUploadCertsPhase() workflow.Phase {
|
||||
InheritFlags: []string{
|
||||
options.CfgPath,
|
||||
options.UploadCerts,
|
||||
options.ExperimentalUploadCerts,
|
||||
options.CertificateKey,
|
||||
options.SkipCertificateKeyPrint,
|
||||
},
|
||||
|
@ -40,7 +40,6 @@ func getControlPlaneJoinPhaseFlags(name string) []string {
|
||||
flags := []string{
|
||||
options.CfgPath,
|
||||
options.ControlPlane,
|
||||
options.ExperimentalControlPlane,
|
||||
options.NodeName,
|
||||
}
|
||||
if name != "mark-control-plane" {
|
||||
|
@ -70,7 +70,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
|
||||
options.APIServerBindPort,
|
||||
options.CfgPath,
|
||||
options.ControlPlane,
|
||||
options.ExperimentalControlPlane,
|
||||
options.NodeName,
|
||||
options.FileDiscovery,
|
||||
options.TokenDiscovery,
|
||||
@ -84,7 +83,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
|
||||
flags = []string{
|
||||
options.CfgPath,
|
||||
options.ControlPlane,
|
||||
options.ExperimentalControlPlane,
|
||||
options.FileDiscovery,
|
||||
options.TokenDiscovery,
|
||||
options.TokenDiscoveryCAHash,
|
||||
@ -98,7 +96,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
|
||||
options.APIServerAdvertiseAddress,
|
||||
options.CfgPath,
|
||||
options.ControlPlane,
|
||||
options.ExperimentalControlPlane,
|
||||
options.NodeName,
|
||||
options.FileDiscovery,
|
||||
options.TokenDiscovery,
|
||||
@ -111,7 +108,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
|
||||
flags = []string{
|
||||
options.CfgPath,
|
||||
options.ControlPlane,
|
||||
options.ExperimentalControlPlane,
|
||||
options.FileDiscovery,
|
||||
options.TokenDiscovery,
|
||||
options.TokenDiscoveryCAHash,
|
||||
@ -126,7 +122,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
|
||||
options.APIServerBindPort,
|
||||
options.CfgPath,
|
||||
options.ControlPlane,
|
||||
options.ExperimentalControlPlane,
|
||||
}
|
||||
default:
|
||||
flags = []string{}
|
||||
@ -274,7 +269,7 @@ func runControlPlanePrepareKubeconfigPhaseLocal(c workflow.RunData) error {
|
||||
|
||||
// Generate kubeconfig files for controller manager, scheduler and for the admin/kubeadm itself
|
||||
// NB. The kubeconfig file for kubelet will be generated by the TLS bootstrap process in
|
||||
// following steps of the join --experimental-control plane workflow
|
||||
// following steps of the join --control-plane workflow
|
||||
if err := kubeconfigphase.CreateJoinControlPlaneKubeConfigFiles(kubeadmconstants.KubernetesDir, cfg); err != nil {
|
||||
return errors.Wrap(err, "error generating kubeconfig files")
|
||||
}
|
||||
|
@ -65,7 +65,6 @@ func NewPreflightPhase() workflow.Phase {
|
||||
options.TLSBootstrapToken,
|
||||
options.TokenStr,
|
||||
options.ControlPlane,
|
||||
options.ExperimentalControlPlane,
|
||||
options.APIServerAdvertiseAddress,
|
||||
options.APIServerBindPort,
|
||||
options.NodeCRISocket,
|
||||
|
@ -98,8 +98,6 @@ func NewCmdNode() *cobra.Command {
|
||||
// upgrade node config command is subject to GA deprecation policy, so we should deprecate it
|
||||
// and keep it here for one year or three releases - the longer of the two - starting from v1.15 included
|
||||
cmd.AddCommand(NewCmdUpgradeNodeConfig())
|
||||
// upgrade node experimental control plane can be removed, but we are keeping it for one more cycle
|
||||
cmd.AddCommand(NewCmdUpgradeControlPlane())
|
||||
|
||||
return cmd
|
||||
}
|
||||
@ -229,37 +227,3 @@ func NewCmdUpgradeNodeConfig() *cobra.Command {
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
// NewCmdUpgradeControlPlane returns the cobra.Command for upgrading the controlplane instance on this node
|
||||
// TODO: to remove when 1.16 is released
|
||||
func NewCmdUpgradeControlPlane() *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)
|
||||
},
|
||||
}
|
||||
|
||||
// adds flags to the node command
|
||||
options.AddKubeConfigFlag(cmd.Flags(), &nodeOptions.kubeConfigPath)
|
||||
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, options.EtcdUpgrade, nodeOptions.etcdUpgrade, "Perform the upgrade of etcd.")
|
||||
cmd.Flags().BoolVar(&nodeOptions.renewCerts, options.CertificateRenewal, 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
|
||||
nodeRunner.SetDataInitializer(func(cmd *cobra.Command, args []string) (workflow.RunData, error) {
|
||||
return newNodeData(cmd, args, nodeOptions)
|
||||
})
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user