rancher / rke2

https://docs.rke2.io/
Apache License 2.0
1.55k stars 267 forks source link

[Release-1.29] - Killall script should not unmount /var/lib/rancher/rke2/(server|agent) #6560

Closed vitorsavian closed 2 months ago

vitorsavian commented 2 months ago

Backport fix for Killall script should not unmount /var/lib/rancher/rke2/(server|agent)

endawkins commented 2 months ago

Validated on with /

Environment Details

Infrastructure

Node(s) CPU architecture, OS, and Version:

Linux ip-172-31-11-121 6.8.0-1012-aws #13-Ubuntu SMP Mon Jul 15 13:40:27 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

Cluster Configuration:

1 server

Config.yaml:

N/A

Additional files

N/A

Testing Steps

  1. Copy config.yaml
    $ sudo mkdir -p /etc/rancher/rke2 && sudo cp config.yaml /etc/rancher/rke2
  2. Install RKE2
  3. Mount server and agent dirs
  4. Run killall
  5. Verify server and agent directories are still present after killall

Replication Results: https://github.com/rancher/rke2/issues/6565#issuecomment-2303495748

Validation Results:

cat /proc/mounts | grep /var/lib/rancher/rke2/agent; cat /proc/mounts | grep /var/lib/rancher/rke2/server
/dev/root /var/lib/rancher/rke2/agent ext4 rw,relatime,discard,errors=remount-ro 0 0
/dev/root /var/lib/rancher/rke2/server ext4 rw,relatime,discard,errors=remount-ro 0 0

Additional context / logs: Scenario for custom data dir

cat /proc/mounts | grep /var/elwood/server; cat /proc/mounts | grep /var/elwood/agent
/dev/root /var/elwood/server ext4 rw,relatime,discard,errors=remount-ro,commit=30 0 0
/dev/root /var/elwood/agent ext4 rw,relatime,discard,errors=remount-ro,commit=30 0 0