The official Docker CE client (Edge track) now can use Kubernetes for orchestration. I’m sure that by now you have installed Docker (Stable), and the about window looks like this:

Switching to Edge track requires you to download a new docker client from Edge. Once installed, the about window will look like this

Now that we have the Docker CE Edge client we have to enable Kubernetes in preferences (has a dedicated tab for it). We will Enable Kubernetes, and I will activate the show system containers to show extra information.

It takes a while to change the status to running as it has to download some images for the Kubernetes roles.
$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE docker/kube-compose-controller v0.3.0-rc1 d099699fac52 4 weeks ago 25.8MB docker/kube-compose-api-server v0.3.0-rc1 6c13a6358efa 4 weeks ago 39MB gcr.io/google_containers/kube-apiserver-amd64 v1.9.2 7109112be2c7 5 weeks ago 210MB gcr.io/google_containers/kube-proxy-amd64 v1.9.2 e6754bb0a529 5 weeks ago 109MB gcr.io/google_containers/kube-controller-manager-amd64 v1.9.2 769d889083b6 5 weeks ago 138MB gcr.io/google_containers/kube-scheduler-amd64 v1.9.2 2bf081517538 5 weeks ago 62.7MB gcr.io/google_containers/etcd-amd64 3.1.11 59d36f27cceb 2 months ago 194MB gcr.io/google_containers/k8s-dns-sidecar-amd64 1.14.7 db76ee297b85 4 months ago 42MB gcr.io/google_containers/k8s-dns-kube-dns-amd64 1.14.7 5d049a8c4eec 4 months ago 50.3MB gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64 1.14.7 5feec37454f4 4 months ago 41MB gcr.io/google_containers/pause-amd64 3.0 99e59f495ffa 22 months ago 747kB
Once the state of the Kubernetes service is in running, let’s interact with it! As usual, we will use kubectl. Remember how important is to have the same version in the client and the server? Well, there is more this time. As I have both Minikube and Docker CE Kubernetes running in my machine, something is not right when I launch my kubectl…
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T10:09:24Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
Unable to connect to the server: dial tcp 192.168.99.101:8443: i/o timeout
Every Kubernetes configuration has a context, to see what contexts are available we have the get-contexts option:
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
docker-for-desktop docker-for-desktop-cluster docker-for-desktop
* minikube minikube minikube
As you can see there are 2 different contexts and the current (default) that the kubectl is using is the minikube one (as expected). To switch context we can use the use-context option, using the name of the context that we want to use.
$ kubectl config use-context docker-for-desktop Switched to context "docker-for-desktop".
As we are now using the docker-for-desktop context, let’s now try kubectl again
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T10:09:24Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T09:42:01Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Works! Note that the Client and Server versions Matches, and it’s v1.9.2
$ kubectl get nodes NAME STATUS ROLES AGE VERSION docker-for-desktop Ready master 20m v1.9.2
Some more information about the cluster (where are the services running)
$ 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:dns/proxy To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
And we have our local Kubernetes from Docker CE running and Ready. Easy to obtain and install, but is as versatile as Minikube?
Changing the Kubernetes version
As we saw in the about dialog after installing the Edge version of Docker client and in the kubectl version output we are running a Kubernetes v1.9.2. But what if we want to change it as we did in Minikube?
There is nothing in the interface that allows us to switch the kubernetes version. Some searching in google shows us that the Kubernetes version is (for now) tied to the Docker (Edge) Client version that you have installed. Well, that leaves us with only one way to change the Kubernetes version: download an older client.
By looking in the release notes page we can find information about latest Docker Clients. Searching by Kubernetes we can find that the experimental support for Kubernetes was added in the Docker Community Edition 17.12.0-ce-mac45 (Edge) version, with a v1.8.2. But as we can see, in the release notes page there is no download link for any of the Edge releases. How do we obtain such version if we want? As this information is not widely available, I’ve found in this thread a script (credits to Jonathan Sokolowski) that bruteforces the download link by guessing the build number. So putting “edge” in the channel and pushing the build number up to 22000…
channel=edge build=22000 for build in $(seq $build 1800); do if curl -X HEAD -fsSL -I https://download.docker.com/mac/$channel/$build/Docker.dmg >/dev/null 2>/dev/null; then echo "Found build: $build" curl -X HEAD -fsSL -I https://download.docker.com/mac/$channel/$build/Docker.dmg fi done
Outputs lots of versions in the 18.01 branch, but after a while a 17.12 version is out…
Found build: 21620 HTTP/1.1 200 OK Content-Type: binary/octet-stream Content-Length: 348671743 Connection: keep-alive Date: Sun, 25 Feb 2018 13:07:11 GMT x-amz-meta-humanversion: 17.12.0-ce-mac45 (21620) x-amz-meta-sha1: 64ea38dcf45d5107582d0db71540320b1e81d687 x-amz-meta-channel: edge x-amz-meta-version: 17.12.0-ce-mac45 x-amz-meta-checksum: 05f8c934ebb975133374accbd12197ccc4c6e8c921e18135a084f8b474ef7aeb x-amz-meta-arch: mac x-amz-meta-build: 21620 Last-Modified: Thu, 04 Jan 2018 09:34:55 GMT x-amz-version-id: hJLLaKrBYXIekjaIRMMhzTGleBC2J_zt ETag: "eac95b06d547b2d6b02364fe8b448dd9-67" Server: AmazonS3 X-Cache: Hit from cloudfront Via: 1.1 d7f531af10bfff5400817f213f0b7761.cloudfront.net (CloudFront) X-Amz-Cf-Id: zQPHhfJGvJlhSXlCmOau4GaF1w_kKUTdO6ZDNa6C61GzJPXOzq5hzA==
So using the 21620 build number we finally can create the download link
https://download.docker.com/mac/edge/21620/Docker.dmg
Installing it results in obtaining the v1.8.2 Kubernetes version.

There is a more advanced version scrapper in https://github.com/jsok/docker-for-mac-versions written in python that outputs the information in json and can limit the maximum number of builds to scan.
Maybe in the future, it will be easier to perform this operation. Meanwhile, I think the effort is not worth it… For the moment, this seems like siren calls…





