Enabling a local Kubernetes cluster with Docker for Mac

Docker for Mac includes a single node kubernetes install that you can enable via the Docker Properties dialog:

Using kubectl you can take a look at what contexts you have configured, at some point I was playing with minikube, so now I have two:

$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
docker-for-desktop docker-for-desktop-cluster docker-for-desktop
minikube minikube minikube

To switch to the Docker for Mac cluster:

$ kubectl config use-context docker-for-desktop
Switched to context "docker-for-desktop".

Check cluster info:

$ kubectl cluster-info
Kubernetes master is running at https://localhost:6443
KubeDNS is running at https://localhost:6443/api/v1/namespaces/kube-system/services/kube-dns/proxy

Check running nodes:

$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
docker-for-desktop Ready master 11m v1.10.3

Now to deploy some containers!

(For a summary of kubectl commands, I have a summary post here).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.