The following programs / APIs / SDKs should be installed in your system.
The first time installing Docker Desktop might require some additional set up.
To run docker desktop on windows wsl needs to be enabled. To do this follow the instructions provided here.
- From the Docker Dashboard, select the Settings.
- Select Kubernetes from the left sidebar.
- Next to Enable Kubernetes, select the checkbox.
- Select Apply & Restart to save the settings and then select Install to confirm. This instantiates images required to run the Kubernetes server as containers, and installs the /usr/local/bin/kubectl command on your machine.
Once you have installed Docker Desktop and enabled Kubernetes, you can use kubectl commands. To check if it works run the following command.
kubectl version -o=yaml
Which should yield a result like below.
clientVersion:
buildDate: "2023-03-15T13:40:17Z"
compiler: gc
gitCommit: 9e644106593f3f4aa98f8a84b23db5fa378900bd
gitTreeState: clean
gitVersion: v1.26.3
goVersion: go1.19.7
major: "1"
minor: "26"
platform: windows/amd64
kustomizeVersion: v4.5.7
Binding the Kubernetes CLI to Azure can be done with the following command. Note that you have to be logged in to Azure for this to work.
az aks get-credentials -g <resource-group-name> -n <aks-cluster-name> --overwrite-existing
After executing the command, any kubectl commands will be run on the connected cluster. To connect to a different cluster, first retreive a list of all available clusters.
kubectl config get-contexts
Then the following command can be used to switch to the desired cluster.
kubectl config use-context <<NAME>>