From ab92f84096aec3fd1f4cb2081eacaa3787f84061 Mon Sep 17 00:00:00 2001 From: Zhiming Peng Date: Wed, 31 Oct 2018 15:35:03 -0700 Subject: [PATCH 1/4] Update Knative version Readme --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e93b6c169..17834b52c 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,10 @@ The diagram below illustrates the different components which make up the Dispatc 2. Create GKE cluster: ```bash - K8S_VERSION=1.10.7-gke.6 + export K8S_VERSION=1.10.7-gke.6 export CLUSTER_NAME=dispatch-knative - gcloud container clusters create -m n1-standard-4 --cluster-version ${K8S_VERSION} ${CLUSTER_NAME} - gcloud container clusters get-credentials ${CLUSTER_NAME} + gcloud container clusters create -m n1-standard-4 --cluster-version ${K8S_VERSION} ${CLUSTER_NAME} --zone us-west1-c + gcloud container clusters get-credentials ${CLUSTER_NAME} --zone us-west1-c ``` 3. Install Knative: @@ -69,13 +69,15 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp export RELEASE_NAME="dispatch-server" export MINIO_USERNAME="dispatch" export MINIO_PASSWORD="dispatch" - export INGRESS_IP=$(kubectl get service -n istio-system knative-ingressgateway -o json | jq -r .status.loadBalancer.ingress[].ip) + export DOCKER_REPOSITORY="{dockerhub_username}" + export INGRESS_IP=$(kubectl get service -n istio-system knative-ingressgateway -o json | jq -r ".status.loadBalancer.ingress[0].ip") ``` 2. Build and publish a dispatch image: ```bash PUSH_IMAGES=1 make images ``` + > **NOTE**: You may need `docker login` before push 3. The previous command will output a configuration file `values.yaml`: ```yaml @@ -90,6 +92,10 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp 4. Deploy via helm chart (if helm is not installed and initialized, do that first): ```bash + cd charts/dispatch + helm dependency update + helm init + cd ../.. helm upgrade -i --debug ${RELEASE_NAME} ./charts/dispatch --namespace ${DISPATCH_NAMESPACE} -f values.yaml ``` > **NOTE**: Use following to create cluster role binding for tiller: @@ -131,7 +137,7 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp 8. Test out your install: First, create an baseimage: ```bash - dispatch create baseimage python3-base dispatchframework/python3-base:0.0.13-knative + dispatch create base-image python3-base dispatchframework/python3-base:0.0.13-knative Created baseimage: python3-base ``` Then, create an image: @@ -184,4 +190,8 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp curl -v http://${INGRESS_IP}/hello?name=Jon -H 'Host: default.dispatch-server.dispatch.local' ``` +9. Delete dispatch server + ```bash + helm delete dispatch-server + ``` For a more complete quickstart see the [developer documentation](#documentation) From f10e4c6b3f5fe0c49917d63ae652b5b49e470e62 Mon Sep 17 00:00:00 2001 From: Zhiming Peng Date: Wed, 31 Oct 2018 15:41:50 -0700 Subject: [PATCH 2/4] Fix jq format, Add note to dockerhub username --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 17834b52c..9f4bf3481 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp export DOCKER_REPOSITORY="{dockerhub_username}" export INGRESS_IP=$(kubectl get service -n istio-system knative-ingressgateway -o json | jq -r ".status.loadBalancer.ingress[0].ip") ``` - + > Note: You may need to modify `DISPATCH_SERVER_DOCKER_REPOSITORY` in `scripts/images.sh` to your dockerhub username 2. Build and publish a dispatch image: ```bash PUSH_IMAGES=1 make images @@ -122,7 +122,7 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp "current": "${RELEASE_NAME}", "contexts": { "${RELEASE_NAME}": { - "host": "$(kubectl -n ${DISPATCH_NAMESPACE} get service ${RELEASE_NAME}-nginx-ingress-controller -o json | jq -r .status.loadBalancer.ingress[].ip)", + "host": "$(kubectl -n ${DISPATCH_NAMESPACE} get service ${RELEASE_NAME}-nginx-ingress-controller -o json | jq -r ".status.loadBalancer.ingress[].ip")", "port": 443, "scheme": "https", "insecure": true From 7cb41d29870d196ce1b54e721ca3c250d5e2cabe Mon Sep 17 00:00:00 2001 From: Zhiming Peng Date: Wed, 31 Oct 2018 16:05:46 -0700 Subject: [PATCH 3/4] Add optional step for tiller --- README.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 9f4bf3481..4120498e5 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp ```bash PUSH_IMAGES=1 make images ``` - > **NOTE**: You may need `docker login` before push + > **NOTE**: You may need to `docker login` before push 3. The previous command will output a configuration file `values.yaml`: ```yaml @@ -90,32 +90,31 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp password: ******** ``` -4. Deploy via helm chart (if helm is not installed and initialized, do that first): +4. Helm Init and grant cluster admin privileges to tiller ```bash - cd charts/dispatch - helm dependency update helm init - cd ../.. + kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default + ``` + +5. Deploy via helm chart (if helm is not installed and initialized, do that first): + ```bash + helm dep up ./charts/dispatch/ helm upgrade -i --debug ${RELEASE_NAME} ./charts/dispatch --namespace ${DISPATCH_NAMESPACE} -f values.yaml ``` - > **NOTE**: Use following to create cluster role binding for tiller: - >```bash - >kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default - >``` -5. Reconfigure Knative serving (need to whitelist our internal repository): +6. Reconfigure Knative serving (need to whitelist our internal repository): ```bash ./scripts/configure-knative.sh ``` -6. Build the CLI (substitute darwin for linux if needed): +7. Build the CLI (substitute darwin for linux if needed): ```bash make cli-darwin # Create symlink to binary ln -s `pwd`/bin/dispatch-darwin /usr/local/bin/dispatch ``` -7. Create the Dispatch config: +8. Create the Dispatch config: ```bash cat << EOF > config.json { @@ -134,7 +133,7 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp export DISPATCH_CONFIG=`pwd`/config.json ``` -8. Test out your install: +9. Test out your install: First, create an baseimage: ```bash dispatch create base-image python3-base dispatchframework/python3-base:0.0.13-knative @@ -190,7 +189,7 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp curl -v http://${INGRESS_IP}/hello?name=Jon -H 'Host: default.dispatch-server.dispatch.local' ``` -9. Delete dispatch server +10. Delete dispatch server ```bash helm delete dispatch-server ``` From e63e448c63dbe2e53ba91ce68229106c5625497f Mon Sep 17 00:00:00 2001 From: Zhiming Peng Date: Thu, 1 Nov 2018 10:52:21 -0700 Subject: [PATCH 4/4] Add cluster zone env var --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4120498e5..8a3465abb 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,9 @@ The diagram below illustrates the different components which make up the Dispatc ```bash export K8S_VERSION=1.10.7-gke.6 export CLUSTER_NAME=dispatch-knative - gcloud container clusters create -m n1-standard-4 --cluster-version ${K8S_VERSION} ${CLUSTER_NAME} --zone us-west1-c - gcloud container clusters get-credentials ${CLUSTER_NAME} --zone us-west1-c + export CLUSTER_ZONE=us-west1-c + gcloud container clusters create -m n1-standard-4 --cluster-version ${K8S_VERSION} ${CLUSTER_NAME} --zone ${CLUSTER_ZONE} + gcloud container clusters get-credentials ${CLUSTER_NAME} --zone ${CLUSTER_ZONE} ``` 3. Install Knative: @@ -121,7 +122,7 @@ Installing Dispatch depends on having a Kubernetes cluster with the Knative comp "current": "${RELEASE_NAME}", "contexts": { "${RELEASE_NAME}": { - "host": "$(kubectl -n ${DISPATCH_NAMESPACE} get service ${RELEASE_NAME}-nginx-ingress-controller -o json | jq -r ".status.loadBalancer.ingress[].ip")", + "host": "$(kubectl -n ${DISPATCH_NAMESPACE} get service ${RELEASE_NAME}-nginx-ingress-controller -o json | jq -r '.status.loadBalancer.ingress[].ip')", "port": 443, "scheme": "https", "insecure": true