You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2018/09/28 23:16:13 UTC
[incubator-openwhisk-deploy-kube] branch master updated: Document
using the Kubernetes support available in Docker 18.06 (#304)
This is an automated email from the ASF dual-hosted git repository.
csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-deploy-kube.git
The following commit(s) were added to refs/heads/master by this push:
new fd6ff1e Document using the Kubernetes support available in Docker 18.06 (#304)
fd6ff1e is described below
commit fd6ff1ee524bb525cf51937a801d461dd17de551
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Fri Sep 28 19:16:07 2018 -0400
Document using the Kubernetes support available in Docker 18.06 (#304)
---
README.md | 36 +++++++++++++++++++++++++++++++++++-
docs/ingress.md | 20 ++++++++++++++++++++
2 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5e8d131..cfab7ec 100644
--- a/README.md
+++ b/README.md
@@ -60,6 +60,24 @@ Travis CI testing.
For details on setting up Minikube, see these [instructions](docs/minikube.md).
+### Using Kubernetes in Docker for Mac
+
+Docker 18.06 for Mac added built-in support for running a single node Kubernetes cluster.
+Using this capability, you can use Helm to deploy to Kubernetes on your laptop without
+needing to install Minikube or an additional layer of virtualization.
+
+Step-by-step instructions on enabling Kubernetes in Docker are
+available as part of the
+[Getting started](https://docs.docker.com/docker-for-mac/#general)
+documentation from Docker.
+
+In a nutshell, open the Docker preferences pane, switch to the
+Kubernetes panel, and check the box to enable Kubernetes. You will
+want to use the `kubectl` cli that is installed by Docker in
+`/usr/local/bin` and is configured to access the Kubernetes cluster
+running in Docker, so please make sure it is appears in your path
+before any `kubectl` you have installed on your machine.
+
### Using a Kubernetes cluster from a cloud provider
You can also provision a Kubernetes cluster from a cloud provider, subject to the cluster meeting the requirements above.
@@ -128,7 +146,11 @@ You will need to create a mycluster.yaml file that records how the
OpenWhisk deployment on your cluster will be accessed by clients. See
the [ingress discussion](./docs/ingress.md) for details. Below is a sample
file appropriate for a Minikube cluster where `minikube ip` returns
-`192.168.99.100` and port 31001 is available to be used.
+`192.168.99.100` and port 31001 is available to be used. If you are
+using Docker for Mac, you can use the same configuration but use the
+command `kubectl describe nodes | grep InternalIP` to determine the
+value for `api_host_name`.
+
```yaml
whisk:
@@ -175,6 +197,18 @@ with the actual values from your mycluster.yaml.
wsk property set --apihost whisk.ingress.api_host_name:whisk.ingress.api_host_port
wsk property set --auth 23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
```
+### Configuring the CLI for Kubernetes on Docker for Mac
+
+The `docker0` network interface does not exist in the Docker for Mac
+host environment. Instead, exposed NodePorts are forwarded from localhost
+to the appropriate containers. This means that you will use `localhost`
+instead of `whisk.ingress.api_host_name` as your apihost when configuring
+the `wsk` cli.
+
+```shell
+wsk property set --apihost localhost:whisk.ingress.api_host_port
+wsk property set --auth 23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP
+```
## Verify your OpenWhisk Deployment
diff --git a/docs/ingress.md b/docs/ingress.md
index 73c32d8..c7ec209 100644
--- a/docs/ingress.md
+++ b/docs/ingress.md
@@ -68,6 +68,26 @@ nginx:
httpsNodePort: 31001
```
+## Setting up NodePort on Kubernetes in Docker for Mac
+
+First, obtain the IP address of the single Kubernetes worker node.
+```shell
+kubectl describe nodes | grep InternalIP
+```
+This should produce output like: `InternalIP: 192.168.65.3`
+
+Next pick an unassigned port (eg 31001) and define `mycluster.yaml` as
+```yaml
+whisk:
+ ingress:
+ type: NodePort
+ api_host_name: 192.168.65.3
+ api_host_port: 31001
+
+nginx:
+ httpsNodePort: 31001
+```
+
## Setting up NodePort on an IBM Cloud Lite cluster
The only available ingress method for an IBM Cloud Lite cluster is to