Skip to content

Commit

Permalink
Test on multiple Kubernetes versions
Browse files Browse the repository at this point in the history
Expand matrix to test multiple Kubernetes versions and minikube versions.

Expand warning on bad minor versions of Kubernetes to avoid due to Kubernetes
regressions.

Default OW_CONTAINER_FACTORY to docker if not set to preserve simple
usage of build.sh to deploy default configuration to minikube.

Add troubleshooting note about minikube DNS problems and likely workaround.
  • Loading branch information
dgrove-oss committed Apr 4, 2018
1 parent 7db428c commit 21481df
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -2,13 +2,13 @@ sudo: required

env:
global:
- TRAVIS_KUBE_VERSION=v1.7.4
- TRAVIS_MINIKUBE_VERSION=v0.23.0
- secure: d7CuMXbhT83W2x78qiLwgogX1+3aPicd1PlTwwNNDN6QSkImbxareyKThnsqlHIiNj3o5l5DBuiYjy7wrF/xD1g8BQMmTwm99DRx5q3CI3Im3VCi/ZK8SaNjuOy24d7cf5k2tB/87Gk7zmKsMDYm+fpCl+GpgUmIEeIwthiAxuXSDWZ8eQPIptmxj56DeFRNouvXG+dEUtBfWiwN27UPxNKExCixFnegmdtffLbz6hhst7BHr5Ry9acbycre98PCwWZcu9lxFs+SJ1kvnzX2iue4otmDkF1WkJjxaOFPJVs/D3YItg+neLCSxjwBskPed+Fct8bOjcM/uVROJPNIq5icBmaPX2isH0lvtxOeVw/dmioWYXYPN9ygBOe4eO/vtPllN0bcAUo5xl9jXev8ciAozYrYpHVh9Fplfd81rcYTeYzALmRJBdoiWoc3KQGzwGc9sB1ffmy+KWgG9T0zbnS4fALSR4PSzyNlKSLXw9vuvdNP0OBYtO+6yTJXavIxqmDoj64Lb93n+uGPatnaIGPTKEEBMJTSjsgYVEfxzzZuxUT9Ldkf2lzqvN2PCllGoMqxkgsdb8i4v4QgRaMWBDbKa5Va4k0O4dnhRmtdbJavOSKN6fECJbyfoJlV1VvJGxk5znVLRznBmUPBKbNccyPZJULugKD3QIh4q8Q5jBU=
- secure: CJtnU94HTDqd4A6uvhFl8IpnmU+wTdlzb8bPBFUl/lI/VKXiRrYpgJdKUro5xEoxFKuqMprLhbyf66niyWLTIeogjUAEu/h/o2dBVeGgSGKoqC0hQgqvnxKFeGlzFJ0XuEs3vbStJGRnQszGsfnnDrscJtR0x9X+1w4aBKI7iPyyuFtVkDD1UsmBbSi+M8FTeq7G7A0reMDaey7uog3CFCpIMl4geshcohQEcKEGbnXQZoLPFpb7cBOE83VXBJ7Y7Dgf/U4keiLovvnuJThGKZm/SVV2KlELmBmtmbx3rMT6Vb5k9ChSdRWapromNnnzmJBIQ5Scc2mwV3A93/SMha1F3IlYpDKs5djfTw8jZfVnuiou7HhTaRjHkmmcwP12/k30gLe2kw0Vezg1TCY4zgtOpcmCxc8RHEy0ceA74rKvRi8LbexTCwX+iAMQFn/pSrh/OqAq/50JbLyczcoO1zXWS38txUQNLW8i+XllhCg9pjkjyfBeGjOOcWiVIz9rWJd2XufjSXDcj6xoZHtkh1XDt1CnVkpsYKtyyZucQnhUM9ebmaWqbSW2+bpqC/2hI+G+kOyyCesGdB1q+VmN1augMMs6RgWjk4yw5dyLAshATSoUlE8KH2cDcJL19r4ECaQ99PSLwxoB89yfPoJiNc42vwxRdsLmB1BMNyPa81Y=
matrix:
- OW_CONTAINER_FACTORY=docker
- OW_CONTAINER_FACTORY=kube
- OW_CONTAINER_FACTORY=docker TRAVIS_KUBE_VERSION=v1.7.4 TRAVIS_MINIKUBE_VERSION=v0.23.0
- OW_CONTAINER_FACTORY=docker TRAVIS_KUBE_VERSION=v1.8.0 TRAVIS_MINIKUBE_VERSION=v0.25.2
- OW_CONTAINER_FACTORY=docker TRAVIS_KUBE_VERSION=v1.9.0 TRAVIS_MINIKUBE_VERSION=v0.25.2
- OW_CONTAINER_FACTORY=kube TRAVIS_KUBE_VERSION=v1.8.0 TRAVIS_MINIKUBE_VERSION=v0.25.2

services:
- docker
Expand Down
23 changes: 15 additions & 8 deletions README.md
Expand Up @@ -17,20 +17,27 @@ This repository can be used to deploy OpenWhisk to a Kubernetes cluster.
Several requirements must be met for OpenWhisk to deploy on Kubernetes.

**Kubernetes**
* [Kubernetes](https://github.com/kubernetes/kubernetes) version 1.6+. However, avoid Kubernetes 1.6.3 due to an [issue with volume mount subpaths](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.6.md#known-issues-for-v163). Our Travis CI testing uses Kubernetes version 1.7.4.
* [Kubernetes](https://github.com/kubernetes/kubernetes) version 1.6+. However, multiple minor releases of Kubernetes, including 1.6.3, 1.7.14, 1.8.9 and 1.9.4 are broken due to regressions around [volume mount subpaths](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.6.md#known-issues-for-v163) and [also](https://github.com/kubernetes/kubernetes/issues/61076). Our Travis CI testing uses Kubernetes versions 1.7.4, 1.8.0, and 1.9.0.
* The ability to create Ingresses to make a Kubernetes service available outside of the cluster so you can actually use OpenWhisk.
* Endpoints of Kubernetes services must be able to loopback to themselves ("hairpin mode").

**OpenWhisk**
* Docker version 1.12+
* Endpoints of Kubernetes services must be able to loopback to themselves (the kubelet's `hairpin-mode` must not be `none`).

# Setting up Kubernetes

## Using Minikube

For local development and testing, we recommend using Minikube version 0.23+
with the docker network in promiscuous mode. Our Travis CI testing uses Minikube 0.23.0.
Take a look at these [instructions](/docs/setting_up_minikube/README.md).
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 picking one from
the table below that is included in our Travis CI testing.

| Kubernetes Version | Minikube Version |
--- | --- |
1.7.4 | 0.23.0 |
1.8.0 | 0.25.2 |
1.9.0 | 0.25.2 |

For details on setting up Minikube, see these [instructions](/docs/setting_up_minikube/README.md).

## Using a Kubernetes cluster from a cloud provider

Expand Down
4 changes: 4 additions & 0 deletions docs/setting_up_minikube/README.md
Expand Up @@ -45,3 +45,7 @@ minikube ssh -- sudo ip link set docker0 promisc on
```

Your Minikube cluster should now be ready to deploy OpenWhisk.

# Troubleshooting

For some combinations of Minikube and Kubernetes versions, you may need to workaround a [Minikube DNS issue](https://github.com/kubernetes/minikube/issues/2240#issuecomment-348319371). A common symptom of this issue is that the OpenWhisk couchdb pod will fail to start with the error that it is unable to resolve `github.com` when cloning the openwhisk git repo. A work around is to delete the minikube cluster, issue the command `minikube config set bootstrapper kubeadm` and then redo the `minikube start` command above.
16 changes: 10 additions & 6 deletions tools/travis/build.sh
Expand Up @@ -7,7 +7,7 @@
couchdbHealthCheck () {
# wait for the pod to be created before getting the job name
sleep 5
POD_NAME=$(kubectl -n openwhisk get pods -o wide --show-all | grep "couchdb" | awk '{print $1}')
POD_NAME=$(kubectl -n openwhisk get pods -l name=couchdb -o wide --show-all | grep "couchdb" | awk '{print $1}')

PASSED=false
TIMEOUT=0
Expand Down Expand Up @@ -40,7 +40,7 @@ deploymentHealthCheck () {
PASSED=false
TIMEOUT=0
until $PASSED || [ $TIMEOUT -eq 60 ]; do
KUBE_DEPLOY_STATUS=$(kubectl -n openwhisk get pods -o wide | grep "$1" | awk '{print $3}')
KUBE_DEPLOY_STATUS=$(kubectl -n openwhisk get pods -l name="$1" -o wide | grep "$1" | awk '{print $3}')
if [ "$KUBE_DEPLOY_STATUS" == "Running" ]; then
PASSED=true
break
Expand All @@ -55,7 +55,7 @@ deploymentHealthCheck () {
if [ "$PASSED" = false ]; then
echo "Failed to finish deploying $1"

kubectl -n openwhisk logs $(kubectl -n openwhisk get pods -o wide | grep "$1" | awk '{print $1}')
kubectl -n openwhisk logs $(kubectl -n openwhisk get pods -l name="$1" -o wide | grep "$1" | awk '{print $1}')
exit 1
fi

Expand All @@ -71,7 +71,7 @@ statefulsetHealthCheck () {
PASSED=false
TIMEOUT=0
until $PASSED || [ $TIMEOUT -eq 60 ]; do
KUBE_DEPLOY_STATUS=$(kubectl -n openwhisk get pods -o wide | grep "$1"-0 | awk '{print $3}')
KUBE_DEPLOY_STATUS=$(kubectl -n openwhisk get pods -l name="$1" -o wide | grep "$1"-0 | awk '{print $3}')
if [ "$KUBE_DEPLOY_STATUS" == "Running" ]; then
PASSED=true
break
Expand Down Expand Up @@ -135,6 +135,9 @@ set -x
SCRIPTDIR=$(cd $(dirname "$0") && pwd)
ROOTDIR="$SCRIPTDIR/../../"

# Default to docker container factory if not specified
OW_CONTAINER_FACTORY=${OW_CONTAINER_FACTORY:="docker"}

cd $ROOTDIR

# Label invoker nodes (needed for DockerContainerFactory-based invoker deployment)
Expand Down Expand Up @@ -215,18 +218,19 @@ pushd kubernetes/invoker
echo "Deploying invoker using DockerContainerFactory"
kubectl -n openwhisk create cm invoker.config --from-env-file=invoker-dcf.env
kubectl apply -f invoker-dcf.yml
deploymentHealthCheck "invoker"
elif [ "$OW_CONTAINER_FACTORY" = "kube" ]; then
echo "Deploying invoker using KubernetesContainerFactory"
kubectl -n openwhisk create cm invoker.config --from-env-file=invoker-k8scf.env
kubectl apply -f invoker-agent.yml
deploymentHealthCheck "invoker-agent"
kubectl apply -f invoker-k8scf.yml
deploymentHealthCheck "invoker-0"
else
echo "Unknown container factory $OW_CONTAINER_FACTORY"
exit 1
fi

# wait until invoker is ready
deploymentHealthCheck "invoker"
popd

# setup nginx
Expand Down

0 comments on commit 21481df

Please sign in to comment.