Skip to content

Instantly share code, notes, and snippets.

@tqvarnst
Forked from bbrowning/openshift_instructions.md
Created December 6, 2017 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tqvarnst/ec69bb2ea779c9a34e08d4a6f2ec46d1 to your computer and use it in GitHub Desktop.
Save tqvarnst/ec69bb2ea779c9a34e08d4a6f2ec46d1 to your computer and use it in GitHub Desktop.
Running Apache OpenWhisk on OpenShift

Running Apache OpenWhisk on OpenShift

Prerequisites

These instructions assume you are using Minishift 1.0.1 or newer as your OpenShift installation.

You'll also need a wsk binary in your $PATH to interact with OpenWhisk after it's deployed. Download the latest version for your OS from https://github.com/apache/incubator-openwhisk-cli/releases/

Instructions

First, start minishift and fix a networking bug in current releases:

minishift start
minishift ssh -- sudo ip link set docker0 promisc on
eval $(minishift oc-env)

Then, deploy OpenWhisk:

oc new-project openwhisk
oc create -f https://raw.githubusercontent.com/projectodd/incubator-openwhisk-deploy-kube/simplify-deployment-openshift/configure/openwhisk_openshift.yml
watch "oc get all"

Make sure all pods enter the Running state before moving on. If not, something is broken and start troubleshooting by looking in the logs of the failing pods.

The install-openwhisk-catalog-xxxxx and preload-openwhisk-runtimes-xxxxx pods should transition from Running to Completed as they finish installing the default OpenWhisk catalog of packages and pulling the default OpenWhisk runtime container images.

Then, wait until the controller recognizes the invoker as healthy:

oc logs -f $(oc get pods | grep controller | awk '{print $1}') | grep "invoker status changed"

You're looking for a message like invoker status changed to invoker0: Healthy. Once you see that message, OpenWhisk is running and you need to configure the client authentication to your controller:

export AUTH_SECRET=$(oc get configmap openwhisk-config -o yaml | grep 'AUTH_WHISK_SYSTEM=' | awk -F '=' '{print $2}')
export API_HOST=http://$(oc get route/controller --template={{.spec.host}})
wsk property set --auth $AUTH_SECRET --apihost $API_HOST

Finally, you're ready to test actions:

wsk list
wsk action invoke /whisk.system/utils/echo -p message hello -b

Now you can follow along with the OpenWhisk docs on creating actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment