K8s Learning: Step 02 — Validate Initialization
02 — Validate Initialization
SSHes into the VM and asks Kubernetes to list its nodes. If k3s installed correctly, you'll see your VM listed as a ready node.
The Command
ssh $K3S_SSH_USER@$K3S_SSH_HOSTNAME 'sudo kubectl get nodes'
kubectl get nodes lists all machines in the cluster and their status. Note this runs on the VM via SSH — your local machine doesn't know how to talk to the cluster yet. The sudo is needed because k3s stores its config at a root-only path.
Expected Output
NAME STATUS ROLES AGE VERSION
your-vm Ready control-plane,master 30s v1.28.x+k3s1
Key things to look for:
- STATUS: Ready — the node is healthy and can accept workloads
- ROLES: control-plane,master — runs both management and workloads (typical for single-node)
- VERSION — confirms which k3s version was installed
What If It Fails?
- k3s may still be starting up — wait 30 seconds and retry
- Check the service:
sudo systemctl status k3s - Verify the VM has at least 512 MB RAM