-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
There was a problem hiding this 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") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is purpose of the addon components? Do they extend the cluster API stack? Checking:
- https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/master/clusterctl/examples/google/addons.yaml.template
- https://github.com/roberthbailey/cluster-api-provider-vsphere/blob/master/clusterctl/examples/vsphere/addons.yaml.template
I can't decide if they are meant for the external of the internal cluster.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
/assign @ingvagabund |
@roberthbailey: GitHub didn't allow me to assign the following users: ingvagabund. Note that only kubernetes-sigs members and repo collaborators can be assigned. In response to this:
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. |
@roberthbailey unfortunately I am not in the |
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.
|
@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. |
@roberthbailey I am in the sig now, thanks for the hints |
@detiber thanks for addressing the comments. Looks good now. Lemme just build and run the clusterctl command locally. |
@detiber lgtm. Can you squash the commits? |
@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! |
/lgtm |
/approve |
@medinatiger can you please approve? |
I was looking at this today and I had a couple of questions that I wanted to discuss in the wg meeting. |
@detiber - please ping this PR once you've updated it to reflect the discussion during the WG meeting today. |
Apparently the bot doesn't auto-tag PRs in this repo that need to be rebased, but this PR now needs to be rebased. |
Rebased, but still need to address the default behavior as discussed in the cluster-api meeting. |
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
/lgtm Holding for a bit in case other folks want to comment before the merge bot takes over. |
[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 |
@roberthbailey There haven't been any comments in the last 28 days, can this be merged now? |
Yes, although it now needs to be rebased. |
@frodenas @roberthbailey I can rebase this next week (and after #494) is merged |
@detiber - let me know when this has been rebased and is ready for review. |
Closing in favor of the phases support. |
Use base images for bootstrap and manifests images
What this PR does / why we need it:
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: