Docker CE Edge installer come with experimental features in Docker Engine enabled by default and these features are configurable on Docker Daemon preferences.
Docker CE Edge installer comes with experimental features in Docker Engine enabled by default and these features are configurable on Docker Daemon preferences.
Go [docker-for-mac Edge](https://download.docker.com/mac/edge/Docker.dmg) to install it. This tutorial is tested with Docker for Mac using Edge channel.
...
...
@@ -22,14 +22,14 @@ Docker for Mac Edge kubernetes integration installed `kubectl v.1.9` command in
for some of the Kubernetes feature to work. Let's fix it and make sure `kubectl` version is 1.10.x:
```console
$rm /usr/local/bin/kubectl
$rm /usr/local/bin/kubectl
$brew reinstlal kubectl
$kubectl version -c
Flag shorthand -c has been deprecated, please use --client instead.
Click the `Docker` icon in the status bar, go to `Preferences`, and on the `Kubernetes` tab, check *Enable Kubernetes*. This will start a single node Kubernetes cluster. This might take a while - have a cup of tea and wait for the Kubernetes cluster to be ready.
...
...
@@ -49,9 +49,9 @@ You may have other versions of kubectl in your command path (/opt/bin, $HOME/bin
If you have been working with Kubernetes, you may have multiple cluster configurations in your $HOME/.kube directory. These kubeconfig files contain clusters's API server URL, user credentials etc. You can use *kubectx* to list, show, and switch context. Run `kubectx -h` for details.
* List kube contexts
* List kubernetes contexts
```console
```console
$kubectx
docker-for-desktop
* eks-preview
...
...
@@ -71,6 +71,7 @@ Switched to context "docker-for-desktop".
* Get kubernetes docker-for-descktop context details:
```console
$kubectx docker-for-desktop
$kubectl config view --minify
apiVersion: v1
clusters:
...
...
@@ -97,7 +98,7 @@ 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
Here we will demonstrate `kubectl port-forward` feature. We will connect to the Redis master server we just deployed for the guestbook app. Even the port 6379 is not open to the Internet, we can connect to the server by port-forwarding.
* Access to redis-master
- Access to redis-master
```console
$kubectl port-forward svc/redis-master 6379:6379
...
...
@@ -205,7 +206,7 @@ Forwarding from 127.0.0.1:6379 -> 6379
Handling connection for 6379
```
On another terminal on your local machine, try:
On another terminal on your local machine, the `redis-cli` command talks to redis master through Kubernetes proxy:
```console
$brew upgrade redis || brew install redis
...
...
@@ -242,9 +243,47 @@ quit
You can Control-C to terminate the port-forward proxy in the other terminal.
* Access guestbook
The guestbook deployment uses "LoadBalancer" service type for guestbook frontend running at 10.105.182.163:80, which means internal pods can find the service endpoint to access guestbook without knowing guestbook pods addresses. To access from outside of the kubernetes cluster network, without expose it to Internet, we can use port-forwarding:
- Access guestbook
When we start the guestbook application, the frontend container register its service name and port with Kubernetes
@@ -376,7 +410,7 @@ NOTE: Although you have deleted all the kuberntes workload you installed, your c
## What's next
You now have a Kubernetes cluster on your laptop. You can play, learn, develope your kubernetes applications before you put the load on a production kubernetes system.
You now have a Kubernetes cluster on your laptop. You can play, learn, develope your kubernetes applications before you put the load on a production kubernetes system.
You can use the cluster you just enable to complete [Kubernetes tutorial](https://kubernetes.io/docs/tutorials/).