1

I installed k3s on Ubuntu 22.04

curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --flannel-backend none" K3S_TOKEN=prokupljejbb sh -s -

[INFO]  Installing k3s to /usr/local/bin/k3s
[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, command exists in PATH at /usr/bin/ctr
[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

Status

systemctl status k3s
● k3s.service - Lightweight Kubernetes
     Loaded: loaded (/etc/systemd/system/k3s.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Fri 2023-04-28 12:48:49 CEST; 1s ago
       Docs: https://k3s.io
    Process: 77789 ExecStartPre=/bin/sh -xc ! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service (code=>
    Process: 77791 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status=0/SUCCESS)
    Process: 77792 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
    Process: 77793 ExecStart=/usr/local/bin/k3s server --flannel-backend none (code=exited, status=203/EXEC)
   Main PID: 77793 

I tried to start

systemctl start k3s
Job for k3s.service failed because the control process exited with error code.
See "systemctl status k3s.service" and "journalctl -xeu k3s.service" for details.

ls -laZ /usr/local/bin/k3s
total 65716
drwxr-xr-x 2 root root ?     4096 апр 28 12:47 .
drwxr-xr-x 3 root root ?     4096 апр 28 12:47 ..
-rwxr-xr-x 1 root root ? 67284992 апр 28 12:47 k3s.bin

What does status=203/EXEC point to?

I removed symlinks and deleted directory

[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Creating /usr/local/bin/ctr symlink to k3s
[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

I got now 0

   Process: 97794 ExecStartPre=/bin/sh -xc ! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service (code=>
    Process: 97796 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status=0/SUCCESS)
    Process: 97797 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS)
    Process: 97798 ExecStart=/usr/local/bin/k3s server --flannel-backend none (code=exited, status=1/FAILURE)
   Main PID: 97798 (code=exited, status=1/FAILURE)

output journalctl

The process' exit code is 'exited' and its exit status is 1.
апр 28 13:31:32 miki-IdeaPad systemd[1]: k3s.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit k3s.service has entered the 'failed' state with result 'exit-code'.
апр 28 13:31:32 miki-IdeaPad systemd[1]: Failed to start Lightweight Kubernetes.
░░ Subject: A start job for unit k3s.service has failed
░░ Defined-By: systemd

Why?

1 Answer 1

1

The EXEC result means the specified path could not be executed as a process, e.g. because it doesn't exist or because of permissions or similar reasons. (Generally the system logs – e.g. journalctl – would show a more precise reason.)

Indeed, the specified path /usr/local/bin/k3s is not an executable and not even a file at all – according to your 'ls' output, it is a directory. The installation script didn't check for this possibility and just dumped the downloaded executable file into the directory.

Remove the entire "k3s" directory, also remove the symlinks that the script mentions ("kubectl", "crictl", and "ctr"), then re-run the installation script.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .