Smoke test the cluster
If all has gone well, a cluster will now be running on your local system comprising of 3 nodes and a workstation.
We can check status by now switching directory to the vagrant dev folder and running a vagrant status
command :
cd vagrant/dev/ubuntu/vagrant statusCurrent machine states:
vm1 running (virtualbox)vm2 running (virtualbox)vm3 running (virtualbox)workstation running (virtualbox)
This environment represents multiple VMs. The VMs are all listedabove with their current state. For more information about a specificVM, run `vagrant status NAME`.
To work on our cluster we must first connect to the workstation
and then use kubectl
commands to interact with k3s
:
vagrant ssh workstation
From the workstation, use kubectl
to access our cluster
kubectl get nodesNAME STATUS ROLES AGE VERSIONvm1 Ready control-plane,etcd,master 4h11m v1.33.3+k3s1vm2 Ready control-plane,etcd,master 4h11m v1.33.3+k3s1vm3 Ready control-plane,etcd,master 4h10m v1.33.3+k3s1
If you have got this far, congratulation you have a locally hosted k3s cluster running in 3 virtual machines and a workstation that can be used to manage it using kubectl
and ansible
.