commit | 41ca10c5acceeffd3561677feea789e37f766ebe | [log] [tgz] |
---|---|---|
author | David Grove <dgrove-oss@users.noreply.github.com> | Tue Jul 31 21:31:01 2018 -0400 |
committer | Ying Chun Guo <guoyingc@cn.ibm.com> | Wed Aug 01 09:31:01 2018 +0800 |
tree | 45028a04046aacfac8cee57e2557adbacbade67a | |
parent | da768898f0a06e0cbcb19a144c60942fba17429a [diff] |
add check for healthy invoker to build-helm.sh (#262) Use the controller's /invokers/healthy/count route to verify that the controller has at least one healthy invoker before attempting to proceed to the smoketest of invoking an action.
This repository can be used to deploy OpenWhisk to a Kubernetes cluster.
Several requirements must be met for OpenWhisk to deploy on Kubernetes.
hairpin-mode
must not be none
).For local development and testing, we recommend using Minikube with the docker network in promiscuous mode. Not all combinations of Minikube and Kubernetes versions will work for running OpenWhisk. Although other combinations may work, we recommend at least initially using a combination from the table below that is verified by our Travis CI testing.
Kubernetes Version | Minikube Version |
---|---|
1.8.0 | 0.25.2 |
1.9.0 | 0.25.2 |
For details on setting up Minikube, see these instructions.
You can also provision a Kubernetes cluster from a cloud provider, subject to the cluster meeting the requirements above.
Helm is a tool to simplify the deployment and management of applications on Kubernetes clusters. Helm consists of the helm
command line tool that you install on your development machine and the tiller
runtime that you install on your Kubernetes cluster.
For detailed instructions on installing Helm, see these instructions.
In short if you already have the helm
cli installed on your development machine, you will need to execute these two commands and wait a few seconds for the tiller-deploy
pod to be in the Running
state.
helm init kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
You will use Helm to deploy OpenWhisk to your Kubernetes cluster. There are four deployment steps that are described in more detail below in the rest of this section.
mycluster.yaml
that specifies key facts about your Kubernetes cluster and the OpenWhisk configuration you wish to deploy.mycluster.yaml
to deploy OpenWhisk to your Kubernetes cluster.wsk
CLI. You need to tell the wsk
CLI how to connect to your OpenWhisk deployment.openwhisk
. Create one by issuing the command:kubectl create namespace openwhisk
openwhisk-role=invoker
. For a single node cluster, simply dokubectl label nodes --all openwhisk-role=invoker
If you have a multi-node cluster, for each node <INVOKER_NODE_NAME> you want to be an invoker, execute
$ kubectl label nodes <INVOKER_NODE_NAME> openwhisk-role=invoker
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 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.
whisk: ingress: type: NodePort api_host_name: 192.168.99.100 api_host_port: 31001 nginx: httpsNodePort: 31001
Beyond specifying the ingress, the mycluster.yaml
file is also used to customize your OpenWhisk deployment by enabling optional features and controlling the replication factor of the various micro-services that make up the OpenWhisk implementation. See the configuration choices documentation for a discussion of the primary options.
Deployment can be done by using the following single command:
helm install ./helm/openwhisk --namespace=openwhisk --name=owdev -f mycluster.yaml
For simplicity, in this README, we have used owdev
as the release name. You can use a different name, or not specify a name at all and let Helm auto-generate one for you.
You can use the command helm status owdev
to get a summary of the various Kubernetes artifacts that make up your OpenWhisk deployment. Once all the pods shown by the status command are in either the Running
or Completed
state, your OpenWhisk deployment is ready to be used.
Configure the OpenWhisk CLI, wsk, by setting the auth and apihost properties (if you don't already have the wsk cli, follow the instructions here to get it). Replace whisk.ingress.api_host_name
and whisk.ingress.api_host_port
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
Your OpenWhisk installation should now be usable. You can test it by following these instructions to define and invoke a sample OpenWhisk action in your favorite programming language.
Note: if you installed self-signed certificates, which is the default for the OpenWhisk Helm chart, you will need to use wsk -i
to suppress certificate checking. This works around cannot validate certificate
errors from the wsk
CLI.
If your deployment is not working, check our troubleshooting guide for ideas.
Now that you have a working OpenWhisk installation, you may optionally deploy additional packages and event providers. A standard set of event providers is available as a collection of Helm charts in the helm/providers
directory. You may install all the providers in a single command with
helm install ./helm/providers --namespace=openwhisk --name=owdev-providers
or you may selectively install the charts for individual providers with commands like
helm install ./helm/providers/charts/kafka --namespace=openwhisk --name=owdev-kafka-provider
Please see the values.yaml
file and/or README.md in the individual charts for instructions on enabling any optional customizations of the providers.
Use the following command to remove all the deployed OpenWhisk components:
helm delete owdev
Helm does keep a history of previous deployments. If you want to completely remove the deployment from helm, for example so you can reuse owdev to deploy OpenWhisk again, use the command:
helm delete owdev --purge
If your OpenWhisk deployment is not working, check our troubleshooting guide for ideas.
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.
Apache OpenWhisk Deployment on Kubernetes is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.