Not able to get Vagrant to use k3s command even though I have installed it

Hi experts,

I am running into another road block which I hope to get some help.

So, after able to get the vagrant box to include the path where I need to use Argo-cd with my dockerfile, I proceeded to install k3s which is needed in my case.

I then used this command to do it:

[email protected]:\~> curl -sfL [https://get.k3s.io](https://get.k3s.io) | sh -

But, after the installation is done, I can't get it to do the k3s command

[email protected]:~> curl -sfL https://get.k3s.io | sh -
[INFO] Finding release for channel stable
[INFO] Using v1.21.3+k3s1 as release
[INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.21.3+k3s1/sha256sum-amd64.txt
[INFO] Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.21.3+k3s1/k3s
[INFO] Verifying binary download
[INFO] Installing k3s to /usr/local/bin/k3s
[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] systemd: Starting k3s
sudo su
[email protected]:~> sudo su
localhost:/home/vagrant # sudo k3s kubectl get node
sudo: k3s: command not found
localhost:/home/vagrant # :q
bash: :q: command not found
localhost:/home/vagrant # ^C
localhost:/home/vagrant # exit
[email protected]:~> sudo k3s kubectl get node
sudo: k3s: command not found
[email protected]:~> sudo chown vagrant.vagrant /etc/rancher/k3s/k3s.yaml
[email protected]:~> sudo k3s kubectl get node
sudo: k3s: command not found
[email protected]:~> sudo su
localhost:/home/vagrant # sudo k3s kubectl get node
sudo: k3s: command not found
localhost:/home/vagrant # curl -sfL https://get.k3s.io | sh -
[INFO] Finding release for channel stable
[INFO] Using v1.21.3+k3s1 as release
[INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.21.3+k3s1/sha256sum-amd64.txt
[INFO] Skipping binary downloaded, installed k3s matches hash
[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, already exists
[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
localhost:/home/vagrant # sudo k3s kubectl get node
sudo: k3s: command not found
localhost:/home/vagrant #

May I know what is it that caused vagrant to able to accept k3s command or is the command wrong or what ?

Tks.

1 thought on “Not able to get Vagrant to use k3s command even though I have installed it”

Leave a Comment