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

🌱 Ensure provider deployments are available on init #3825

Closed

Conversation

wfernandes
Copy link
Contributor

What this PR does / why we need it:
This PR adds a check to ensure the Deployments are Available as part of clusterctl init operation.

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 #3720

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 19, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign davidewatson after the PR has been reviewed.
You can assign the PR to them by writing /assign @davidewatson in a comment when ready.

The full list of commands accepted by this bot can be found 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

@@ -74,9 +82,50 @@ func (i *providerInstaller) Install() ([]repository.Components, error) {

ret = append(ret, components)
}

// Verify that Deployments in any components to be installed is available
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm checking the deployments status serially instead of in parallel because as I was testing with the parallel version (using WaitGroup and an errChan), it took longer because of the exponential backoff for some of the go routines.

I opted to keep it serially because:

  • it took less time on my machine
  • the log output from clusterctl was cleaner
  • the code looks cleaner as well

I can explain in more detail if y'all would like. 🙂

Copy link

Choose a reason for hiding this comment

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

Serially probably makes sense, they're coming up in parallel but we're looking to block until all have completed, so there's no time saving in checking them in parallel

- message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. I know this looks weird but it will be a whole lot cleaner if the Init tests were also written with envtest.

Copy link

@benmoss benmoss left a comment

Choose a reason for hiding this comment

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

Other than this lgtm!

cmd/clusterctl/client/cluster/installer.go Outdated Show resolved Hide resolved
@fabriziopandini
Copy link
Member

@wfernandes, background question: should we wait for the operator given that the entire install sequence will be impacted?

@wfernandes
Copy link
Contributor Author

@fabriziopandini Yeah that does make sense. I can close this PR and the corresponding issue #3720 with a note saying that the operator will take care of it.

@vincepri
Copy link
Member

Closing per comment above

/close

@k8s-ci-robot
Copy link
Contributor

@vincepri: Closed this PR.

In response to this:

Closing per comment above

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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 init does not wait for providers to be ready
5 participants