Stopping K3s

To allow high availability during upgrades, the K3s containers continue running when the K3s service is stopped.

K3s Service

Stopping and restarting K3s is supported by the installation script for systemd and OpenRC.

  • systemd
  • OpenRC

To stop servers:

  1. sudo systemctl stop k3s

To restart servers:

  1. sudo systemctl start k3s

To stop agents:

  1. sudo systemctl stop k3s-agent

To restart agents:

  1. sudo systemctl start k3s-agent

To stop servers:

  1. sudo rc-service k3s stop

To restart servers:

  1. sudo rc-service k3s restart

To stop agents:

  1. sudo rc-service k3s-agent stop

To restart agents:

  1. sudo rc-service k3s-agent restart

Killall Script

To stop all of the K3s containers and reset the containerd state, the k3s-killall.sh script can be used.

The killall script cleans up containers, K3s directories, and networking components while also removing the iptables chain with all the associated rules. The cluster data will not be deleted.

To run the killall script from a server node, run:

  1. /usr/local/bin/k3s-killall.sh