Skip to content

antony@notes:~/rancher$ cat "How-to-update-rke2-to-cis-profile.md"

How to update rke2 to cis profile

2026-02-24· rancher

How to update rke2 to cis profile

以下命令要先在 update 之前執行

Control-plane node 跑

sudo cp -vf /usr/local/share/rke2/rke2-cis-sysctl.conf /etc/sysctl.d/60-rke2-cis.conf && \
sudo systemctl restart systemd-sysctl && \
sudo useradd -r -c "etcd user" -s /sbin/nologin -M etcd -U; \
sudo reboot

如果先更新下去會在 rke2-server 的 service 看到以下錯誤訊息

missing required: user: unknown user etcd\nmissing required: group: unknown group etcd\n

worker node 跑 (如果是透過 Rancher 去更新,以下指令不用做)

cp /opt/rke2/share/rke2/rke2-cis-sysctl.conf /etc/sysctl.d/60-rke2-cis.conf && \
systemctl restart systemd-sysctl

reboot

Ref