In a few articles, I’ve shared how to provision your own local Kubernetes (K8s) lab using VMs. Over the years this has simplified from Intro To Kubernetes to Spinning Up Kubernetes Easily with kubeadm init!. With modern tools, many of us do not need to manage our own VMs.
Podman is quickly becoming a favorite because instead of the monolithic architecture of Docker Desktop, Podman is broken out a bit and the licensing may be more appeasable to people.
Installing Podman is relatively easy. Just navigate to https://podman.io and download the installer for your platform. Once installed you will need to provision a Podman Machine. The back end depends on your platform. Windows will use WSL2 if available. MacOS will use a qemu VM. This is nicely abstracted.
Installing kind is very easy. Depending on your platform you may opt for a package manager. I use brew so its a simple
brew install kind
The site https://kind.sigs.k8s.io/docs/user/quick-start/#installation goes through all the options.
Provisioning the Cluster
Once these two dependencies are in play its a simple case of
kind create cluster
The defaults are enough to get you a control plane that is able to schedule workloads. There are custom options such as specific K8s version and multiple control plans and worker nodes to more properly lab up a production environment.
From here we should be good to go. Kind will provision the node and set up your KUBECONFIG to select the cluster.
As a quick validation we’ll run the recommended command.
We can see success and we’re able to apply manifests as we would expect. We have a working K8s instance for local testing.
In IaC & GitOps – Better Together we talked about GitOps. From here we can apply that GitOps repo if we wanted to.
We can clone the specific tag for this post and run the bootstrap
git clone https://github.com/dcatwoohoo/k8-fcos-gitops.git --branch postid_838 --single-branch
# We can check the status with the following until ingress-nginx is ready
kubectl get pods -A
# From there, check helm
helm ls -A
And here we are. A local testing cluster we stood up and is controlled by GitOps. Once flux was bootstrapped it pulled down and installed the nginx ingress controller.