Mac Docker comes with kubernetes embedded which can be enabled. Here the steps to enable and use kubernetes:
- Click on settings icons in Docker desktop, select Kubernetes menu item and select “Enable Kubernetes” and “Show system containers”. Then click apply and restart.
- This will also install kubectl in /user/local/
$ ls -l /usr/local/bin/kubectl lrwxr-xr-x 1 root wheel 55 Dec 11 20:22 /usr/local/bin/kubectl -> /Applications/Docker.app/Contents/Resources/bin/kubectl
- Install kubernetes dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
- Create service account by creating dashboard-adminuser.yaml with following content
apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: admin-user roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: admin-user namespace: kubernetes-dashboard
And then runkubectl apply -f dashboard-adminuser.yaml
- Create token
kubectl -n kubernetes-dashboard create token admin-user --duration=36000s
- Start proxy
kubectl proxy - View dashboard on the url http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
- Enter the token created above and click on sign in