You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2018/08/22 18:42:56 UTC

[incubator-openwhisk-deploy-kube] branch master updated: Use beta xenial dist to enable newer minikube versions in TravisCI (#282)

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-deploy-kube.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a8bc15  Use beta xenial dist to enable newer minikube versions in TravisCI (#282)
4a8bc15 is described below

commit 4a8bc15d512400906c1de88a378fe446532b07cb
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Wed Aug 22 14:42:54 2018 -0400

    Use beta xenial dist to enable newer minikube versions in TravisCI (#282)
---
 .travis.yml           |  4 +++-
 README.md             |  1 +
 docs/minikube.md      | 22 ++++++++++++----------
 tools/travis/setup.sh | 28 +++++++++++++++++++++-------
 4 files changed, 37 insertions(+), 18 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 488f2de..981aef1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,7 @@
 # Licensed to the Apache Software Foundation (ASF) under one or more contributor
 # license agreements; and to You under the Apache License, Version 2.0.
 sudo: required
+dist: xenial
 
 env:
   global:
@@ -9,7 +10,8 @@ env:
   matrix:
     - 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=docker
-    - TRAVIS_KUBE_VERSION=v1.9.0 TRAVIS_MINIKUBE_VERSION=v0.25.2 OW_CONTAINER_FACTORY=kubernetes
+    - TRAVIS_KUBE_VERSION=v1.10.5 TRAVIS_MINIKUBE_VERSION=v0.28.2 OW_CONTAINER_FACTORY=docker
+    - TRAVIS_KUBE_VERSION=v1.10.5 TRAVIS_MINIKUBE_VERSION=v0.28.2 OW_CONTAINER_FACTORY=kubernetes
 
 services:
   - docker
diff --git a/README.md b/README.md
index e32f30c..ee22178 100644
--- a/README.md
+++ b/README.md
@@ -57,6 +57,7 @@ Travis CI testing.
 --- | --- |
 1.8.0 | 0.25.2 |
 1.9.0 | 0.25.2 |
+1.10.5 | 0.28.2 |
 
 For details on setting up Minikube, see these [instructions](docs/minikube.md).
 
diff --git a/docs/minikube.md b/docs/minikube.md
index a7fe4f8..3462e4e 100644
--- a/docs/minikube.md
+++ b/docs/minikube.md
@@ -53,10 +53,10 @@ what we test in TravisCI. After you have experience with OpenWhisk on
 Minikube, feel free to experiment with additional versions.
 
 ```
-asdf install kubectl 1.9.0
-asdf global kubectl 1.9.0
-asdf install minikube 0.25.2
-asdf global minikube 0.25.2
+asdf install kubectl 1.10.5
+asdf global kubectl 1.10.5
+asdf install minikube 0.28.2
+asdf global minikube 0.28.2
 ```
 
 ## Configure the Minikube VM
@@ -65,7 +65,7 @@ You will want at least 4GB of memory and 2 CPUs for Minikube to run OpenWhisk.
 If you have a larger machine, you may want to provision more (especially more memory).
 
 ```
-minikube config set kubernetes-version v1.9.0
+minikube config set kubernetes-version v1.10.5
 minikube config set cpus 2
 minikube config set memory 4096
 minikube config set WantUpdateNotification false
@@ -73,9 +73,15 @@ minikube config set WantUpdateNotification false
 
 ## Start Minikube
 
+With minikube v0.25.2:
 ```
 minikube start --extra-config=apiserver.Authorization.Mode=RBAC
 ```
+with minikube versions more recent than v0.25.2:
+```
+minikube start
+```
+
 
 ## Setup Docker network in promiscuous mode
 Put the docker network in promiscuous mode.
@@ -94,10 +100,6 @@ redo the setup of the Docker network.
 ```
 minikube delete
 minikube config set kubernetes-version <NEW_VERSION>
-minikube start --extra-config=apiserver.Authorization.Mode=RBAC
+minikube start [--extra-config=apiserver.Authorization.Mode=RBAC]
 minikube ssh -- sudo ip link set docker0 promisc on
 ```
-
-# 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 ` [...]
diff --git a/tools/travis/setup.sh b/tools/travis/setup.sh
index 7ecc8a6..5a2e2b7 100755
--- a/tools/travis/setup.sh
+++ b/tools/travis/setup.sh
@@ -30,9 +30,13 @@ EOF
 
 # Download and install misc packages and utilities
 pushd /tmp
-  # helm on minikube's vm-driver=none requires nsenter
+  # helm on minikube's vm-driver=none requires nsenter, which is not present by default on ubuntu 14.04
   check_or_build_nsenter
 
+  # Need socat for helm to forward connections to tiller on ubuntu 16.04
+  sudo apt update
+  sudo apt install -y socat
+
   # download and install the wsk cli
   wget -q https://github.com/apache/incubator-openwhisk-cli/releases/download/latest/OpenWhisk_CLI-latest-linux-amd64.tgz
   tar xzf OpenWhisk_CLI-latest-linux-amd64.tgz
@@ -45,7 +49,6 @@ pushd /tmp
 
   # Download and install helm
   curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh && chmod +x get_helm.sh && ./get_helm.sh
-
 popd
 
 # set docker0 to promiscuous mode
@@ -59,7 +62,14 @@ mkdir $HOME/.kube || true
 touch $HOME/.kube/config
 
 export KUBECONFIG=$HOME/.kube/config
-sudo -E /usr/local/bin/minikube start --vm-driver=none --extra-config=apiserver.Authorization.Mode=RBAC --kubernetes-version=$TRAVIS_KUBE_VERSION
+
+if [ "$TRAVIS_MINIKUBE_VERSION" == "v0.25.2" ]; then
+  # bootstrap with localkube -- restricts choice of kube version
+  sudo -E /usr/local/bin/minikube start --vm-driver=none --bootstrapper=localkube --extra-config=apiserver.Authorization.Mode=RBAC --kubernetes-version=$TRAVIS_KUBE_VERSION
+else
+  # bootstrap with kubeadm (preferred).
+  sudo -E /usr/local/bin/minikube start --vm-driver=none --bootstrapper=kubeadm --extra-config=apiserver.authorization-mode=RBAC --kubernetes-version=$TRAVIS_KUBE_VERSION
+fi
 
 # Wait until we have a ready node in minikube
 TIMEOUT=0
@@ -84,12 +94,15 @@ minikube update-context
 echo "minikube is deployed and reachable"
 /usr/local/bin/kubectl describe nodes
 
+# Pods running in kube-system namespace should have cluster-admin role
+kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
+
 # Install tiller into the minikube cluster
 /usr/local/bin/helm init --service-account default
 
 # Wait for tiller to be ready
 TIMEOUT=0
-TIMEOUT_COUNT=20
+TIMEOUT_COUNT=60
 until [ $TIMEOUT -eq $TIMEOUT_COUNT ]; do
   TILLER_STATUS=$(/usr/local/bin/kubectl -n kube-system get pods -o wide | grep tiller-deploy | awk '{print $3}')
   TILLER_READY_COUNT=$(/usr/local/bin/kubectl -n kube-system get pods -o wide | grep tiller-deploy | awk '{print $2}')
@@ -104,8 +117,9 @@ done
 
 if [ $TIMEOUT -eq $TIMEOUT_COUNT ]; then
   echo "Failed to install tiller"
+
+  # Dump lowlevel logs to help diagnose failure to start tiller
+  minikube logs
+  kubectl -n kube-system describe pods
   exit 1
 fi
-
-# Create privileged RBAC for tiller
-/usr/local/bin/kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default