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

🌱 CAPD: make Machine bootstrap reentrant #7271

Merged

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Sep 22, 2022

What this PR does / why we need it:
Makes the machine bootstrap reentrant. Currently we might try to bootstrap a machine again even though it's already successfully bootstrapped.

Found during implementation of #7244

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 #

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 22, 2022
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 22, 2022
@sbueringer
Copy link
Member Author

cc @fabriziopandini @chrischdi

test/infrastructure/docker/exp/internal/docker/nodepool.go Outdated Show resolved Hide resolved
}
// We have to check here to make this reentrant for cases where the bootstrap works
// but bootstrapped is never set on the object. We only try to bootstrap if the machine
// is not already bootstrapped.
Copy link
Member

Choose a reason for hiding this comment

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

Q: what about deprecating bootstrapped and opening an issue for dropping it in the next API version now that we are relying on the file being created on the machine?

Copy link
Member Author

@sbueringer sbueringer Sep 22, 2022

Choose a reason for hiding this comment

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

Good point, I wasn't aware it's only used for this purpose

Copy link
Member Author

@sbueringer sbueringer Sep 22, 2022

Choose a reason for hiding this comment

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

I'll deprecate the fields, removing it will be automatically done as part of bumping to the next release (either via the issue template we have or we should just in general always grep for deprecated stuff when we create a new apiVersion)

@sbueringer sbueringer force-pushed the pr-make-CAPD-bootstrap-reentrant branch from 7e7af94 to c62d113 Compare September 22, 2022 11:53
@sbueringer
Copy link
Member Author

sbueringer commented Sep 22, 2022

Thx for the review. Findings should be addressed, PTAL :)

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 22, 2022
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer sbueringer force-pushed the pr-make-CAPD-bootstrap-reentrant branch from c62d113 to 7939ab1 Compare September 22, 2022 12:31
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 22, 2022
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer sbueringer force-pushed the pr-make-CAPD-bootstrap-reentrant branch from 7939ab1 to 38653d8 Compare September 22, 2022 12:51
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 22, 2022
@chrischdi
Copy link
Member

For follow-up inspection, following observation:

  • on self-hosted clusters with CAPD, when a cp node gets added, the the kcp controller (and others) loose leader-election and restart. This leads to a long timeout and by that longer upgrade duration.

@fabriziopandini
Copy link
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 22, 2022
@k8s-ci-robot k8s-ci-robot merged commit 5eaa629 into kubernetes-sigs:main Sep 22, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.3 milestone Sep 22, 2022
@sbueringer sbueringer deleted the pr-make-CAPD-bootstrap-reentrant branch September 23, 2022 05:25
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants