From 5046c70eef5909ce2eb5527efed7795bc453a758 Mon Sep 17 00:00:00 2001 From: Sam O'Dell <31352624+samodell@users.noreply.github.com> Date: Fri, 20 Jul 2018 09:59:13 -0700 Subject: [PATCH 1/9] First edits to dotnet buildpack --- serving/samples/buildpack-app-dotnet/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/serving/samples/buildpack-app-dotnet/README.md b/serving/samples/buildpack-app-dotnet/README.md index 539b72fd6ec..e56c8e0e8bc 100644 --- a/serving/samples/buildpack-app-dotnet/README.md +++ b/serving/samples/buildpack-app-dotnet/README.md @@ -1,6 +1,6 @@ # Buildpack Sample App -A sample app that demonstrates usage of Cloud Foundry buildpacks on Knative Serving, +A sample app that demonstrates using Cloud Foundry buildpacks on Knative Serving, using the [packs Docker images](https://github.com/sclevine/packs). This deploys the [.NET Core Hello World](https://github.com/cloudfoundry-samples/dotnet-core-hello-world) @@ -8,7 +8,7 @@ sample app for Cloud Foundry. ## Prerequisites -[Install Knative Serving](https://github.com/knative/docs/blob/master/install/README.md) +* [Install Knative Serving](../../../install/README.md) ## Running @@ -22,7 +22,8 @@ First, install the Buildpack build template from that repo: kubectl apply -f buildpack.yaml ``` -Then you can deploy this to Knative Serving from the root directory via: +Then you can deploy this to Knative Serving from the root directory +by entering the following commands: ```shell # Replace the token string with a suitable registry @@ -50,7 +51,7 @@ items: ... ``` -Once the `BuildComplete` status becomes `True` the resources will start getting created. +Once the `BuildComplete` status is `True`, resource creation begins. To access this service via `curl`, we first need to determine its ingress address: From 6483e1b2ea30b51fea0241c5ac4e34f854e45cd4 Mon Sep 17 00:00:00 2001 From: Sam O'Dell <31352624+samodell@users.noreply.github.com> Date: Fri, 20 Jul 2018 10:16:13 -0700 Subject: [PATCH 2/9] Updates to buildpack nodejs sample --- .../samples/buildpack-function-nodejs/README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/serving/samples/buildpack-function-nodejs/README.md b/serving/samples/buildpack-function-nodejs/README.md index ee8c1b2533f..28371317896 100644 --- a/serving/samples/buildpack-function-nodejs/README.md +++ b/serving/samples/buildpack-function-nodejs/README.md @@ -1,6 +1,6 @@ # Buildpack Sample Function -A sample function that demonstrates usage of Cloud Foundry buildpacks on +A sample function that demonstrates using Cloud Foundry buildpacks on Knative Serving, using the [packs Docker images](https://github.com/sclevine/packs). This deploys the [riff square](https://github.com/scothis/riff-square-buildpack) @@ -8,13 +8,13 @@ sample function for riff. ## Prerequisites -[Install Knative Serving](https://github.com/knative/docs/blob/master/install/README.md) +* [Install Knative Serving](../../../install/README.md) ## Running This sample uses the [Buildpack build template](https://github.com/knative/build-templates/blob/master/buildpack/buildpack.yaml) -in the [build-templates](https://github.com/knative/build-templates/) repo. +from the [build-templates](https://github.com/knative/build-templates/) repo. First, install the Buildpack build template from that repo: @@ -49,17 +49,17 @@ items: ... ``` -Once the `BuildComplete` status becomes `True` the resources will start getting created. +Once the `BuildComplete` status is `True`, resource creation begins. - -To access this service via `curl`, we first need to determine its ingress address: +To access this service using `curl`, we first need to determine its ingress address: ```shell watch kubectl get svc knative-ingressgateway -n istio-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d ``` -Once the `EXTERNAL-IP` gets assigned to the cluster, you can run: +Once the `EXTERNAL-IP` gets assigned to the cluster, enter the follow commands to capture +the host URL and the IP of the ingress endpoint in environment variables: ```shell # Put the Host name into an environment variable. @@ -67,8 +67,11 @@ $ export SERVICE_HOST=`kubectl get route buildpack-function -o jsonpath="{.statu # Put the ingress IP into an environment variable. $ export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"` +``` +Now curl the service IP to make sure the deployment succeeded: +``` # Curl the ingress IP "as-if" DNS were properly configured. $ curl http://${SERVICE_IP}/ -H "Host: $SERVICE_HOST" -H "Content-Type: application/json" -d "33" [response] From 72269979adc2808fbd72d404d0ec0df8ef59484c Mon Sep 17 00:00:00 2001 From: Sam O'Dell <31352624+samodell@users.noreply.github.com> Date: Fri, 20 Jul 2018 10:16:29 -0700 Subject: [PATCH 3/9] More edits to dotnet sample --- serving/samples/buildpack-app-dotnet/README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/serving/samples/buildpack-app-dotnet/README.md b/serving/samples/buildpack-app-dotnet/README.md index e56c8e0e8bc..31e4493a5ee 100644 --- a/serving/samples/buildpack-app-dotnet/README.md +++ b/serving/samples/buildpack-app-dotnet/README.md @@ -53,15 +53,16 @@ items: Once the `BuildComplete` status is `True`, resource creation begins. +To access this service using `curl`, we first need to determine its ingress address: -To access this service via `curl`, we first need to determine its ingress address: ```shell $ watch kubectl get svc knative-ingressgateway -n istio-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE knative-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d ``` -Once the `ADDRESS` gets assigned to the cluster, you can run: +Once the `EXTERNAL-IP` gets assigned to the cluster, enter the follow commands to capture +the host URL and the IP of the ingress endpoint in environment variables: ```shell # Put the Host name into an environment variable. @@ -69,7 +70,11 @@ export SERVICE_HOST=`kubectl get route buildpack-sample-app -o jsonpath="{.statu # Put the ingress IP into an environment variable. export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jsonpath="{.status.loadBalancer.ingress[*].ip}"` +``` + +Now curl the service IP to make sure the deployment succeeded: +``` # Curl the ingress IP "as-if" DNS were properly configured. curl --header "Host: $SERVICE_HOST" http://${SERVICE_IP}/ [response] From ee8a7067b1cb3e69fae6b858c5b49fe187325c2e Mon Sep 17 00:00:00 2001 From: Sam O'Dell <31352624+samodell@users.noreply.github.com> Date: Fri, 20 Jul 2018 10:40:28 -0700 Subject: [PATCH 4/9] Update README.md --- serving/samples/buildpack-app-dotnet/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/serving/samples/buildpack-app-dotnet/README.md b/serving/samples/buildpack-app-dotnet/README.md index 31e4493a5ee..863315ee7cf 100644 --- a/serving/samples/buildpack-app-dotnet/README.md +++ b/serving/samples/buildpack-app-dotnet/README.md @@ -26,8 +26,9 @@ Then you can deploy this to Knative Serving from the root directory by entering the following commands: ```shell -# Replace the token string with a suitable registry -REPO="gcr.io/" +# Replace with your own registry +export REPO="gcr.io/" + perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" serving/samples/buildpack-app-dotnet/sample.yaml # Create the Kubernetes resources From 70da8a8127dfaea51187809f992638d0ce091aed Mon Sep 17 00:00:00 2001 From: Sam O'Dell <31352624+samodell@users.noreply.github.com> Date: Fri, 20 Jul 2018 10:41:43 -0700 Subject: [PATCH 5/9] Update README.md --- serving/samples/buildpack-function-nodejs/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/serving/samples/buildpack-function-nodejs/README.md b/serving/samples/buildpack-function-nodejs/README.md index 28371317896..0ffd6d0f7ec 100644 --- a/serving/samples/buildpack-function-nodejs/README.md +++ b/serving/samples/buildpack-function-nodejs/README.md @@ -25,8 +25,9 @@ kubectl apply -f buildpack.yaml Then you can deploy this to Knative Serving from the root directory via: ```shell -# Replace the token string with a suitable registry -REPO="gcr.io/" +# Replace with your own registry +export REPO="gcr.io/" + perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" serving/samples/buildpack-function-nodejs/sample.yaml kubectl apply -f serving/samples/buildpack-function-nodejs/sample.yaml From adfab2251f4fc1abf565b13c60789dac3f547dee Mon Sep 17 00:00:00 2001 From: Sam O'Dell <31352624+samodell@users.noreply.github.com> Date: Fri, 20 Jul 2018 10:42:24 -0700 Subject: [PATCH 6/9] Update README.md --- serving/samples/buildpack-function-nodejs/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serving/samples/buildpack-function-nodejs/README.md b/serving/samples/buildpack-function-nodejs/README.md index 0ffd6d0f7ec..b8ba8188761 100644 --- a/serving/samples/buildpack-function-nodejs/README.md +++ b/serving/samples/buildpack-function-nodejs/README.md @@ -72,8 +72,8 @@ $ export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o j Now curl the service IP to make sure the deployment succeeded: -``` -# Curl the ingress IP "as-if" DNS were properly configured. +```shell +# Curl the ingress IP as if DNS were properly configured $ curl http://${SERVICE_IP}/ -H "Host: $SERVICE_HOST" -H "Content-Type: application/json" -d "33" [response] ``` From bedba96bcf49ff3e2757d8c8b8a3edfb3bb70fa4 Mon Sep 17 00:00:00 2001 From: Sam O'Dell <31352624+samodell@users.noreply.github.com> Date: Fri, 20 Jul 2018 10:42:49 -0700 Subject: [PATCH 7/9] Update README.md --- serving/samples/buildpack-app-dotnet/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serving/samples/buildpack-app-dotnet/README.md b/serving/samples/buildpack-app-dotnet/README.md index 863315ee7cf..9b65de3460d 100644 --- a/serving/samples/buildpack-app-dotnet/README.md +++ b/serving/samples/buildpack-app-dotnet/README.md @@ -75,8 +75,8 @@ export SERVICE_IP=`kubectl get svc knative-ingressgateway -n istio-system -o jso Now curl the service IP to make sure the deployment succeeded: -``` -# Curl the ingress IP "as-if" DNS were properly configured. +```shell +# Curl the ingress IP as if DNS were properly configured curl --header "Host: $SERVICE_HOST" http://${SERVICE_IP}/ [response] ``` From 20ab3568c596f45b6f1717f65b53390e0705b3c7 Mon Sep 17 00:00:00 2001 From: Sam O'Dell <31352624+samodell@users.noreply.github.com> Date: Fri, 20 Jul 2018 13:44:28 -0700 Subject: [PATCH 8/9] Making Ryan's suggested changes - dotnet --- serving/samples/buildpack-app-dotnet/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/serving/samples/buildpack-app-dotnet/README.md b/serving/samples/buildpack-app-dotnet/README.md index 9b65de3460d..ff2a5e59779 100644 --- a/serving/samples/buildpack-app-dotnet/README.md +++ b/serving/samples/buildpack-app-dotnet/README.md @@ -1,7 +1,7 @@ # Buildpack Sample App -A sample app that demonstrates using Cloud Foundry buildpacks on Knative Serving, -using the [packs Docker images](https://github.com/sclevine/packs). +A sample app that demonstrates using [Cloud Foundry](https://www.cloudfoundry.org/) +buildpacks on Knative Serving, using the [packs Docker images](https://github.com/sclevine/packs). This deploys the [.NET Core Hello World](https://github.com/cloudfoundry-samples/dotnet-core-hello-world) sample app for Cloud Foundry. @@ -15,8 +15,7 @@ sample app for Cloud Foundry. This sample uses the [Buildpack build template](https://github.com/knative/build-templates/blob/master/buildpack/buildpack.yaml) in the [build-templates](https://github.com/knative/build-templates/) repo. - -First, install the Buildpack build template from that repo: +Save a copy of `buildpack.yaml`, then install it: ```shell kubectl apply -f buildpack.yaml @@ -29,10 +28,10 @@ by entering the following commands: # Replace with your own registry export REPO="gcr.io/" -perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" serving/samples/buildpack-app-dotnet/sample.yaml +perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" sample.yaml # Create the Kubernetes resources -kubectl apply -f serving/samples/buildpack-app-dotnet/sample.yaml +kubectl apply -f sample.yaml ``` Once deployed, you will see that it first builds: From d75d28a9912f5a561d0389d32fa0c5222cdc8f8d Mon Sep 17 00:00:00 2001 From: Sam O'Dell <31352624+samodell@users.noreply.github.com> Date: Fri, 20 Jul 2018 13:44:43 -0700 Subject: [PATCH 9/9] Making Ryan's suggested changes - nodejs --- serving/samples/buildpack-function-nodejs/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/serving/samples/buildpack-function-nodejs/README.md b/serving/samples/buildpack-function-nodejs/README.md index b8ba8188761..ec4014a36a7 100644 --- a/serving/samples/buildpack-function-nodejs/README.md +++ b/serving/samples/buildpack-function-nodejs/README.md @@ -1,7 +1,7 @@ # Buildpack Sample Function -A sample function that demonstrates using Cloud Foundry buildpacks on -Knative Serving, using the [packs Docker images](https://github.com/sclevine/packs). +A sample function that demonstrates using [Cloud Foundry](https://www.cloudfoundry.org/) +buildpacks on Knative Serving, using the [packs Docker images](https://github.com/sclevine/packs). This deploys the [riff square](https://github.com/scothis/riff-square-buildpack) sample function for riff. @@ -16,7 +16,7 @@ This sample uses the [Buildpack build template](https://github.com/knative/build-templates/blob/master/buildpack/buildpack.yaml) from the [build-templates](https://github.com/knative/build-templates/) repo. -First, install the Buildpack build template from that repo: +Save a copy of `buildpack.yaml`, then install it: ```shell kubectl apply -f buildpack.yaml @@ -28,9 +28,9 @@ Then you can deploy this to Knative Serving from the root directory via: # Replace with your own registry export REPO="gcr.io/" -perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" serving/samples/buildpack-function-nodejs/sample.yaml +perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" sample.yaml -kubectl apply -f serving/samples/buildpack-function-nodejs/sample.yaml +kubectl apply -f sample.yaml ``` Once deployed, you will see that it first builds: