Daemon set merge (#107)

* Change the invoker to DaemonSet
* Update Dan's patch for upstream changes; spellcheck README.md
diff --git a/configure/cleanup.sh b/configure/cleanup.sh
index 7d4a604..9116e61 100755
--- a/configure/cleanup.sh
+++ b/configure/cleanup.sh
@@ -11,7 +11,7 @@
 kubectl -n openwhisk delete deployment zookeeper
 kubectl -n openwhisk delete deployment kafka
 kubectl -n openwhisk delete statefulsets controller
-kubectl -n openwhisk delete statefulsets invoker
+kubectl -n openwhisk delete daemonset invoker
 kubectl -n openwhisk delete deployment nginx
 
 # delete configmaps
diff --git a/kubernetes/invoker/README.md b/kubernetes/invoker/README.md
index 82bed6b..02c13db 100644
--- a/kubernetes/invoker/README.md
+++ b/kubernetes/invoker/README.md
@@ -4,10 +4,30 @@
 # Deploying
 
 When deploying the Invoker, it needs to be deployed via a
-[StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/).
-This is because each Invoker instance needs to know the instance
-it is for the Kafka topic. The current deployment is a single
-Invoker instance and can be deployed with:
+[DaemonSet](https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/).
+This is because there should only ever be at most 1 Invoker
+instance per Kube Node. To set these restrictions, it will be
+up to the Kubernetes deployment operator to properly apply
+the correct labels and taints to each required Kube node.
+
+With the defaults in the current `invoker.yml`, you can setup a
+node to run only Invoker pods with:
+
+```
+kubectl label nodes [node name] openwhisk=invoker
+$ kubectl label nodes 127.0.0.1 openwhisk=invoker
+```
+
+If you would then like to restrict nodes farther so that
+they only run Invoker pods, you can set some taints:
+
+```
+kubectl taint nodes [node name] dedicated=invoker:NoSchedule
+kubectl taint nodes [node name] dedicated=invoker:NoExecute
+```
+
+The taint nodes are optional, but once the invoker label is applied,
+you can create the invokers with:
 
 ```
 kubectl apply -f invoker.yml
@@ -55,7 +75,7 @@
 ```
 ## Kubernetes Host Linux Versions
 
-Unfortunitaly when Deploying OpenWhisk on Kubernetes it currently mounts some
+Unfortunately when Deploying OpenWhisk on Kubernetes it currently mounts some
 of the host OS files for the Invoker process and needs to make some assumptions.
 Because of this, some failures are known to happen on certain Linux versions,
 like CoreOs. If you see an error like:
diff --git a/kubernetes/invoker/invoker.yml b/kubernetes/invoker/invoker.yml
index 0d81298..8abddb2 100644
--- a/kubernetes/invoker/invoker.yml
+++ b/kubernetes/invoker/invoker.yml
@@ -1,20 +1,29 @@
 ---
-apiVersion: apps/v1beta1
-kind: StatefulSet
+apiVersion: extensions/v1beta1
+kind: DaemonSet
 metadata:
   name: invoker
   namespace: openwhisk
   labels:
     name: invoker
 spec:
-  replicas: 1
-  serviceName: "invoker"
   template:
     metadata:
       labels:
         name: invoker
     spec:
       restartPolicy: Always
+      nodeSelector:
+        openwhisk: "invoker"
+      tolerations:
+        - key: "dedicated"
+          value: "invoker"
+          effect: "NoSchedule"
+          operator: "Equal"
+        - key: "dedicated"
+          value: "invoker"
+          effect: "NoExecute"
+          operator: "Equal"
 
       volumes:
       - name: cgroup
@@ -37,7 +46,7 @@
       - name: invoker
         imagePullPolicy: Always
         image: openwhisk/invoker
-        command: [ "/bin/bash", "-c", "COMPONENT_NAME=$(hostname | cut -d'-' -f2) /init.sh `hostname | cut -d'-' -f2`" ]
+        command: [ "/bin/bash", "-c", "COMPONENT_NAME=$(hostname | cut -d'-' -f2) /init.sh" ]
         env:
           - name: "PORT"
             value: "8080"
@@ -129,6 +138,12 @@
             value: "test_whisks"
           - name: "DB_WHISK_AUTHS"
             value: "test_subjects"
+
+          # Name for the pod can be the hostname of the Kube node
+          - name: "INVOKER_NAME"
+            valueFrom:
+              fieldRef:
+                fieldPath: spec.nodeName
         ports:
         - name: invoker
           containerPort: 8080
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
index 147d0ab..becff4b 100755
--- a/tools/travis/build.sh
+++ b/tools/travis/build.sh
@@ -153,7 +153,7 @@
   kubectl apply -f invoker.yml
 
   # wait until the invoker is ready
-  statefulsetHealthCheck "invoker"
+  deploymentHealthCheck "invoker"
 popd
 
 # setup nginx
diff --git a/tools/travis/setup.sh b/tools/travis/setup.sh
index a4a2565..7594cb3 100755
--- a/tools/travis/setup.sh
+++ b/tools/travis/setup.sh
@@ -37,3 +37,5 @@
 
 echo "minikube is deployed and reachable"
 
+# set the invoker label
+kubectl label nodes --all openwhisk=invoker