Docker Desktop for Windows comes shipped with kubernetes out of the box. It preconfigures a lot of stuff on your Windows machine, like downloads kubectl and puts everything in PATH variable, so that it can be accessed from powershell. But a lot of developers have took a liking to WSL which provides a more linux native environment for development. This post will go through steps to set up kubernetes for wsl.
You should have docker for desktop installed and WSL enabled to follow along.
Steps:
kubectl get nodes
If it shows docker-for-desktop
then it means kubernetes is running correctly.
sudo apt-get update && sudo apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubectl
cp /mnt/c/Users/{username}/.kube/config ~/.kube/config
This command copies your kubeconfig file from windows to wsl.
kubectl get nodes
to see a docker-for-desktop
node.
Mon Feb 11 2019