Eu instalei o k3s no 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
eu tentei começar
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
O que status=203/EXEC
aponta?
Eu removi links simbólicos e diretório excluído
[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
eu tenho agora 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)
diário de saída ctl
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
Por que?
O resultado EXEC significa que o caminho especificado não pôde ser executado como um processo, por exemplo, porque não existe ou devido a permissões ou motivos semelhantes. (Geralmente os logs do sistema – por exemplo
journalctl
– mostrariam um motivo mais preciso.)De fato, o caminho especificado
/usr/local/bin/k3s
não é um executável e nem mesmo um arquivo - de acordo com a saída 'ls', é um diretório. O script de instalação não verificou essa possibilidade e apenas despejou o arquivo executável baixado no diretório.Remova todo o diretório "k3s", remova também os links simbólicos mencionados no script ("kubectl", "crictl" e "ctr") e execute novamente o script de instalação.