In this video series our Docker Captain, Microsoft MVP for Windows insider Nuno “WSL Corsair” do Carmo will show how to set up the MicroK8s Kubernetes on Windows, together with Jorge Arteiro and Fernando Rolnik.
Part 1 – Install and Config
This first part show how to download, install and config the Microk8s on Windows with Multipass, how to connect to the Kubernetes Dashboard and how to deploy a pod.
- Download and install the MicroK8s for Windows, it includes Multipass.
- Before you create the MicroK8s VM, Open a terminal as administrator and check if your multipass localdriver is hyperv:
multipass get local.driver
- If you need to change it use:
multipass set local.driver=hyperv
- Use microk8s.exe status to check the status
- Enable DNS and Dashboard:
microk8s.exe enable dns dashboard
microk8s.exe --helpto see all the commands
- Connect to the Dashboard with
microk8s.exe dashboard-proxyand open your browser using the supplied address and token
- Deploy the microbot
microk8s.exe kubectl create deployment microbot --image=dontrebootme/microbot:v1
- Expose the deployment
microk8s.exe kubectl expose deployment microbot --type=LoadBalancer --port 80 --name=microbot-serviceand check how to port forward on the next video.
Part 1.1 – How to connect to a pod
In this 1.1 part, Fernando show how the microk8s.exe act as a proxy for the kubectl inside the Multipass MicroK8s VM and allow you easily port-forward to your pod from your Windows
- Follow the steps from the previous video and expose the ports usinmg the command
microk8s.exe kubectl port-forward -n default --address 0.0.0.0 service/microbot-service 80:80
- Check the microk8s-vm IPv4
- Open your browser in
https://<microk8s-mv IPv4>/to see the robot
Part 2 – Multi-node
Now, Nuno will show how to deploy a second node on MicroK8s on Windows, using Multipass and cloud-init.
- Check you have only one multipass instance:
- You may use the cloud-init fike showed on the video to create the additional nodes, or you can create it and install manually following the instructions above:
- Create a new node:
multipass launch --name microk8sNode1 focal
- Install Microk8s in the node:
multipass exec microk8sNode1 -- snap install microk8s --classic
- Add a node in your Windows Microk8s:
microk8s.exe add-nodeand copy the output with the microk8s join command.
- Run the join command on microk8sNode1:
multipass exec microk8sNode1 -- <Join command copied>
Follow us on Twitter
Subscribe the Azuretar YouTube Channel