The tooling for K8s on Windows has come a long way over the last couple of years and is starting to stabilise. Minikube 'just works' and you no longer need to fight it (stopping the cluster works now, yay!).
However the tooling has also become so prolific it tends to end up in various places on your machine nested inside other tools. So lets straighten that out.
Windows ends up with a mess of kubectl versions kicking around - VS 2019 has its own, Docker for Windows has its own, Azure Dev Spaces has its own, you may have downloaded the MSI, you may have installed it via Chocolatey.
To keep a consistent tool experience along with all of my other dev tooling (where possible) I like to ensure I install via Chocolatey
choco install -y kubernetes-cli
The next trick to make sure that is the version I'm always using regardless of where my terminal is, I'll ensure C:\ProgramData\chocolatey\bin\kubectl.exe
is promoted to the top of the list in my System Environmental Variables.
Same goes for Minikube as Kubectl - various tools might have installed their own version of it, so use Chocolatey to ensure when we call minikube
we are getting the version we installed, not some tool.
minikube start --vm-driver hyperv --alsologtostderr
When you start your cluster Minikube will take care of configuring your kubectl
context to work with Minikube too. Neat!
These tools move fast - if you've played with them before, clean up any existing Minikube VMs with minikube delete
before starting a new one, as you'll likely find its default tooling no longer matches up with your local kubectl
, or other version discrepancies.
Your weapon of choice should be kubectl
for navigating around the insides of your cluster, however sometimes it is nice to have a GUI to quickly get a lay of the land.
Previously enabling the Kubernetes dashboard involved some hacks, but now it can simply be enabled and accessed via minikube dashboard
.
What this does is actually kick off a Deployment of a new set of Services within Minikube, under the kubernetes-dashboard
namespace. You can jump in and explore it from the dashboard - it is a nice way to get to look around what pieces a fairly standard Deployment will create within your cluster - Pods, Replica Sets, Services, Ingress, Config Maps, etc.