K3s fatal error
The steps to follow when the k3s service won’t start
Steps / Information Gathering
Section titled “Steps / Information Gathering”Check the config
Section titled “Check the config”Resolve of fail of a k3s check-config
k3s check-config# you can ignore modprobe: FATAL: Module configs not found (see above)Example of fail
Generally Necessary:- apparmor: enabled, but apparmor_parser missing (fail) (use "apt-get install apparmor" to fix this)Note that
Terminal window modprobe: FATAL: Module configs not found in directory /lib/modules/6.1.0-23-amd64where:
6.1.0-23-amd64is the output ofuname -rIt’s not really fatal, this is a red herring. There is no kernel module missing. System verification needs to find the kernel configuration file and canot find it.
If:
- the configuration file cannot be found,
- there is no configs module, > system verification check will just error out.
Check the system service unit
Section titled “Check the system service unit”Check the validity of the system service unit.
Grab the k3s command issued and execute it on a shell.
cat /etc/systemd/system/k3s.serviceExample:
ExecStart=/usr/local/bin/k3s server '--disable=traefik'Journal / Status / Log
Section titled “Journal / Status / Log”When running under Systemd, logs
are sent to Journald and can be viewed using journalctl.
sudo systemctl status k3s.service# Last 50journalctl -u k3s.service -n 50# tailjournalctl -u k3s.service -f# log since the last machine bootjournalctl -u k3s.service -bYou can generate more detailed logs by using the --debug flag when starting K3s
(or debug: true in the configuration file).
Get more information on the play with the debug flag
Section titled “Get more information on the play with the debug flag”You can add the --debug flag to see all variables.
kubee --debug --cluster "$KUBEE_CLUSTER_NAME" cluster playCheck the known-issues
Section titled “Check the known-issues”If no clue: https://docs.k3s.io/known-issues
Once resolved
Section titled “Once resolved”Check alive / cluster info
Section titled “Check alive / cluster info”# on serverk3s kubectl cluster-info# on clientkubee --cluster "$KUBEE_CLUSTER_NAME" kubectl cluster-info