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

✨ Add sentinel file to signal successful bootstrapping #4084

Merged

Conversation

CecileRobertMichon
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon commented Jan 16, 2021

What this PR does / why we need it: This PR does three things:

  1. Add the presence of /run/cluster-api/bootstrap-success.complete to signal successful completion of bootstrapping to the Bootstrap Provider contract.
  2. Adds commands to write the sentinel file when kubeadm init and kubeadm join succeed to CABPK. This is done in a way that works for both Linux and Windows machines.
  3. Implements the bootstrap file check and condition for the Docker provider

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 16, 2021
@CecileRobertMichon
Copy link
Contributor Author

/cc @jsturtevant @jdef

@k8s-ci-robot
Copy link
Contributor

@CecileRobertMichon: GitHub didn't allow me to request PR reviews from the following users: jdef.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @jsturtevant @jdef

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.

@CecileRobertMichon
Copy link
Contributor Author

docker e2e is failing because the docker provider is modifying runcmd to append --ignore-preflight-errors=all... will fix on Monday

@CecileRobertMichon
Copy link
Contributor Author

/retest

@fabriziopandini
Copy link
Member

/milestone v0.4.0

@k8s-ci-robot k8s-ci-robot added this to the v0.4.0 milestone Jan 19, 2021
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 19, 2021
@CecileRobertMichon
Copy link
Contributor Author

/hold

trying to add a test

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 19, 2021
Copy link
Contributor

@jdef jdef 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
Copy link
Contributor

@jdef: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

@jdef
Copy link
Contributor

jdef commented Jan 20, 2021

To ensure that this is working as expected, maybe integration testing looks something like:

  1. Add a postKubeadmCommands entry (for either the KCP or non-KCP docker example) that asserts the presence of the sentinel file; a failure can be signaled .. somehow :)
  2. Add a test case that injects an (optional) "poison pill" to the docker infra, such that "kubeadm init" (or join) fails, and in such case, assert that the sentinel file is not created.

My hunch is that the 2nd case is a bit more work, but it also tests the logic for "ONLY create the sentinel if kubeadm succeeds".

Failure signal probably needs some thought. Straw man: a polling mechanism in docker/docker/machine.go::ExecBootstrap that waits X time for the sentinel file to appear in the container (since kubeadm has already finished executing (or failing) the wait time can probably be short).

@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 Jan 21, 2021
@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 Jan 21, 2021
@CecileRobertMichon
Copy link
Contributor Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2021
Copy link
Member

@vincepri vincepri 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 Jan 21, 2021
@CecileRobertMichon
Copy link
Contributor Author

/assign @fabriziopandini

@fabriziopandini
Copy link
Member

/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 Jan 22, 2021
@k8s-ci-robot k8s-ci-robot merged commit 37941fe into kubernetes-sigs:master Jan 22, 2021
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.

v1alpha4: write sentinel file as part of bootstrap
6 participants