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

/run/cluster-api/bootstrap-success.complete is always created, even in case of failures #221

Open
anmazzotti opened this issue Dec 13, 2023 · 0 comments
Labels
kind/bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@anmazzotti
Copy link
Contributor

What happened:

The bootstrap provider is expected to create the /run/cluster-api/bootstrap-success.complete sentinel file upon successful bootstrap.

Normally the runcmd command list will look like:

runcmd:
  - 'curl -sfL https://get.rke2.io | INSTALL_RKE2_VERSION=v1.28.4+rke2r1 sh -s - server'
  - 'systemctl enable rke2-server.service'
  - 'systemctl start rke2-server.service'
  - 'mkdir /run/cluster-api' 
  - 'echo success > /run/cluster-api/bootstrap-success.complete'

Since cloud-init will run all commands in the list (and collect errors later), the last command will always be executed.

What did you expect to happen:
The /run/cluster-api/bootstrap-success.complete file should not be created if any of the runcmd fails.

How to reproduce it:
Bootstrap any rke2 cluster using this provider

Anything else you would like to add:
To add complexity to this issue, the preRKE2Commands field can also be used to propagate arbitrary commands.
For example:

runcmd:
  - "mkdir -p /var/lib/rancher/rke2/server/manifests/ && ctr images pull ghcr.io/kube-vip/kube-vip:v0.6.4 && ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:v0.6.4 vip /kube-vip manifest daemonset --arp --interface $(ip -4 -j route list default | jq -r .[0].dev) --address 192.168.122.50 --controlplane --leaderElection --taint --services --inCluster | tee /var/lib/rancher/rke2/server/manifests/kube-vip.yaml"
  - 'curl -sfL https://get.rke2.io | INSTALL_RKE2_VERSION=v1.28.4+rke2r1 sh -s - server'
  - 'systemctl enable rke2-server.service'
  - 'systemctl start rke2-server.service'
  - 'mkdir /run/cluster-api' 
  - 'echo success > /run/cluster-api/bootstrap-success.complete'

Environment:

  • rke provider version: v0.2.2
@anmazzotti anmazzotti added kind/bug Something isn't working needs-priority Indicates an issue or PR needs a priority assigning to it needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 13, 2023
@alexander-demicev alexander-demicev added this to the v0.4.0 milestone May 31, 2024
@alexander-demicev alexander-demicev added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-priority Indicates an issue or PR needs a priority assigning to it needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/accepted Indicates an issue or PR is ready to be actively worked on.
Development

No branches or pull requests

2 participants