You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node(s) CPU architecture, OS, and Version:
Linux ubuntu-2gb-ash-1 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Cluster Configuration:
1 server
Describe the bug:
Whenever a cli flag changes when rerunning the server binary, the service will restart. This makes sense as there was a change in the configuration so it has to restart to apply those changes. However if there is a change in any of the configuration files, either /etc/rancher/k3s/config.yaml or /etc/rancher/k3s/config.yaml.d/*.yaml, the service does not restart so the changes do not get applied automatically. The user must then manually restart the service.
Expected behavior:
The systemd server should restart since a config file has changed. Whenever any of the config files change, the service should restart.
[INFO] Finding release for channel stable
[INFO] Using v1.30.5+k3s1 as release
[INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.30.5+k3s1/sha256sum-amd64.txt
[INFO] Skipping binary downloaded, installed k3s matches hash
[INFO] Skipping installation of SELinux RPM
[INFO] Skipping /usr/local/bin/kubectl symlink to k3s, already exists
[INFO] Skipping /usr/local/bin/crictl symlink to k3s, already exists
[INFO] Skipping /usr/local/bin/ctr symlink to k3s, already exists
[INFO] Creating killall script /usr/local/bin/k3s-killall.sh
[INFO] Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO] env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO] systemd: Creating service file /etc/systemd/system/k3s.service
[INFO] systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO] systemd: Starting k3s
Actual behavior:
The service does not restart.
[INFO] Finding release for channel stable
[INFO] Using v1.30.5+k3s1 as release
[INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.30.5+k3s1/sha256sum-amd64.txt
[INFO] Skipping binary downloaded, installed k3s matches hash
[INFO] Skipping installation of SELinux RPM
[INFO] Skipping /usr/local/bin/kubectl symlink to k3s, already exists
[INFO] Skipping /usr/local/bin/crictl symlink to k3s, already exists
[INFO] Skipping /usr/local/bin/ctr symlink to k3s, already exists
[INFO] Creating killall script /usr/local/bin/k3s-killall.sh
[INFO] Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO] env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO] systemd: Creating service file /etc/systemd/system/k3s.service
[INFO] systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO] No change detected so skipping service start
Since the service didn't restart automatically the original snapshot-cron value stays the same, and the new value does not get applied.
Additional context / logs:
Currently when deciding to restart the service it will compare the hash of the created service file and the env file
Proposed change to package/rpm/install.sh which includes any config files:
get_installed_hashes() {
files="${BIN_DIR}/k3s ${FILE_K3S_SERVICE}${FILE_K3S_ENV}"# Check if config.yaml exists, and if so, add it to the files list
[ -f${CONFIG_DIR}/config.yaml ] && files+="${CONFIG_DIR}/config.yaml"# Check if the config.yaml.d directory exists and has any .yaml filesif [ -d${CONFIG_DIR}/config.yaml.d ] &&compgen -G "${CONFIG_DIR}/config.yaml.d/*.yaml"> /dev/null;then
files+="${CONFIG_DIR}/config.yaml.d/*.yaml"fi# Compute the SHA256 checksums of the listed files$SUDO sha256sum $files2>&1||true
}
The text was updated successfully, but these errors were encountered:
The install script doesn't manage the contents of the config files, or env files other than the one it creates, and makes no attempt to restart the service when their contents change. This is by design; we have no plans to make the install script restart the service if the contents of files it does not manage change.
Environmental Info:
K3s Version: v1.30.5+k3s1 (9b58670)
Node(s) CPU architecture, OS, and Version:
Linux ubuntu-2gb-ash-1 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Cluster Configuration:
1 server
Describe the bug:
Whenever a cli flag changes when rerunning the server binary, the service will restart. This makes sense as there was a change in the configuration so it has to restart to apply those changes. However if there is a change in any of the configuration files, either
/etc/rancher/k3s/config.yaml
or/etc/rancher/k3s/config.yaml.d/*.yaml
, the service does not restart so the changes do not get applied automatically. The user must then manually restart the service.Steps To Reproduce:
Expected behavior:
The systemd server should restart since a config file has changed. Whenever any of the config files change, the service should restart.
Actual behavior:
The service does not restart.
Since the service didn't restart automatically the original snapshot-cron value stays the same, and the new value does not get applied.
Additional context / logs:
Currently when deciding to restart the service it will compare the hash of the created service file and the env file
k3s/package/rpm/install.sh
Line 753 in 0438011
Proposed change to
package/rpm/install.sh
which includes any config files:The text was updated successfully, but these errors were encountered: