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

clusterctl - Allow for disabling pivoting of cluster #463

Closed
wants to merge 2 commits into from

Conversation

detiber
Copy link
Member

@detiber detiber commented Jul 27, 2018

What this PR does / why we need it:

  • Add --no-pivot-cluster flag to disable pivoting of the cluster

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #450

Release note:

- clusterctl adds the --no-pivot-cluster flag to 'clusterctl create cluster' that allows for disabling pivoting of cluster-api components.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 27, 2018
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 27, 2018
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 27, 2018
@detiber detiber changed the title [WIP] clusterctl - Do not pivot cluster by default clusterctl - Do not pivot cluster by default Jul 31, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 31, 2018
Copy link
Contributor

@ingvagabund ingvagabund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One blocker wrt. cleanupExternalCluster set to false when pivotCluster is false. Otherwise, just questions to more clarify semantics of the code.

@@ -131,7 +134,7 @@ func (d *ClusterDeployer) Create(cluster *clusterv1.Cluster, machines []*cluster
return fmt.Errorf("unable to apply cluster api stack to external cluster: %v", err)
}

glog.Info("Provisioning internal cluster via external cluster")
glog.Info("Provisioning cluster via external cluster")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense to say "Provisioning cluster via external (bootstrapping) cluster"? It may be unclear to actually distinguish between what is external cluster (in this case cluster responsible for bootstrapping process) and what is internal one (the product of the bootstrapping process).

And in general to find better terms for the external/internal clusters.

}
if d.pivotCluster {
glog.Info("Creating internal cluster")
internalClient, err := d.createInternalCluster(externalClient, provider, kubeconfigOutput)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createInternalCluster actually does not create the internal cluster, right? It just builds the internal cluster client. So maybe s/createInternalCluster/createInternalClusterClient/? The createInternalCluster pulls the cluster objects, waits until the internal cluster can provide its kubeconfig and then builds the client (please prove me wrong).

glog.Info("Creating node machines in internal cluster.")
if err := internalClient.CreateMachineObjects(nodes); err != nil {
glog.Infof("Creating node machines in %s cluster.", targetCluster)
if err := targetClient.CreateMachineObjects(nodes); err != nil {
return fmt.Errorf("unable to create node machines: %v", err)
}

if d.addonComponents != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are meant for the internal cluster. The provider components are the cluster api stack that is applied to the internal and external cluster. The addon components are things we "add on" to the internal cluster in addition to the core k8s control plane as part of the baseline installation.

if err := d.updateClusterEndpoint(internalClient, provider); err != nil {
return fmt.Errorf("unable to update internal cluster endpoint: %v", err)
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the pivotCluster is false, the cleanupExternalCluster needs to be set to false. Otherwise, we will provision the cluster API stack and then remove it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been addressed here:

if d.cleanupExternalCluster && d.pivotCluster {

@roberthbailey
Copy link
Contributor

/assign @ingvagabund

@k8s-ci-robot
Copy link
Contributor

@roberthbailey: GitHub didn't allow me to assign the following users: ingvagabund.

Note that only kubernetes-sigs members and repo collaborators can be assigned.
For more information please see the contributor guide

In response to this:

/assign @ingvagabund

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ingvagabund
Copy link
Contributor

@roberthbailey unfortunately I am not in the kubernetes-sigs org. What's the typical trial to get to the org? Just request for it?

@roberthbailey
Copy link
Contributor

Yes. Since you are a member of the kubernetes org, you have implicit membership in the kubernetes-sigs org as well but you need to request it.

From https://github.com/kubernetes/community/blob/master/community-membership.md#kubernetes-ecosystem

We are currently working on automation that would transfer membership in the Kubernetes organization to any related orgs automatically, but such is not the case currently.

@detiber
Copy link
Member Author

detiber commented Aug 14, 2018

@ingvagabund I believe I've addressed all of the comments not already answered. I agree about the unfortunate naming of external/internal, but believe that would be better handled through a separate issue/PR.

@ingvagabund
Copy link
Contributor

@roberthbailey I am in the sig now, thanks for the hints
/assign ingvagabund

@ingvagabund
Copy link
Contributor

@detiber thanks for addressing the comments. Looks good now. Lemme just build and run the clusterctl command locally.

@ingvagabund
Copy link
Contributor

@detiber lgtm. Can you squash the commits?

@detiber
Copy link
Member Author

detiber commented Aug 17, 2018

@ingvagabund squashed. I left the version bump for the api server image as a separate commit since it's not directly related to the change, thanks for the review!

@ingvagabund
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 17, 2018
@ingvagabund
Copy link
Contributor

/approve

@ingvagabund
Copy link
Contributor

@medinatiger can you please approve?

@roberthbailey
Copy link
Contributor

I was looking at this today and I had a couple of questions that I wanted to discuss in the wg meeting.

@roberthbailey
Copy link
Contributor

@detiber - please ping this PR once you've updated it to reflect the discussion during the WG meeting today.

@roberthbailey roberthbailey added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 31, 2018
@roberthbailey
Copy link
Contributor

Apparently the bot doesn't auto-tag PRs in this repo that need to be rebased, but this PR now needs to be rebased.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 4, 2018
@detiber detiber changed the title clusterctl - Do not pivot cluster by default [WIP] clusterctl - Do not pivot cluster by default Sep 4, 2018
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 4, 2018
@detiber
Copy link
Member Author

detiber commented Sep 4, 2018

Rebased, but still need to address the default behavior as discussed in the cluster-api meeting.

@detiber detiber changed the title [WIP] clusterctl - Do not pivot cluster by default clusterctl - Allow for disabling pivoting of cluster Sep 5, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 5, 2018
@detiber
Copy link
Member Author

detiber commented Sep 5, 2018

Updated to switch the default back to pivoting of the cluster and specifying the command line flag to override.

It's not overly clear if we can have configurable defaults based on the values of other provided flags with cobra. If someone can point me to examples or docs on how to accomplish this, I will gladly update this PR accordingly.

- Add --no-pivot-cluster flag to disable pivoting of the cluster
@roberthbailey roberthbailey removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 5, 2018
@roberthbailey
Copy link
Contributor

/lgtm
/approve
/hold

Holding for a bit in case other folks want to comment before the merge bot takes over.

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Sep 5, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: detiber, ingvagabund, roberthbailey

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 5, 2018
@frodenas
Copy link

frodenas commented Oct 4, 2018

@roberthbailey There haven't been any comments in the last 28 days, can this be merged now?

@roberthbailey
Copy link
Contributor

Yes, although it now needs to be rebased.

@detiber
Copy link
Member Author

detiber commented Oct 4, 2018

@frodenas @roberthbailey I can rebase this next week (and after #494) is merged

@roberthbailey roberthbailey added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 4, 2018
@roberthbailey
Copy link
Contributor

@detiber - let me know when this has been rebased and is ready for review.

@detiber
Copy link
Member Author

detiber commented Feb 1, 2019

Closing in favor of the phases support.

@detiber detiber closed this Feb 1, 2019
@detiber detiber deleted the noPivot branch April 2, 2019 17:44
jayunit100 pushed a commit to jayunit100/cluster-api that referenced this pull request Jan 31, 2020
Use base images for bootstrap and manifests images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clusterctl pivots to internal cluster, make this optional
5 participants