This workspace contains a simple setup for turning an Ubuntu VM in Azure into a single-node Kubernetes cluster for lab and on-prem-like experimentation.
The script installs:
- containerd as the container runtime
- kubeadm, kubelet, and kubectl
- a basic single-node Kubernetes control plane
- Flannel networking
- An Ubuntu VM in Azure, preferably Ubuntu 22.04 or 24.04
- At least 2 vCPUs and 4 GB RAM
- SSH access to the VM
- Network security group rules that allow the Kubernetes API and node ports if you want external access
For a lab setup, allow these ports from your source IP or subnet:
- 6443/tcp for the Kubernetes API
- 2379-2380/tcp for etcd
- 10250/tcp for kubelet
- 30000-32767/tcp for NodePort services
-
Copy the script to your VM:
scp scripts/install-k8s-single-node.sh user@YOUR_VM_IP:/tmp/
-
SSH into the VM:
ssh user@YOUR_VM_IP
-
Run the script:
chmod +x /tmp/install-k8s-single-node.sh sudo /tmp/install-k8s-single-node.sh
-
Verify the cluster:
kubectl get nodes kubectl get pods -A
To use Kubernetes from your local machine, copy the kubeconfig:
mkdir -p ~/.kube
scp user@YOUR_VM_IP:/etc/kubernetes/admin.conf ~/.kube/configThis is intended for a learning or lab environment. For production, use a multi-node control plane and a supported production-grade CNI such as Calico.