Git Product home page Git Product logo

incubator-openwhisk-deploy-kube's Introduction

OpenWhisk Deployment for Kubernetes

License Build Status

This repo can be used to deploy OpenWhisk to a Kubernetes cluster.

Table of Contents

Requirements

A number of requirements must be met for OpenWhisk to deploy on Kubernetes.

Kubernetes

  • Kubernetes version 1.5+
  • Kubernetes has KubeDNS deployed
  • (Optional) Kubernetes Pods can receive public addresses. This will be required if you wish to reach Nginx from outside of the Kubernetes cluster network.

OpenWhisk

  • Docker version 1.12+

NOTE: If you do not have an environment that meets these requirements then you can set one up following the Setting up Kubernetes section.

Setting up Kubernetes

If you are deploying Kubernetes from scratch to try out OpenWhisk, there are a number of ways to setup a Dev/Test environmnet depending on your host OS. To mitigate that, we are using VirtualBox with a Ubuntu VM. For the full instructions on setting an environment up, take a look at these instructions.

Configure OpenWhisk

To deploy OpenWhisk on Kubernetes, you first need to setup CouchDB. In this repo, there is a CouchDB instance that can be used to standup a small OpenWhisk test environment. We would not support using this deployment strategy for production environments, but to test OpenWhisk on Kube check out the CouchDB README.

For a production level CouchDB instance, take a look at the main OpenWhisk Docs for CouchDB.

Once CouchDB has been successfully deployed, you will need manually deploy the rest of the OpenWhisk components.

From here, you will now need to get the publicly available address of Nginx. If you are using the default Nginx image with a NodePort Service, then you can obtain the public IP using the following guide:

  1. Obtain the IP address of the Kubernetes nodes.
kubectl get nodes
  1. Obtain the public port for the Kubernetes Nginx Service
kubectl -n openwhisk describe service nginx

From here you should note the port used for the api endpoint. E.g:

export WSK_PORT=$(kubectl -n openwhisk describe service nginx | grep https-api | grep NodePort| awk '{print $3}' | cut -d'/' -f1)

Now you should be able to setup the wsk cli like normal and interact with Openwhisk.

wsk property set --auth 23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP --apihost https://[nginx_ip]:$WSK_PORT

Lastly, you will need to install the initial catalog. To do this, you will need to set the OPENWHISK_HOME environment variable:

export OPENWHISK_HOME [location of the openwhisk repo]

Then you should be able to run the following commands. Just make sure to replace the [nginx_ip] bellow.

  pushd /tmp
    git clone https://github.com/apache/incubator-openwhisk-catalog
    cd incubator-openwhisk-catalog/packages
    ./installCatalog.sh 789c46b1-71f6-4ed5-8c54-816aa4f8c502:abczO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP https://[nginx_ip]:$WSK_PORT
  popd

Cleanup

At some point there might be a need to cleanup the Kubernetes environment. For this, we want to delete all the OpenWhisk deployments, services, jobs and whatever else might be there. For this, you can run the following script:

./configure/cleanup.sh

Limitations

A couple of components for OpenWhisk on Kube deployment strategy requires custom built Docker images. One such component is Nginx and currently resides at danlavine/whisk_nginx. There is currently and open issue to make a public image and once it is resolved, then we can switch to the public image.

Bad Kube versions

  • Kube 1.6.3 has an issue with volume mount subpaths. See here for more information.

Enhancements

  • Use a public Edge Docker image once this issue is resolved

Issues

Report bugs, ask questions and request features here on GitHub.

You can also join our slack channel and chat with developers. To get access to our slack channel, request an invite here.

incubator-openwhisk-deploy-kube's People

Contributors

bbrowning avatar dgrove-oss avatar mlangbehn avatar mrutkows avatar tobias avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.