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

fix issue with rke2-install #346

Merged
merged 1 commit into from
Jul 2, 2024
Merged

fix issue with rke2-install #346

merged 1 commit into from
Jul 2, 2024

Conversation

alknopfler
Copy link
Contributor

What this PR does / why we need it:

This PR fix an issue #342 adding non-temporal bootstrap.success file to avoid systemd failure after reboot the system once provisioned.

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

Special notes for your reviewer:
Some lint changes because go lint discovered during the PR creation

Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@alknopfler
Copy link
Contributor Author

alknopfler commented Jun 7, 2024

Tests building local image:

  • after provisioning a host:
mgmt-cluster:/home/metal3 # clusterctl describe cluster xr11-3-cluster2
NAME                                                     READY  SEVERITY  REASON  SINCE  MESSAGE
Cluster/xr11-3-cluster2                                  True                     11s
├─ClusterInfrastructure - Metal3Cluster/xr11-3-cluster2  True                     15m
└─ControlPlane - RKE2ControlPlane/xr11-3-cluster2        True                     11s
  └─Machine/xr11-3-cluster2-ldn7l                        True                     11s

the systemd:

localhost:~ # systemctl status rke2-install
○ rke2-install.service - rke2-install
     Loaded: loaded (/etc/systemd/system/rke2-install.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Fri 2024-06-07 08:20:02 EDT; 38s ago
    Process: 3780 ExecStart=/etc/rke2-install.sh (code=exited, status=0/SUCCESS)
   Main PID: 3780 (code=exited, status=0/SUCCESS)

Jun 07 08:19:13 localhost.localdomain rke2-install.sh[3789]: [INFO]  downloading tarball at https://github.com/rancher/rke2/releases/download/v1.28.7+rke2r1/rke2.lin>
Jun 07 08:19:14 localhost.localdomain rke2-install.sh[3789]: [INFO]  verifying tarball
Jun 07 08:19:14 localhost.localdomain rke2-install.sh[3789]: [INFO]  unpacking tarball file to /opt/rke2
Jun 07 08:19:16 localhost.localdomain rke2-install.sh[3789]: [INFO]  updating tarball contents to reflect install path
Jun 07 08:19:16 localhost.localdomain rke2-install.sh[3789]: [INFO]  moving systemd units to /etc/systemd/system
Jun 07 08:19:16 localhost.localdomain rke2-install.sh[3789]: [INFO]  install complete; you may want to run:  export PATH=$PATH:/opt/rke2/bin
Jun 07 08:19:18 localhost.localdomain /semanage[4086]: Successful:  resrc=fcontext op=add tglob="/usr/lib/systemd/system/rke2-server.service" ftype=any tcontext=syst>
Jun 07 08:19:18 localhost.localdomain rke2-install.sh[4096]: Created symlink /etc/systemd/system/multi-user.target.wants/rke2-server.service → /etc/systemd/system/rk>
Jun 07 08:20:02 localhost.localdomain systemd[1]: rke2-install.service: Deactivated successfully.
Jun 07 08:20:02 localhost.localdomain systemd[1]: Finished rke2-install.

and both files created:

localhost:~ # cat /etc/cluster-api/bootstrap-success.complete
success
localhost:~ # cat /run/cluster-api/bootstrap-success.complete
success

After rebooting the system:

localhost:~ # systemctl status rke2-install
○ rke2-install.service - rke2-install
     Loaded: loaded (/etc/systemd/system/rke2-install.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
  Condition: start condition failed at Fri 2024-06-07 08:26:50 EDT; 33s ago

Jun 07 08:26:50 localhost.localdomain systemd[1]: Condition check resulted in rke2-install being skipped.

and only the /etc/ file is present (fixing the issue with ephimeral /run in sle micro):


localhost:~ # cat /run/
NetworkManager/  chrony-helper/   dbus/            ignition.env     issue.d/         mdadm/           netns/           setroubleshoot/  udev/
agetty.reload    cockpit/         dmeventd-client  initctl          k3s/             media/           nodeagent/       systemd/         user/
blkid/           containerd/      dmeventd-server  initramfs/       lock/            motd.d/          podman/          tmpfiles.d/      utmp
calico/          credentials/     faillock/        irqbalance/      log/             mount/           salt/            tpm2-tss/        xtables.lock
chrony/          cryptsetup/      fsck/            issue            lvm/             netconfig/       salt-tmp/        tuned/
localhost:~ # cat /etc/cluster-api/bootstrap-success.complete
success

Copy link
Member

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

looks good, can you fix linter warnings?
The problem with missing /run/cluster-api/bootstrap-success.complete after reboot still remains I guess since /run/ is ephemeral, but this issue can be addressed separately.

@furkatgofurov7 furkatgofurov7 added the kind/bug Something isn't working label Jun 10, 2024
Copy link
Contributor

@furkatgofurov7 furkatgofurov7 left a comment

Choose a reason for hiding this comment

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

/lgtm

@salasberryfin salasberryfin enabled auto-merge July 1, 2024 13:28
auto-merge was automatically disabled July 1, 2024 14:27

Head branch was pushed to by a user without write access

Signed-off-by: Alberto Morgante Medina <alberto.morgante@suse.com>
@salasberryfin salasberryfin merged commit 3b8655d into rancher:main Jul 2, 2024
7 checks passed
@alknopfler alknopfler deleted the fix-ignition-rke2-install branch July 2, 2024 10:24
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
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

IGNITION - rke2-install failder after reboot
4 participants