You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/09/28 23:16:09 UTC

[GitHub] csantanapr closed pull request #304: Document using the Kubernetes support available in Docker 18.06

csantanapr closed pull request #304: Document using the Kubernetes support available in Docker 18.06
URL: https://github.com/apache/incubator-openwhisk-deploy-kube/pull/304
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services