https://rancher.com/ logo
#k3s
Title
# k3s
q

quaint-army-49808

03/10/2023, 4:42 PM
Hi, i'm looking for some advice on how to restart k3s service from a container running inside. In a air gapped environment solution i provide a way for the user to change machine's network settings and whenever the IP changes the k3s cluster requires a restart to fully function. I've tried running a job with "systemctl restart k3s" but i get a
dbus
error (
no data available
iirc) Is there a way for me to do this? Thanks!
h

hundreds-evening-84071

03/10/2023, 5:00 PM
I normally run
k3s-killall.sh
this will terminate k3s processes
q

quaint-army-49808

03/10/2023, 5:06 PM
but then the k3s service is stopped, i need it restarted
r

rough-farmer-49135

03/10/2023, 5:46 PM
I think a normal systemctl stop (or restart) with k3s & rke2 will leave the static containers running and potentially any other cluster containers too. You might need to do a systemctl stop & then k3s-killall.sh and then be able to do a systemctl start without the error?
If you're redundant and drain your nodes and stagger it then the cluster would theoretically run, though if it's having problems from an IP change then maybe not?
q

quaint-army-49808

03/11/2023, 7:43 AM
i have manually tried
systemctl restart k3s
and it solves the issue. My problem is that i can't run that from within a container in the cluster and thus the question. Is there a way to restart k3s from within using something else than
systemctl
or is there a way to use
systemctl
from within container?
845 Views