diff --git a/community/samples/serving/helloworld-clojure/README.md b/community/samples/serving/helloworld-clojure/README.md index 61c1c79da..98a2220e7 100644 --- a/community/samples/serving/helloworld-clojure/README.md +++ b/community/samples/serving/helloworld-clojure/README.md @@ -157,9 +157,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, use ``` - kubectl get ksvc helloworld-clojure --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-clojure helloworld-clojure.default.example.com + kubectl get ksvc helloworld-clojure --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-clojure http://helloworld-clojure.default.example.com ``` 1. Now you can make a request to your app to see the results. Replace diff --git a/community/samples/serving/helloworld-dart/README.md b/community/samples/serving/helloworld-dart/README.md index f216580e1..1781f2f6b 100644 --- a/community/samples/serving/helloworld-dart/README.md +++ b/community/samples/serving/helloworld-dart/README.md @@ -156,9 +156,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, use ``` - kubectl get ksvc helloworld-dart --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-dart helloworld-dart.default.example.com + kubectl get ksvc helloworld-dart --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-dart http://helloworld-dart.default.example.com ``` 1. Now you can make a request to your app to see the result. Replace diff --git a/community/samples/serving/helloworld-elixir/README.md b/community/samples/serving/helloworld-elixir/README.md index 4a45d20c0..3e8f955c8 100644 --- a/community/samples/serving/helloworld-elixir/README.md +++ b/community/samples/serving/helloworld-elixir/README.md @@ -179,10 +179,10 @@ above. 1. To find the URL for your service, use ``` - kubectl get ksvc helloworld-elixir --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + kubectl get ksvc helloworld-elixir --output=custom-columns=NAME:.metadata.name,URL:.status.url - NAME DOMAIN - helloworld-elixir helloworld-elixir.default.example.com + NAME URL + helloworld-elixir http://helloworld-elixir.default.example.com ``` 1. Now you can make a request to your app to see the results. Replace diff --git a/community/samples/serving/helloworld-haskell/README.md b/community/samples/serving/helloworld-haskell/README.md index bd8720b88..eb63e71cc 100644 --- a/community/samples/serving/helloworld-haskell/README.md +++ b/community/samples/serving/helloworld-haskell/README.md @@ -190,9 +190,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, enter: ``` - kubectl get ksvc helloworld-haskell --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-haskell helloworld-haskell.default.example.com + kubectl get ksvc helloworld-haskell --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-haskell http://helloworld-haskell.default.example.com ``` 1. Now you can make a request to your app and see the result. Replace diff --git a/community/samples/serving/helloworld-java-micronaut/README.md b/community/samples/serving/helloworld-java-micronaut/README.md index 4bec4b255..21ed1c8ed 100644 --- a/community/samples/serving/helloworld-java-micronaut/README.md +++ b/community/samples/serving/helloworld-java-micronaut/README.md @@ -276,14 +276,14 @@ To verify that your sample app has been successfully deployed: command: ```shell - kubectl get services.serving.knative.dev helloworld-java-micronaut --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + kubectl get services.serving.knative.dev helloworld-java-micronaut --output=custom-columns=NAME:.metadata.name,URL:.status.url ``` Example result: ```shell - NAME DOMAIN - helloworld-java-micronaut helloworld-java-micronaut.default.example.com + NAME URL + helloworld-java-micronaut http://helloworld-java-micronaut.default.example.com ``` 1. Run the following `curl` command to test your deployed sample app. You must diff --git a/community/samples/serving/helloworld-java-quarkus/README.md b/community/samples/serving/helloworld-java-quarkus/README.md index 2d4fc62d7..522a90ebf 100644 --- a/community/samples/serving/helloworld-java-quarkus/README.md +++ b/community/samples/serving/helloworld-java-quarkus/README.md @@ -277,19 +277,15 @@ folder) you're ready to build and deploy the sample app. ```shell kubectl get ksvc helloworld-java-quarkus - NAME DOMAIN - helloworld-java-quarkus helloworld-java-quarkus.default.example.com - - # Or simply: - export DOMAIN_NAME=$(kubectl get ksvc helloworld-java-quarkus \ - --output jsonpath={.status.domain} + NAME URL + helloworld-java-quarkus http://helloworld-java-quarkus.default.example.com ``` 1. Now you can make a request to your app to see the result. Presuming, the IP address you got in the step above is in the `${IP_ADDRESS}` env variable: ```shell - curl -H "Host: ${DOMAIN_NAME}" http://${IP_ADDRESS} + curl -H "Host: helloworld-java-quarkus.default.example.com" http://${IP_ADDRESS} Namaste Knative World! ``` diff --git a/community/samples/serving/helloworld-rust/README.md b/community/samples/serving/helloworld-rust/README.md index 5b940e6ef..500bf0644 100644 --- a/community/samples/serving/helloworld-rust/README.md +++ b/community/samples/serving/helloworld-rust/README.md @@ -181,9 +181,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, enter: ``` - kubectl get ksvc helloworld-rust --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-rust helloworld-rust.default.example.com + kubectl get ksvc helloworld-rust --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-rust http://helloworld-rust.default.example.com ``` 1. Now you can make a request to your app and see the result. Replace diff --git a/community/samples/serving/helloworld-swift/README.md b/community/samples/serving/helloworld-swift/README.md index 1a618df85..747aaa0aa 100644 --- a/community/samples/serving/helloworld-swift/README.md +++ b/community/samples/serving/helloworld-swift/README.md @@ -155,9 +155,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, use the following command: ``` - kubectl get ksvc helloworld-swift --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-swift helloworld-swift.default.example.com + kubectl get ksvc helloworld-swift --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-swift http://helloworld-swift.default.example.com ``` 1. Now you can make a request to your app to see the result. Replace diff --git a/community/samples/serving/helloworld-vertx/README.md b/community/samples/serving/helloworld-vertx/README.md index 95d69f912..78c78aa39 100644 --- a/community/samples/serving/helloworld-vertx/README.md +++ b/community/samples/serving/helloworld-vertx/README.md @@ -243,14 +243,14 @@ To verify that your sample app has been successfully deployed: command: ```shell - kubectl get services.serving.knative.dev helloworld-vertx --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + kubectl get services.serving.knative.dev helloworld-vertx --output=custom-columns=NAME:.metadata.name,URL:.status.url ``` Example result: ```shell - NAME DOMAIN - helloworld-vertx helloworld-vertx.default.example.com + NAME URL + helloworld-vertx http://helloworld-vertx.default.example.com ``` 1. Run the following `curl` command to test your deployed sample app. You must diff --git a/docs/install/Knative-with-Gloo.md b/docs/install/Knative-with-Gloo.md index 67dddceed..639dd1f26 100644 --- a/docs/install/Knative-with-Gloo.md +++ b/docs/install/Knative-with-Gloo.md @@ -232,14 +232,14 @@ http://192.168.99.230:31864 Run the following command to find the domain URL for your service: ```bash -kubectl get ksvc helloworld-go -n default --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain +kubectl get ksvc helloworld-go -n default --output=custom-columns=NAME:.metadata.name,URL:.status.url ``` Example: ```bash -NAME DOMAIN -helloworld-go helloworld-go.default.example.com +NAME URL +helloworld-go http://helloworld-go.default.example.com ``` Test your app by sending it a request. Use the following `curl` command with the diff --git a/docs/install/getting-started-knative-app.md b/docs/install/getting-started-knative-app.md index a5d01f3ae..250387bc6 100644 --- a/docs/install/getting-started-knative-app.md +++ b/docs/install/getting-started-knative-app.md @@ -130,21 +130,15 @@ assigned an external IP address. 1. To find the host URL for your service, enter: ```shell - kubectl get route helloworld-go --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-go helloworld-go.default.example.com + kubectl get route helloworld-go --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-go http://helloworld-go.default.example.com ``` > Note: By default, Knative uses the `example.com` domain. To configure a > custom DNS domain, see > [Using a Custom Domain](../serving/using-a-custom-domain.md). - You can also export the host URL as a variable using the following command: - - ```shell - export HOST_URL=$(kubectl get route helloworld-go --output jsonpath='{.status.domain}') - ``` - If you changed the name from `helloworld-go` to something else when creating the `.yaml` file, replace `helloworld-go` in the above commands with the name you entered. @@ -159,14 +153,6 @@ assigned an external IP address. Hello World: Go Sample v1! ``` - If you exported the host URL and IP address as variables in the previous - steps, you can use those variables to simplify your cURL request: - - ```shell - curl -H "Host: ${HOST_URL}" http://${IP_ADDRESS} - Hello World: Go Sample v1! - ``` - If you deployed your own app, you might want to customize this cURL request to interact with your application. diff --git a/docs/serving/deploying-with-private-registry.md b/docs/serving/deploying-with-private-registry.md index 37cf1657d..e842ae614 100644 --- a/docs/serving/deploying-with-private-registry.md +++ b/docs/serving/deploying-with-private-registry.md @@ -216,14 +216,14 @@ to the IBM Container Registry, we will use the Kaniko build template. 1. Run the following command to find the domain URL for your service: ```shell - kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,URL:.status.url ``` Example: ```shell - NAME DOMAIN - helloworld-go helloworld-go.default.example.com + NAME URL + helloworld-go http://helloworld-go.default.example.com ``` 1. Test your app by sending it a request. Use the following `curl` command with diff --git a/docs/serving/samples/build-private-repo-go/README.md b/docs/serving/samples/build-private-repo-go/README.md deleted file mode 100644 index 439385f93..000000000 --- a/docs/serving/samples/build-private-repo-go/README.md +++ /dev/null @@ -1,255 +0,0 @@ -This sample demonstrates: - -- Pulling source code from a private Github repository using a deploy-key -- Pushing a Docker container to a private DockerHub repository using a username - / password -- Deploying to Knative Serving using image pull secrets - -## Before you begin - -- [Install Knative Serving](../../../install/README.md) -- Download a copy of the code: - - ```shell - git clone -b "release-0.6" https://github.com/knative/docs knative-docs - cd knative-docs/serving/samples/build-private-repo-go - ``` - -## Setup - -### 1. Setting up the default service account - -Knative Serving will run pods as the default service account in the namespace -where you created your resources. You can see its body by entering the following -command: - -```shell -$ kubectl get serviceaccount default --output yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: default - namespace: default - ... -secrets: -- name: default-token-zd84v -``` - -We are going to add to this an image pull Secret. - -1. Create your image pull Secret with the following command, replacing values as - necessary: - - ```shell - kubectl create secret docker-registry dockerhub-pull-secret \ - --docker-server=https://index.docker.io/v1/ --docker-email=not@val.id \ - --docker-username= --docker-password= - ``` - - To learn more about Kubernetes pull Secrets, see - [Creating a Secret in the cluster that holds your authorization token](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-in-the-cluster-that-holds-your-authorization-token). - -2. Add the newly created `imagePullSecret` to your default service account by - entering: - - ```shell - kubectl edit serviceaccount default - ``` - - This will open the resource in your default text editor. Under `secrets:`, - add: - - ```yaml - secrets: - - name: default-token-zd84v - # This is the secret we just created: - imagePullSecrets: - - name: dockerhub-pull-secret - ``` - -### 2. Configuring the build - -The objects in this section are all defined in `build-bot.yaml`, and the fields -that need to be changed say `REPLACE_ME`. Open the `build-bot.yaml` file and -make the necessary replacements. - -The following sections explain the different configurations in the -`build-bot.yaml` file, as well as the necessary changes for each section. - -#### Setting up our Build service account - -To separate our Build's credentials from our applications credentials, the Build -runs as its own service account: - -```yaml -apiVersion: v1 -kind: ServiceAccount -metadata: - name: build-bot -secrets: - - name: deploy-key - - name: dockerhub-push-secrets -``` - -#### Creating a deploy key - -You can set up a deploy key for a private Github repository following -[these](https://developer.github.com/v3/guides/managing-deploy-keys/) -instructions. The deploy key in the `build-bot.yaml` file in this folder is -_real_; you do not need to change it for the sample to work. - -```yaml -apiVersion: v1 -kind: Secret -metadata: - name: deploy-key - annotations: - # This tells us that this credential is for use with - # github.com repositories. - build.knative.dev/git-0: github.com -type: kubernetes.io/ssh-auth -data: - # Generated by: - # cat id_rsa | base64 -w 0 - ssh-privatekey: - - # Generated by: - # ssh-keyscan github.com | base64 -w 0 - known_hosts: -``` - -#### Creating a DockerHub push credential - -Create a new Secret for your DockerHub credentials. Replace the necessary -values: - -```yaml -apiVersion: v1 -kind: Secret -metadata: - name: dockerhub-push-secrets - annotations: - build.knative.dev/docker-0: https://index.docker.io/v1/ -type: kubernetes.io/basic-auth -stringData: - username: - password: -``` - -#### Creating the build bot - -When finished with the replacements, create the build bot by entering the -following command: - -```shell -kubectl create --filename build-bot.yaml -``` - -### 3. Installing a Build template and updating `manifest.yaml` - -1. Install the - [Kaniko build template](https://github.com/knative/build-templates/blob/master/kaniko/kaniko.yaml) - by entering the following command: - - ```shell - kubectl apply --filename https://raw.githubusercontent.com/knative/build-templates/master/kaniko/kaniko.yaml - ``` - -1. Open `manifest.yaml` and substitute your private DockerHub repository name - for `REPLACE_ME`. - -## Deploying your application - -At this point, you're ready to deploy your application: - -```shell -kubectl create --filename manifest.yaml -``` - -To make sure everything works, capture the host URL and the IP of the ingress -endpoint in environment variables: - -```shell -# Put the Host URL into an environment variable. -export SERVICE_HOST=$(kubectl get route private-repos \ - --output jsonpath="{.status.domain}") -``` - -```shell -# In Knative 0.2.x and prior versions, the `knative-ingressgateway` service was used instead of `istio-ingressgateway`. -INGRESSGATEWAY=knative-ingressgateway -INGRESSGATEWAY_LABEL=knative - -# The use of `knative-ingressgateway` is deprecated in Knative v0.3.x. -# Use `istio-ingressgateway` instead, since `knative-ingressgateway` -# will be removed in Knative v0.4. -if kubectl get configmap config-istio -n knative-serving &> /dev/null; then - INGRESSGATEWAY=istio-ingressgateway - INGRESSGATEWAY_LABEL=istio -fi - -# Put the IP address into an environment variable -export SERVICE_IP=$(kubectl get svc $INGRESSGATEWAY --namespace istio-system \ - --output jsonpath="{.status.loadBalancer.ingress[*].ip}") -``` - -> Note: If your cluster is running outside a cloud provider (for example, on -> Minikube), your services will never get an external IP address. In that case, -> use the Istio `hostIP` and `nodePort` as the service IP: - -```shell -export SERVICE_IP=$(kubectl get po --selector $INGRESSGATEWAY_LABEL=ingressgateway --namespace istio-system \ - --output 'jsonpath= . {.items[0].status.hostIP}'):$(kubectl get svc $INGRESSGATEWAY \ - --namespace istio-system --output 'jsonpath={.spec.ports[? (@.port==80)].nodePort}') -``` - -Now curl the service IP to make sure the deployment succeeded: - -```shell -curl -H "Host: $SERVICE_HOST" http://$SERVICE_IP -``` - -## Appendix: Sample Code - -The sample code is in a private Github repository consisting of two files. - -1. `Dockerfile` - - ```Dockerfile - # Use golang:alpine to optimize the image size. - # See https://hub.docker.com/_/golang/ for more information - # about the difference between golang and golang:alpine. - FROM golang:alpine - - ENV GOPATH /go - - ADD . /go/src/github.com/dewitt/knative-build - - RUN CGO_ENABLED=0 go build github.com/dewitt/knative-build - - ENTRYPOINT ["knative-build"] - ``` - -1. `main.go` - - ```go - package main - - import ( - " - " - ) - - const ( - port = ":8080" - ) - - func helloWorld(w http.ResponseWriter, r *http.Request) { - ) - } - - func main() { - ) - ) - } - ``` diff --git a/docs/serving/samples/build-private-repo-go/_index.md b/docs/serving/samples/build-private-repo-go/_index.md deleted file mode 100644 index 28c7c34a5..000000000 --- a/docs/serving/samples/build-private-repo-go/_index.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "Deploying to Knative from a Private GitHub Repo - Go" -linkTitle: "Private GitHub repo - Go" -weight: 1 -type: "docs" ---- - -{{% readfile file="README.md" relative="true" markdown="true" %}} diff --git a/docs/serving/samples/build-private-repo-go/build-bot.yaml b/docs/serving/samples/build-private-repo-go/build-bot.yaml deleted file mode 100644 index 3b36119eb..000000000 --- a/docs/serving/samples/build-private-repo-go/build-bot.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2018 The Knative Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -apiVersion: v1 -kind: Secret -metadata: - name: dockerhub-push-secrets - annotations: - build.knative.dev/docker-0: https://index.docker.io/v1/ -type: kubernetes.io/basic-auth -data: - # Generated by: - # echo -n dockerhub-user | base64 - username: REPLACE_ME - # Generated by: - # echo -n dockerhub-password | base64 - password: REPLACE_ME ---- -apiVersion: v1 -kind: Secret -metadata: - name: deploy-key - annotations: - build.knative.dev/git-0: github.com -type: kubernetes.io/ssh-auth -data: - # Generated by: - # cat id_rsa | base64 -w 0 - ssh-privatekey: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlKS1FJQkFBS0NBZ0VBbyt2cmRmbmF4eWEzS3RQZEY4RXJIclpzS20yQjBDQm5FUGdCSVZYUXZhR01tSjFvCjMwVndwY2ZKU0diWXdoeFJSQUQ4QlJ2WWdUTGVqREpjcmZoWW5TZDVGUGFHMVJGazZ0Yy8zZ1UzL2FkdGczRVEKMEZGN1JHL25VckJ2UUNWejRXc0R5L1JZQ3R2ZHJ5VUdzMG8yQ2pKYk1EVGNYdEVxeDhJTjNHaHk5ejQ4MVRuMApXbVdCbWdwWHJzWGpkeWJab3BkZTZIQVFqZGNmdDFOcnFFWWF2dGRQak5Ob1NjWHZQbXAzMDQrZUFyd1lNUXBPCkIwcWtTb3NIVnlqWHRScUFKMGVUaUl4d0trN05ncU4wOFppZHJmbDFvRGZQVXQ4SmcwNFZkUTV1ZGt5QzR3RFEKbjhLVEkyWVFFY2VKNEtlRXQrWDJBQkJsN1VOUXphNldLZGxsUjQxZmFwbkdIZzhLb1ZmbkVGSEZSLy9uclBrTQo3Yzd4VG5JSVBia3pFQmNkNHNhN05rSGtyNG9LaVJrVUtkbngrREZJQlg0YjdFOEhrN0FDSk03am05TitWSHM1CjZjYWxKNVVGZGZIN2Q4U2ZzYnJBanNaVWkveDdHbDBLblRsRE1XdHhDUXQ3MVFrbVhibUROZll2dmxBMVFId2cKMElYWVIzVURvV0ZzV2d0VVRjZVlLelhQZzhLcEs5ZE1rTmtiRTRMV0xKeHozN2NiYTYwbHM0OEZpcWpsUEhPNgpZbjgvcjByNjZWbUJnQVAzbC8xYUx1QWViUmJocG5VeVhaaU5rS0JGUjB2a3c5WmFFOUhHa3c5cHNkU2doR1YwCk5xSHNVV0t6N3VnMjdaemxrc0dTLytKU202OXJzM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amNQbjhFN0lEOXQKNTBkRStRMzlqV0xUM0lGVmdISzdVcUtReHhYazNWSmsyalpRZmN5SU55dzM5ckIxMmk2Q1hnbjFodUZnV1ZBWApXRWVtTllsL1RtR1hTdllTdWxQZW5rNkNpVTlTWjZGUVd2YXBiN2Vra2NnbUZXWXBxYkNXczZuc0hrVFIKLS0tLS1FTkQgUlNBIFBSSVZBVEUgS0VZLS0tLS0K - # Generated by: - # ssh-keyscan github.com | base64 -w 0 - known_hosts: Z2l0aHViLmNvbSBzc2gtcnNhIEFBQUFCM056YUMxeWMyRUFBQUFCSXdBQUFRRUFxMkE3aFJHbWRubTl0VURiTzlJRFN3Qks2VGJRYStQWFlQQ1B5NnJiVHJUdHc3UEhrY2NLcnBwMHlWaHA1SGRFSWNLcjZwTGxWREJmT0xYOVFVc3lDT1Ywd3pmaklKTmxHRVlzZGxMSml6SGhibjJtVWp2U0FIUXFaRVRZUDgxZUZ6TFFOblBIdDRFVlZVaDdWZkRFU1U4NEtlem1ENVFsV3BYTG12VTMxL3lNZitTZTh4aEhUdktTQ1pJRkltV3dvRzZtYlVvV2Y5bnpwSW9hU2pCK3dlcXFVVW1wYWFhc1hWYWw3MkorVVgyQisyUlBXM1JjVDBlT3pRZ3FsSkwzUktyVEp2ZHNqRTNKRUF2R3EzbEdIU1pYeTI4RzNza3VhMlNtVmkvdzR5Q0U2Z2JPRHFuVFdsZzcrd0M2MDR5ZEdYQThWSmlTNWFwNDNKWGlVRkZBYVE9PQo= ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - name: build-bot -secrets: -- name: deploy-key -- name: dockerhub-push-secrets diff --git a/docs/serving/samples/build-private-repo-go/id_rsa b/docs/serving/samples/build-private-repo-go/id_rsa deleted file mode 100644 index 9db09614d..000000000 --- a/docs/serving/samples/build-private-repo-go/id_rsa +++ /dev/null @@ -1,51 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJKQIBAAKCAgEAo+vrdfnaxya3KtPdF8ErHrZsKm2B0CB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O4+FWH1vG0nYtRtAyLsP -9TZdEcrL/ATxXtLMclskJ8YIJhRfuGn4q/9Eh6Z8ryAS4NV54EYA57G8TFukpVD/ -9LmjLnfZCHia8nF5Vi/kb24zyHV3K2944CxlncUb9i2VdD6/fn4u20zw6UfQYkt7 -7DlcrYogOO6ABnh/94RESTh9MYptqg5Cx24IJOjph2yuFXZw6ObNi4/FiWGsp/ax -5SKt3cNvUwlPnmm4Olx68HrN17rvQytW+VLyE8erE1KpMWB1SZdcmxnci4H6TrfH -53/hAoIBAQDBjJSB9NPkTMhjVgb/mrYwF+D2eeJHkoW+HtjYRKdGyP72nV9pBTNs -dbuf56TqfT1TYuZTR6wNJMNLqbwH8SweyfbsFr6k33gkdGBqnU7ERuACzW4y/lYI -VOpql2rqu3q7FF8Y5K9AOpYrLFRmrPG2Hxf7RRbiTQsiDcHbU4bM89OCE3c7MN1g -UC+UyI/Ph9/HBYvTBjuCYYMm8iRuwv6Fxw75IauHiOgsOBN/i/PhCn5Go51XeoQe -bUI8JKbqHX1JHQEfZJVsrbLYdQtlsGhMF6hw2CopBm3EMdDGuGRka+lj30KLEtgr -Y1lgYvBlcsbedIrLkbEGv4WWivL9OGfTAoIBAQCk2c7oQxy5UoWzlrVQKQobsFnR -tc3cPNRei/qe+8tjKDCR6M4WLTnQkvG9GbG8CDzeqOmP/7yf1Mrb8CaGX1tgkl2w -Nd+d71Avhm7MmhQvsM/u6V6zVMZ04el3883f5UF0x94BC+dPy/uXpTsKSGWOLRMH -iR7p1FZB4oCnS9SKXNOPztS5i3cRKIIEclx05GNh3lGx29eI2TCNKjcPn8E7ID9t -50dE+Q39jWLT3IFVgHK7UqKQxxXk3VJk2jZQfcyINyw39rB12i6CXgn1huFgWVAX -WEemNYl/TmGXSvYSulPenk6CiU9SZ6FQWvapb7ekkcgmFWYpqbCWs6nsHkTR ------END RSA PRIVATE KEY----- diff --git a/docs/serving/samples/build-private-repo-go/id_rsa.pub b/docs/serving/samples/build-private-repo-go/id_rsa.pub deleted file mode 100644 index ab083f084..000000000 --- a/docs/serving/samples/build-private-repo-go/id_rsa.pub +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCj6+t1+drHJrcq090XwSsetmwqbYHQIGcQ+AEhVdC9oYyYnWjfRXClx8lIZtjCHFFEAPwFG9iBMt6MMlyt+FidJ3kU9obVEWTq1z/eBTf9p22DcRDQUXtEb+dSsG9AJXPhawPL9FgK292vJQazSjYKMlswNNxe0SrHwg3caHL3PjzVOfRaZYGaCleuxeN3Jtmil17ocBCN1x+3U2uoRhq+10+M02hJxe8+anfTj54CvBgxCk4HSqRKiwdXKNe1GoAnR5OIjHAqTs2Co3TxmJ2t+XWgN89S3wmDThV1Dm52TILjANCfwpMjZhARx4ngp4S35fYAEGXtQ1DNrpYp2WVHjV9qmcYeDwqhV+cQUcVH/+es+QztzvFOcgg9uTMQFx3ixrs2QeSvigqJGRQp2fH4MUgFfhvsTweTsAIkzuOb035UeznpxqUnlQV18ft3xJ+xusCOxlSL/HsaXQqdOUMxa3EJC3vVCSZduYM19i++UDVAfCDQhdhHdQOhYWxaC1RNx5grNc+Dwqkr10yQ2RsTgtYsnHPftxtrrSWzjwWKqOU8c7pifz+vSvrpWYGAA/eX/Vou4B5tFuGmdTJdmI2QoEVHS+TD1loT0caTD2mx1KCEZXQ2oexRYrPu6DbtnOWSwZL/4lKbr2uzU0ebZD0wAtm6HnptNcHpWei3DPRi4w== noreply@google.com diff --git a/docs/serving/samples/build-private-repo-go/manifest.yaml b/docs/serving/samples/build-private-repo-go/manifest.yaml deleted file mode 100644 index 0d27d1068..000000000 --- a/docs/serving/samples/build-private-repo-go/manifest.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2018 The Knative Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -apiVersion: serving.knative.dev/v1alpha1 -kind: Route -metadata: - name: private-repos -spec: - traffic: - - configurationName: private-repos - percent: 100 ---- -apiVersion: serving.knative.dev/v1alpha1 -kind: Configuration -metadata: - name: private-repos -spec: - build: - # Run this build as our build-bot - serviceAccountName: build-bot - source: - git: - url: git@github.com:dewitt/knative-build.git - revision: master - template: - name: kaniko - arguments: - - name: IMAGE - value: REPLACE_ME - revisionTemplate: - metadata: - labels: - knative.dev/type: app - spec: - container: - image: REPLACE_ME diff --git a/docs/serving/samples/buildpack-app-dotnet/README.md b/docs/serving/samples/buildpack-app-dotnet/README.md deleted file mode 100644 index 4d6eca81e..000000000 --- a/docs/serving/samples/buildpack-app-dotnet/README.md +++ /dev/null @@ -1,104 +0,0 @@ -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. - -## Prerequisites - -- [Install Knative Serving](../../../install/README.md) - -## Running - -This sample uses the -[Buildpack build template](https://github.com/knative/build-templates/blob/master/buildpacks/cnb.yaml) -in the [build-templates](https://github.com/knative/build-templates/) repo. Save -a copy of `buildpack.yaml`, then install it: - -```shell -kubectl apply --filename https://raw.githubusercontent.com/knative/build-templates/master/buildpack/buildpack.yaml -``` - -Then you can deploy this to Knative Serving from the root directory by entering -the following commands: - -```shell -# Replace with your own registry -export REPO="gcr.io/" - -perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" sample.yaml - -# Create the Kubernetes resources -kubectl apply --filename sample.yaml -``` - -Once deployed, you will see that it first builds: - -```shell -$ kubectl get revision --output yaml -apiVersion: v1 -items: -- apiVersion: serving.knative.dev/v1alpha1 - kind: Revision - ... - status: - conditions: - - reason: Building - status: "False" - type: BuildComplete -... -``` - -Once the `BuildComplete` status is `True`, resource creation begins. - -To access this service using `curl`, we first need to determine its ingress -address: - -```shell -# In Knative 0.2.x and prior versions, the `knative-ingressgateway` service was used instead of `istio-ingressgateway`. -INGRESSGATEWAY=knative-ingressgateway - -# The use of `knative-ingressgateway` is deprecated in Knative v0.3.x. -# Use `istio-ingressgateway` instead, since `knative-ingressgateway` -# will be removed in Knative v0.4. -if kubectl get configmap config-istio -n knative-serving &> /dev/null; then - INGRESSGATEWAY=istio-ingressgateway -fi - -watch kubectl get svc $INGRESSGATEWAY --namespace istio-system -NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -xxxxxxx-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, 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. -export SERVICE_HOST=`kubectl get route buildpack-sample-app --output jsonpath="{.status.domain}"` - -# Put the ingress IP into an environment variable. -export SERVICE_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system --output jsonpath="{.status.loadBalancer.ingress[*].ip}"` -``` - -Now curl the service IP to make sure the deployment succeeded: - -```shell -# Curl the ingress IP as if DNS were properly configured -curl --header "Host: $SERVICE_HOST" http://${SERVICE_IP}/ -[response] -``` - -## Cleaning up - -To clean up the sample service: - -```shell -# Clean up the serving resources -kubectl delete --filename docs/serving/samples/buildpack-app-dotnet/sample.yaml -# Clean up the build template -kubectl delete buildtemplate buildpack -``` diff --git a/docs/serving/samples/buildpack-app-dotnet/_index.md b/docs/serving/samples/buildpack-app-dotnet/_index.md deleted file mode 100644 index 8a1cb3c3e..000000000 --- a/docs/serving/samples/buildpack-app-dotnet/_index.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "Buildpack Sample App - .NET" -linkTitle: "Buildpack app - .NET" -weight: 1 -type: "docs" ---- - -{{% readfile file="README.md" relative="true" markdown="true" %}} diff --git a/docs/serving/samples/buildpack-app-dotnet/sample.yaml b/docs/serving/samples/buildpack-app-dotnet/sample.yaml deleted file mode 100644 index dedeadd2b..000000000 --- a/docs/serving/samples/buildpack-app-dotnet/sample.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: serving.knative.dev/v1alpha1 -kind: Configuration -metadata: - name: buildpack-sample-app - namespace: default -spec: - build: - source: - git: - url: https://github.com/cloudfoundry-samples/dotnet-core-hello-world - revision: master - template: - name: buildpacks-cnb - arguments: - - name: IMAGE - value: DOCKER_REPO_OVERRIDE/buildpack-sample-app - # - name: CACHE - # value: buildpack-sample-app-cache - # volumes: - # - name: buildpack-sample-app-cache - # persistentVolumeClaim: - # claimName: buildpack-sample-app-cache - - revisionTemplate: - metadata: - labels: - knative.dev/type: app - spec: - container: - image: DOCKER_REPO_OVERRIDE/buildpack-sample-app ---- -apiVersion: serving.knative.dev/v1alpha1 -kind: Route -metadata: - name: buildpack-sample-app - namespace: default -spec: - traffic: - - configurationName: buildpack-sample-app - percent: 100 diff --git a/docs/serving/samples/buildpack-function-nodejs/README.md b/docs/serving/samples/buildpack-function-nodejs/README.md deleted file mode 100644 index 6e1171571..000000000 --- a/docs/serving/samples/buildpack-function-nodejs/README.md +++ /dev/null @@ -1,102 +0,0 @@ -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. - -## Prerequisites - -- [Install Knative Serving](../../../install/README.md) - -## Running - -This sample uses the -[Buildpack build template](https://github.com/knative/build-templates/blob/master/buildpacks/cnb.yaml) -from the [build-templates](https://github.com/knative/build-templates/) repo. - -Save a copy of `buildpack.yaml`, then install it: - -```shell -kubectl apply --filename https://raw.githubusercontent.com/knative/build-templates/master/buildpacks/cnb.yaml -``` - -Then you can deploy this to Knative Serving from the root directory via: - -```shell -# Replace with your own registry -export REPO="gcr.io/" - -perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" sample.yaml - -kubectl apply --filename sample.yaml -``` - -Once deployed, you will see that it first builds: - -```shell -$ kubectl get revision --output yaml -apiVersion: v1 -items: -- apiVersion: serving.knative.dev/v1alpha1 - kind: Revision - ... - status: - conditions: - - reason: Building - status: "False" - type: BuildComplete -... -``` - -Once the `BuildComplete` status is `True`, resource creation begins. - -To access this service using `curl`, we first need to determine its ingress -address: - -```shell -# In Knative 0.2.x and prior versions, the `knative-ingressgateway` service was used instead of `istio-ingressgateway`. -INGRESSGATEWAY=knative-ingressgateway - -# The use of `knative-ingressgateway` is deprecated in Knative v0.3.x. -# Use `istio-ingressgateway` instead, since `knative-ingressgateway` -# will be removed in Knative v0.4. -if kubectl get configmap config-istio -n knative-serving &> /dev/null; then - INGRESSGATEWAY=istio-ingressgateway -fi - -watch kubectl get svc $INGRESSGATEWAY --namespace istio-system -NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -xxxxxxx-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, 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. -$ export SERVICE_HOST=`kubectl get route buildpack-function --output jsonpath="{.status.domain}"` - -# Put the ingress IP into an environment variable. -$ export SERVICE_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system --output jsonpath="{.status.loadBalancer.ingress[*].ip}"` -``` - -Now curl the service IP to make sure the deployment succeeded: - -```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] -``` - -## Cleaning up - -To clean up the sample service: - -```shell -# Clean up the serving resources -kubectl delete --filename docs/serving/samples/buildpack-function-nodejs/sample.yaml -# Clean up the build template -kubectl delete buildtemplate buildpack -``` diff --git a/docs/serving/samples/buildpack-function-nodejs/_index.md b/docs/serving/samples/buildpack-function-nodejs/_index.md deleted file mode 100644 index 3739587be..000000000 --- a/docs/serving/samples/buildpack-function-nodejs/_index.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "Buildpack Sample Function - Node.js" -linkTitle: "Buildpack function - Node.js" -weight: 1 -type: "docs" ---- - -{{% readfile file="README.md" relative="true" markdown="true" %}} diff --git a/docs/serving/samples/buildpack-function-nodejs/sample.yaml b/docs/serving/samples/buildpack-function-nodejs/sample.yaml deleted file mode 100644 index 296473ed1..000000000 --- a/docs/serving/samples/buildpack-function-nodejs/sample.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: serving.knative.dev/v1alpha1 -kind: Configuration -metadata: - name: buildpack-function - namespace: default -spec: - build: - source: - git: - url: https://github.com/projectriff-samples/node-square - revision: master - template: - name: buildpacks-cnb - arguments: - - name: IMAGE - value: DOCKER_REPO_OVERRIDE/buildpack-function - - name: BUILDPACK_ORDER - value: https://github.com/projectriff/node-function-invoker.git#buildpack - - name: SKIP_DETECT - value: "true" - # - name: CACHE - # value: buildpack-function-cache - # volumes: - # - name: buildpack-function-cache - # persistentVolumeClaim: - # claimName: buildpack-function-cache - - revisionTemplate: - metadata: - labels: - knative.dev/type: function - spec: - container: - image: DOCKER_REPO_OVERRIDE/buildpack-function ---- -apiVersion: serving.knative.dev/v1alpha1 -kind: Route -metadata: - name: buildpack-function - namespace: default -spec: - traffic: - - configurationName: buildpack-function - percent: 100 diff --git a/docs/serving/samples/gitwebhook-go/README.md b/docs/serving/samples/gitwebhook-go/README.md index 76e40385b..7599842de 100644 --- a/docs/serving/samples/gitwebhook-go/README.md +++ b/docs/serving/samples/gitwebhook-go/README.md @@ -106,15 +106,14 @@ webhook. ```shell $ kubectl get ksvc gitwebhook \ - --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - gitwebhook gitwebhook.default.example.com + --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + gitwebhook http://gitwebhook.default.example.com ``` 1. Browse on GitHub to the repository where you want to create a webhook. 1. Click **Settings**, then **Webhooks**, then **Add webhook**. - 1. Enter the **Payload URL** as `http://{DOMAIN}`, with the value of DOMAIN - listed above. + 1. Fill in **Payload URL** with the value of URL listed above. 1. Set the **Content type** to `application/json`. 1. Enter the **Secret** value to be the same as the original base used for `webhookSecret` above (the original value, not the base64 encoded value). diff --git a/docs/serving/samples/grpc-ping-go/README.md b/docs/serving/samples/grpc-ping-go/README.md index 26050fcef..0175708b7 100644 --- a/docs/serving/samples/grpc-ping-go/README.md +++ b/docs/serving/samples/grpc-ping-go/README.md @@ -37,9 +37,6 @@ kubectl apply --filename docs/serving/samples/grpc-ping-go/sample.yaml 1. Fetch the created ingress hostname and IP. ```shell - # Put the Host name into an environment variable. - export SERVICE_HOST=`kubectl get route grpc-ping --output jsonpath="{.status.domain}"` - # Put the ingress IP into an environment variable. export SERVICE_IP=`kubectl get svc istio-ingressgateway --namespace istio-system --output jsonpath="{.status.loadBalancer.ingress[*].ip}"` ``` @@ -50,6 +47,6 @@ kubectl apply --filename docs/serving/samples/grpc-ping-go/sample.yaml ```shell docker run -ti --entrypoint=/client docker.io/{username}/grpc-ping-go \ -server_addr="${SERVICE_IP}:80" \ - -server_host_override="${SERVICE_HOST}" \ + -server_host_override="grpc-ping.default.example.com" \ -insecure ``` diff --git a/docs/serving/samples/hello-world/helloworld-csharp/README.md b/docs/serving/samples/hello-world/helloworld-csharp/README.md index d72ce39d3..373dd5a71 100644 --- a/docs/serving/samples/hello-world/helloworld-csharp/README.md +++ b/docs/serving/samples/hello-world/helloworld-csharp/README.md @@ -174,9 +174,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, use ``` - kubectl get ksvc helloworld-csharp --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-csharp helloworld-csharp.default.example.com + kubectl get ksvc helloworld-csharp --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-csharp http://helloworld-csharp.default.example.com ``` 1. Now you can make a request to your app to see the result. Replace diff --git a/docs/serving/samples/hello-world/helloworld-go/README.md b/docs/serving/samples/hello-world/helloworld-go/README.md index bd685106f..62c886452 100644 --- a/docs/serving/samples/hello-world/helloworld-go/README.md +++ b/docs/serving/samples/hello-world/helloworld-go/README.md @@ -170,14 +170,14 @@ folder) you're ready to build and deploy the sample app. 1. Run the following command to find the domain URL for your service: ```shell - kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,URL:.status.url ``` Example: ```shell - NAME DOMAIN - helloworld-go helloworld-go.default.example.com + NAME URL + helloworld-go http://helloworld-go.default.example.com ``` 1. Test your app by sending it a request. Use the following `curl` command with diff --git a/docs/serving/samples/hello-world/helloworld-java-spark/README.md b/docs/serving/samples/hello-world/helloworld-java-spark/README.md index 59c494ff5..c4ba41039 100644 --- a/docs/serving/samples/hello-world/helloworld-java-spark/README.md +++ b/docs/serving/samples/hello-world/helloworld-java-spark/README.md @@ -152,21 +152,17 @@ folder) you're ready to build and deploy the sample app. ```shell kubectl get ksvc helloworld-java \ - --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + --output=custom-columns=NAME:.metadata.name,URL:.status.url - NAME DOMAIN - helloworld-java helloworld-java.default.example.com - - # Or simply: - export DOMAIN_NAME=$(kubectl get ksvc helloworld-java \ - --output jsonpath={.status.domain}) + NAME URL + helloworld-java http://helloworld-java.default.example.com ``` 6. Now you can make a request to your app to see the result. Presuming, the IP address you got in the step above is in the `${IP_ADDRESS}` env variable: ```shell - curl -H "Host: ${DOMAIN_NAME}" http://${IP_ADDRESS} + curl -H "Host: helloworld-java.default.example.com" http://${IP_ADDRESS} ``` ## Removing the sample app deployment diff --git a/docs/serving/samples/hello-world/helloworld-java-spring/README.md b/docs/serving/samples/hello-world/helloworld-java-spring/README.md index 49ee63505..cf7ee0242 100644 --- a/docs/serving/samples/hello-world/helloworld-java-spring/README.md +++ b/docs/serving/samples/hello-world/helloworld-java-spring/README.md @@ -201,21 +201,17 @@ folder) you're ready to build and deploy the sample app. ```shell kubectl get ksvc helloworld-java-spring \ - --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + --output=custom-columns=NAME:.metadata.name,URL:.status.url - NAME DOMAIN - helloworld-java-spring helloworld-java-spring.default.example.com - - # Or simply: - export DOMAIN_NAME=$(kubectl get ksvc helloworld-java-spring \ - --output jsonpath={.status.domain} + NAME URL + helloworld-java-spring http://helloworld-java-spring.default.example.com ``` 1. Now you can make a request to your app to see the result. Presuming, the IP address you got in the step above is in the `${IP_ADDRESS}` env variable: ```shell - curl -H "Host: ${DOMAIN_NAME}" http://${IP_ADDRESS} + curl -H "Host: helloworld-java-spring.default.example.com" http://${IP_ADDRESS} Hello Spring Boot Sample v1! ``` diff --git a/docs/serving/samples/hello-world/helloworld-kotlin/README.md b/docs/serving/samples/hello-world/helloworld-kotlin/README.md index 83840d04d..11e330583 100644 --- a/docs/serving/samples/hello-world/helloworld-kotlin/README.md +++ b/docs/serving/samples/hello-world/helloworld-kotlin/README.md @@ -212,10 +212,10 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, use ```shell - kubectl get ksvc helloworld-kotlin --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + kubectl get ksvc helloworld-kotlin --output=custom-columns=NAME:.metadata.name,URL:.status.url - NAME DOMAIN - helloworld-kotlin helloworld-kotlin.default.example.com + NAME URL + helloworld-kotlin http://helloworld-kotlin.default.example.com ``` 1. Now you can make a request to your app to see the result. Presuming, the IP diff --git a/docs/serving/samples/hello-world/helloworld-nodejs/README.md b/docs/serving/samples/hello-world/helloworld-nodejs/README.md index 4683317b6..503b59600 100644 --- a/docs/serving/samples/hello-world/helloworld-nodejs/README.md +++ b/docs/serving/samples/hello-world/helloworld-nodejs/README.md @@ -197,9 +197,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, use ``` - kubectl get ksvc helloworld-nodejs --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-nodejs helloworld-nodejs.default.example.com + kubectl get ksvc helloworld-nodejs --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-nodejs http://helloworld-nodejs.default.example.com ``` 1. Now you can make a request to your app to see the result. Replace diff --git a/docs/serving/samples/hello-world/helloworld-php/README.md b/docs/serving/samples/hello-world/helloworld-php/README.md index 131d313d9..56dbc2b6e 100644 --- a/docs/serving/samples/hello-world/helloworld-php/README.md +++ b/docs/serving/samples/hello-world/helloworld-php/README.md @@ -144,9 +144,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, use ``` - kubectl get ksvc helloworld-php --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-php helloworld-php.default.example.com + kubectl get ksvc helloworld-php --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-php http://helloworld-php.default.example.com ``` 1. Now you can make a request to your app to see the result. Replace diff --git a/docs/serving/samples/hello-world/helloworld-python/README.md b/docs/serving/samples/hello-world/helloworld-python/README.md index 4df2f4a25..dba476273 100644 --- a/docs/serving/samples/hello-world/helloworld-python/README.md +++ b/docs/serving/samples/hello-world/helloworld-python/README.md @@ -159,9 +159,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, use ``` - kubectl get ksvc helloworld-python --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-python helloworld-python.default.example.com + kubectl get ksvc helloworld-python --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-python http://helloworld-python.default.example.com ``` 1. Now you can make a request to your app to see the result. Replace diff --git a/docs/serving/samples/hello-world/helloworld-ruby/README.md b/docs/serving/samples/hello-world/helloworld-ruby/README.md index 9ac893e78..18bc85084 100644 --- a/docs/serving/samples/hello-world/helloworld-ruby/README.md +++ b/docs/serving/samples/hello-world/helloworld-ruby/README.md @@ -156,9 +156,9 @@ folder) you're ready to build and deploy the sample app. 1. To find the URL for your service, use ``` - kubectl get ksvc helloworld-ruby --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain - NAME DOMAIN - helloworld-ruby helloworld-ruby.default.example.com + kubectl get ksvc helloworld-ruby --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + helloworld-ruby http://helloworld-ruby.default.example.com ``` 1. Now you can make a request to your app to see the result. Replace diff --git a/docs/serving/samples/hello-world/helloworld-scala/README.md b/docs/serving/samples/hello-world/helloworld-scala/README.md index e5e439896..e7554ff42 100644 --- a/docs/serving/samples/hello-world/helloworld-scala/README.md +++ b/docs/serving/samples/hello-world/helloworld-scala/README.md @@ -136,11 +136,11 @@ Then find the service host: ```shell kubectl get ksvc helloworld-scala \ - --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + --output=custom-columns=NAME:.metadata.name,URL:.status.url -# It will print something like this, the DOMAIN is what you're going to use as HTTP Host header: -# NAME DOMAIN -# helloworld-scala helloworld-scala.default.example.com +# It will print something like this, the URL is what you're going to use as HTTP Host header: +# NAME URL +# helloworld-scala http://helloworld-scala.default.example.com ``` Finally, to try your service, use the obtained address in the Host header: diff --git a/docs/serving/samples/hello-world/helloworld-shell/README.md b/docs/serving/samples/hello-world/helloworld-shell/README.md index 1f274de46..b252260bf 100644 --- a/docs/serving/samples/hello-world/helloworld-shell/README.md +++ b/docs/serving/samples/hello-world/helloworld-shell/README.md @@ -152,14 +152,14 @@ folder) you're ready to build and deploy the sample app. 1. Run the following command to find the domain URL for your service: ```shell - kubectl get ksvc helloworld-shell --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + kubectl get ksvc helloworld-shell --output=custom-columns=NAME:.metadata.name,URL:.status.url ``` Example: ```shell - NAME DOMAIN - helloworld-shell helloworld-shell.default.example.com + NAME URL + helloworld-shell http://helloworld-shell.default.example.com ``` 1. Test your app by sending it a request. Use the following `curl` command with diff --git a/docs/serving/samples/knative-routing-go/README.md b/docs/serving/samples/knative-routing-go/README.md index d2578548e..03c82e84a 100644 --- a/docs/serving/samples/knative-routing-go/README.md +++ b/docs/serving/samples/knative-routing-go/README.md @@ -140,16 +140,18 @@ export GATEWAY_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system \ --output jsonpath="{.status.loadBalancer.ingress[*]['ip']}"` ``` -2. Find the `Search` service route and export as an environment variable: +2. Find the `Search` service URL with: ```shell -export SERVICE_HOST=`kubectl get route search-service --output jsonpath="{.status.domain}"` +# kubectl get route search-service --output=custom-columns=NAME:.metadata.name,URL:.status.url +NAME URL +search-service http://search-service.default.example.com ``` 3. Make a curl request to the service: ```shell -curl http://${GATEWAY_IP} --header "Host:${SERVICE_HOST}" +curl http://${GATEWAY_IP} --header "Host:search-service.default.example.com" ``` You should see: `Search Service is called !` @@ -157,11 +159,7 @@ You should see: `Search Service is called !` 4. Similarly, you can also directly access "Login" service with: ```shell -export SERVICE_HOST=`kubectl get route login-service --output jsonpath="{.status.domain}"` -``` - -```shell -curl http://${GATEWAY_IP} --header "Host:${SERVICE_HOST}" +curl http://${GATEWAY_IP} --header "Host:login-service.default.example.com" ``` You should see: `Login Service is called !` diff --git a/docs/serving/samples/rest-api-go/README.md b/docs/serving/samples/rest-api-go/README.md index 0ba96b49b..ad3cfd13e 100644 --- a/docs/serving/samples/rest-api-go/README.md +++ b/docs/serving/samples/rest-api-go/README.md @@ -187,11 +187,12 @@ variables in the following steps. echo $INGRESS_IP ``` -2. Get the hostname of the service: +2. Get the URL of the service: ```shell - export SERVICE_HOSTNAME=`kubectl get ksvc stock-service-example --output jsonpath="{.status.domain}"` - echo $SERVICE_HOSTNAME + kubectl get ksvc stock-service-example --output=custom-columns=NAME:.metadata.name,URL:.status.url + NAME URL + stock-service-example http://stock-service-example.default.example.com ``` 3. Send requests to the service using `curl`: @@ -205,7 +206,7 @@ variables in the following steps. the ingress gateway IP. ```shell - curl --header "Host:$SERVICE_HOSTNAME" http://${INGRESS_IP} + curl --header "Host:stock-service-example.default.example.com" http://${INGRESS_IP} ``` Response body: `Welcome to the stock app!` @@ -213,7 +214,7 @@ variables in the following steps. 2. Send a request to the `/stock` endpoint: ```shell - curl --header "Host:$SERVICE_HOSTNAME" http://${INGRESS_IP}/stock + curl --header "Host:stock-service-example.default.example.com" http://${INGRESS_IP}/stock ``` Response body: `stock ticker not found!, require /stock/{ticker}` @@ -222,7 +223,7 @@ variables in the following steps. "[stock symbol](https://www.marketwatch.com/tools/quotes/lookup.asp)": ```shell - curl --header "Host:$SERVICE_HOSTNAME" http://${INGRESS_IP}/stock/ + curl --header "Host:stock-service-example.default.example.com" http://${INGRESS_IP}/stock/ ``` where `` is your "stock symbol". @@ -234,7 +235,7 @@ variables in the following steps. Request: ```shell - curl --header "Host:$SERVICE_HOSTNAME" http://${INGRESS_IP}/stock/FAKE + curl --header "Host:stock-service-example.default.example.com" http://${INGRESS_IP}/stock/FAKE ``` Response: `stock price for ticker FAKE is 0.00` diff --git a/docs/serving/samples/secrets-go/README.md b/docs/serving/samples/secrets-go/README.md index 88f447d7e..52ec95b8a 100644 --- a/docs/serving/samples/secrets-go/README.md +++ b/docs/serving/samples/secrets-go/README.md @@ -256,14 +256,14 @@ folder) you're ready to build and deploy the sample app. 1. Run the following command to find the domain URL for your service: ```shell - kubectl get ksvc secrets-go --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain + kubectl get ksvc secrets-go --output=custom-columns=NAME:.metadata.name,URL:.status.url ``` Example: ```shell - NAME DOMAIN - secrets-go secrets-go.default.example.com + NAME URL + secrets-go http://secrets-go.default.example.com ``` 1. Test your app by sending it a request. Use the following `curl` command with diff --git a/docs/serving/samples/telemetry-go/README.md b/docs/serving/samples/telemetry-go/README.md index e6848563b..0410d8d8e 100644 --- a/docs/serving/samples/telemetry-go/README.md +++ b/docs/serving/samples/telemetry-go/README.md @@ -151,14 +151,12 @@ status: ... status: "True" type: Ready - domain: telemetrysample-route.default.example.com + url: http://telemetrysample-route.default.example.com ``` -2. Export the ingress hostname and IP as environment variables: +2. Export the ingress IP as an environment variable: ``` -export SERVICE_HOST=`kubectl get route telemetrysample-route --output jsonpath="{.status.domain}"` - # In Knative 0.2.x and prior versions, the `knative-ingressgateway` service was used instead of `istio-ingressgateway`. INGRESSGATEWAY=knative-ingressgateway @@ -175,14 +173,14 @@ export SERVICE_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system --ou 3. Make a request to the service to see the `Hello World!` message: ``` -curl --header "Host:$SERVICE_HOST" http://${SERVICE_IP} +curl --header "Host:telemetrysample-route.default.example.com" http://${SERVICE_IP} ``` 4. Make a request to the `/log` endpoint to generate logs to the `stdout` file and generate files under `/var/log` in both `JSON` and plain text formats: ``` -curl --header "Host:$SERVICE_HOST" http://${SERVICE_IP}/log +curl --header "Host:telemetrysample-route.default.example.com" http://${SERVICE_IP}/log ``` ## Access Logs diff --git a/docs/serving/samples/thumbnailer-go/README.md b/docs/serving/samples/thumbnailer-go/README.md deleted file mode 100644 index 4add688b7..000000000 --- a/docs/serving/samples/thumbnailer-go/README.md +++ /dev/null @@ -1,229 +0,0 @@ -This is a walk-through example that demonstrates deploying a dockerized -application that accesses external dependencies to Knative Serving. In this demo -we will use a sample `golang` application that takes a video URL as an input and -generates its thumbnail image using the `ffmpeg` framework. - -## Before you begin - -- [Install Knative Serving](../../../install/README.md) - -If you want to test and run the app locally: - -- [Install Go](https://golang.org/doc/install) -- [Download `ffmpeg`](https://www.ffmpeg.org/download.html) - -## Sample code - -In this demo we are going to use a simple `golang` REST app called -[rester-tester](https://github.com/mchmarny/rester-tester). It's important to -point out that this application doesn't use any special Knative Serving -components, nor does it have any Knative Serving SDK dependencies. - -### Cloning the sample code - -Let's start by cloning the public `rester-tester` repository: - -``` -git clone git@github.com:mchmarny/rester-tester.git -cd rester-tester -``` - -The `rester-tester` application uses [godep](https://github.com/tools/godep) to -manage its own dependencies. Download `godep` and restore the app dependencies: - -``` -go get github.com/tools/godep -godep restore -``` - -### Run tests - -To make sure the application is ready, run the integrated tests: - -``` -go test ./... -``` - -### Run the app - -You can now run the `rester-tester` application locally in `go` or using Docker. - -**Local** - -To run the app: - -``` -go build -./rester-tester -``` - -**Docker** - -When running the application locally using Docker, you do not need to install -`ffmpeg`; Docker will install it for you 'inside' of the Docker image. - -To run the app: - -``` -docker build -t rester-tester:latest . -docker run -p 8080:8080 rester-tester:latest -``` - -### Test - -To test the thumbnailing service, use `curl` to submit the `src`, a video URL: - -``` -curl -X POST -H "Content-Type: application/json" http://localhost:8080/image \ - -d '{"src":"https://www.youtube.com/watch?v=DjByja9ejTQ"}' -``` - -## Deploying the app to Knative - -From this point, you can either deploy a prebuilt image of the app, or build the -app locally and then deploy it. - -### Deploying a prebuilt image - -You can deploy a prebuilt image of the `rester-tester` app to Knative Serving -using `kubectl` and the included `sample-prebuilt.yaml` file: - -``` -# From inside the thumbnailer-go directory -kubectl apply --filename sample-prebuilt.yaml -``` - -### Building and deploying a version of the app - -If you want to build the image yourself, follow these instructions. This sample -uses the -[Kaniko build template](https://github.com/knative/build-templates/blob/master/kaniko/kaniko.yaml) -from the [build-templates](https://github.com/knative/build-templates/) repo. - -```shell -# Replace the token string with a suitable registry -REPO="gcr.io/" -perl -pi -e "s@DOCKER_REPO_OVERRIDE@$REPO@g" sample.yaml - -# Install the Kaniko build template used to build this sample (in the -# build-templates repo). -kubectl apply --filename https://raw.githubusercontent.com/knative/build-templates/master/kaniko/kaniko.yaml - -# Create the Knative route and configuration for the application -kubectl apply --filename sample.yaml -``` - -Now, if you look at the `status` of the revision, you will see that a build is -in progress: - -```shell -$ kubectl get revisions --output yaml -apiVersion: v1 -items: -- apiVersion: serving.knative.dev/v1alpha1 - kind: Revision - ... - status: - conditions: - - reason: Building - status: "False" - type: BuildComplete -... -``` - -Once `BuildComplete` has a `status: "True"`, the revision will be deployed. - -## Using the app - -To confirm that the app deployed, you can check for the Knative Serving service -using `kubectl`. First, is there an ingress service, and does it have an -`EXTERNAL-IP`: - -``` -# In Knative 0.2.x and prior versions, the `knative-ingressgateway` service was used instead of `istio-ingressgateway`. -INGRESSGATEWAY=knative-ingressgateway - -# The use of `knative-ingressgateway` is deprecated in Knative v0.3.x. -# Use `istio-ingressgateway` instead, since `knative-ingressgateway` -# will be removed in Knative v0.4. -if kubectl get configmap config-istio -n knative-serving &> /dev/null; then - INGRESSGATEWAY=istio-ingressgateway -fi - -kubectl get svc $INGRESSGATEWAY --namespace istio-system -NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE -xxxxxxx-ingressgateway LoadBalancer 10.23.247.74 35.203.155.229 80:32380/TCP,443:32390/TCP,32400:32400/TCP 2d -``` - -> Note: It can take a few seconds for the service to show an `EXTERNAL-IP`. - -The newly deployed app may take few seconds to initialize. You can check its -status by entering the following command: - -``` -kubectl --namespace default get pods -``` - -The Knative Serving ingress service will automatically be assigned an external -IP, so let's capture the IP and Host URL in variables so that we can use them in -`curl` commands: - -``` -# Put the Host URL into an environment variable. -export SERVICE_HOST=`kubectl get route thumb --output jsonpath="{.status.domain}"` - -# In Knative 0.2.x and prior versions, the `knative-ingressgateway` service was used instead of `istio-ingressgateway`. -INGRESSGATEWAY=knative-ingressgateway -INGRESSGATEWAY_LABEL=knative - -# The use of `knative-ingressgateway` is deprecated in Knative v0.3.x. -# Use `istio-ingressgateway` instead, since `knative-ingressgateway` -# will be removed in Knative v0.4. -if kubectl get configmap config-istio -n knative-serving &> /dev/null; then - INGRESSGATEWAY=istio-ingressgateway - INGRESSGATEWAY_LABEL=istio -fi - -# Put the ingress IP into an environment variable. -export SERVICE_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system --output jsonpath="{.status.loadBalancer.ingress[*].ip}"` -``` - -If your cluster is running outside a cloud provider (for example on Minikube), -your services will never get an external IP address. In that case, use the istio -`hostIP` and `nodePort` as the service IP: - -```shell -export SERVICE_IP=$(kubectl get po --selector $INGRESSGATEWAY_LABEL=ingressgateway --namespace istio-system --output 'jsonpath={.items[0].status.hostIP}'):$(kubectl get svc $INGRESSGATEWAY --namespace istio-system --output 'jsonpath={.spec.ports[?(@.port==80)].nodePort}') -``` - -### Ping - -Let's start with a simple `ping` to make sure the app is deployed: - -``` -curl -H "Content-Type: application/json" -H "Host: $SERVICE_HOST" \ - http://$SERVICE_IP/ping -``` - -### Video Thumbnail - -Now, supply the video URL and generate a video thumbnail: - -``` -curl -X POST -H "Content-Type: application/json" -H "Host: $SERVICE_HOST" \ - http://$SERVICE_IP/image -d '{"src":"https://www.youtube.com/watch?v=DjByja9ejTQ"}' -``` - -You can then download the newly created thumbnail. Make sure to replace the -image file name with the one returned by the previous curl request: - -``` -curl -H "Host: $SERVICE_HOST" \ - http://$SERVICE_IP/thumb/img_b43ffcc2-0c80-4862-8423-60ec1b4c4926.png > demo.png -``` - -## Final Thoughts - -Although this demo uses an external application, the Knative Serving deployment -steps would be similar for any 'dockerized' app you may already have. Just copy -the `sample.yaml` and change a few variables. diff --git a/docs/serving/samples/thumbnailer-go/_index.md b/docs/serving/samples/thumbnailer-go/_index.md deleted file mode 100644 index 241c1d0c8..000000000 --- a/docs/serving/samples/thumbnailer-go/_index.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "Thumbnailer External Dependencies Demo - Go" -linkTitle: "Deploy, build, and serve - Go" -weight: 1 -type: "docs" ---- - -{{% readfile file="README.md" relative="true" markdown="true" %}} diff --git a/docs/serving/samples/thumbnailer-go/sample-prebuilt.yaml b/docs/serving/samples/thumbnailer-go/sample-prebuilt.yaml deleted file mode 100644 index 4ab77be24..000000000 --- a/docs/serving/samples/thumbnailer-go/sample-prebuilt.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2018 The Knative Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: serving.knative.dev/v1alpha1 -kind: Route -metadata: - name: thumb - namespace: default -spec: - traffic: - - configurationName: thumbtemplate - percent: 100 ---- -apiVersion: serving.knative.dev/v1alpha1 -kind: Configuration -metadata: - name: thumbtemplate - namespace: default -spec: - revisionTemplate: - metadata: - labels: - knative.dev/type: app - spec: - container: - image: docker.io/mchmarny/rester-tester:latest - env: - - name: TARGET - value: thumb_v1 diff --git a/docs/serving/samples/thumbnailer-go/sample.yaml b/docs/serving/samples/thumbnailer-go/sample.yaml deleted file mode 100644 index 4813dac8b..000000000 --- a/docs/serving/samples/thumbnailer-go/sample.yaml +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2018 The Knative Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -apiVersion: serving.knative.dev/v1alpha1 -kind: Route -metadata: - name: thumb - namespace: default -spec: - traffic: - - configurationName: thumbtemplate - percent: 100 ---- -apiVersion: serving.knative.dev/v1alpha1 -kind: Configuration -metadata: - name: thumbtemplate - namespace: default -spec: - build: - source: - git: - url: https://github.com/mchmarny/rester-tester - revision: master - template: - name: kaniko - arguments: - - name: IMAGE - value: DOCKER_REPO_OVERRIDE/rester-tester - revisionTemplate: - metadata: - labels: - knative.dev/type: app - spec: - container: - image: DOCKER_REPO_OVERRIDE/rester-tester - env: - - name: TARGET - value: thumb_v1 diff --git a/docs/serving/using-a-custom-domain.md b/docs/serving/using-a-custom-domain.md index eef11f6e3..380502877 100644 --- a/docs/serving/using-a-custom-domain.md +++ b/docs/serving/using-a-custom-domain.md @@ -83,11 +83,11 @@ You can also apply an updated domain configuration: Deploy an app (for example, [`helloworld-go`](./samples/hello-world/helloworld-go/README.md)), to your -cluster as normal. You can check the customized domain in Knative Route +cluster as normal. You can retrieve the URL in Knative Route "helloworld-go" with the following command: ```shell -kubectl get route helloworld-go --output jsonpath="{.status.domain}" +kubectl get route helloworld-go --output jsonpath="{.status.url}" ``` You should see the full customized domain: `helloworld-go.default.mydomain.com`. @@ -128,7 +128,7 @@ export GATEWAY_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system --ou # helloworld-go is the generated Knative Route of "helloworld-go" sample. # You need to replace it with your own Route in your project. -export DOMAIN_NAME=`kubectl get route helloworld-go --output jsonpath="{.status.domain}"` +export DOMAIN_NAME=`kubectl get route helloworld-go --output jsonpath="{.status.url}" | cut -d'/' -f 3` # Add the record of Gateway IP and domain name into file "/etc/hosts" echo -e "$GATEWAY_IP\t$DOMAIN_NAME" | sudo tee -a /etc/hosts