This method flawlessly installs and configures local 1-node Kubernetes cluster on Windows with Docker Desktop and WSL2 enabled.
First go to Docker Desktop -> Options -> Kubernetes
Check Enable Kubernetes
and confirm to install 1-node local Kubernetes cluster.
Execute following command. It will install dashboard and configure rbac authorization.
bash init-kubernetes-dashboard.sh
To install nginx ingress and set it as default ingress controller, call this command:
bash init-ingress-nginx.sh
In separate terminal call kubectl proxy
or bash run-proxy.sh
and leave it to execute as daemon.
Now to use Kubernetes Dashboard you can open this link in your browser http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/node?namespace=_all
Generate file with an actual bearer token using a command:
bash get-bearer-token.sh
It will create a file ./tokens/bearer-token.txt.user
. Copy and paste its content to the token input field on login page.
Congrats! You're all set up to continue your experiments with Kubernetes.