Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeadm: cleanup ExperimentalControlPlane and ExperimentalUploadCerts #79327

Merged
merged 1 commit into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion cmd/kubeadm/app/apis/kubeadm/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions cmd/kubeadm/app/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
5 changes: 0 additions & 5 deletions cmd/kubeadm/app/cmd/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 0 additions & 8 deletions cmd/kubeadm/app/cmd/options/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion cmd/kubeadm/app/cmd/phases/init/uploadcerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func NewUploadCertsPhase() workflow.Phase {
InheritFlags: []string{
options.CfgPath,
options.UploadCerts,
options.ExperimentalUploadCerts,
options.CertificateKey,
options.SkipCertificateKeyPrint,
},
Expand Down
1 change: 0 additions & 1 deletion cmd/kubeadm/app/cmd/phases/join/controlplanejoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func getControlPlaneJoinPhaseFlags(name string) []string {
flags := []string{
options.CfgPath,
options.ControlPlane,
options.ExperimentalControlPlane,
options.NodeName,
}
if name != "mark-control-plane" {
Expand Down
7 changes: 1 addition & 6 deletions cmd/kubeadm/app/cmd/phases/join/controlplaneprepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
options.APIServerBindPort,
options.CfgPath,
options.ControlPlane,
options.ExperimentalControlPlane,
options.NodeName,
options.FileDiscovery,
options.TokenDiscovery,
Expand All @@ -84,7 +83,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
flags = []string{
options.CfgPath,
options.ControlPlane,
options.ExperimentalControlPlane,
options.FileDiscovery,
options.TokenDiscovery,
options.TokenDiscoveryCAHash,
Expand All @@ -98,7 +96,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
options.APIServerAdvertiseAddress,
options.CfgPath,
options.ControlPlane,
options.ExperimentalControlPlane,
options.NodeName,
options.FileDiscovery,
options.TokenDiscovery,
Expand All @@ -111,7 +108,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
flags = []string{
options.CfgPath,
options.ControlPlane,
options.ExperimentalControlPlane,
options.FileDiscovery,
options.TokenDiscovery,
options.TokenDiscoveryCAHash,
Expand All @@ -126,7 +122,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
options.APIServerBindPort,
options.CfgPath,
options.ControlPlane,
options.ExperimentalControlPlane,
}
default:
flags = []string{}
Expand Down Expand Up @@ -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")
}
Expand Down
1 change: 0 additions & 1 deletion cmd/kubeadm/app/cmd/phases/join/preflight.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func NewPreflightPhase() workflow.Phase {
options.TLSBootstrapToken,
options.TokenStr,
options.ControlPlane,
options.ExperimentalControlPlane,
options.APIServerAdvertiseAddress,
options.APIServerBindPort,
options.NodeCRISocket,
Expand Down
36 changes: 0 additions & 36 deletions cmd/kubeadm/app/cmd/upgrade/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}