Issue 3642 finishing up eventing sanity check (#3743)

* Update mkdocs.yml

* Update mkdocs.yml

* Update mkdocs.yml

* bringing back the purple

* Revert "bringing back the purple"

This reverts commit a6af055288.

* Removing reference to GKE-specific docs

* bash, resolving redirect warning for help

* replace all shells with bash across the entire project

* style guide conformance

* index -> readme

* serving link fixes while I'm at it

* fix serving links and redirects

* lint
This commit is contained in:
Omer B 2021-06-08 08:53:41 -04:00 committed by GitHub
parent b5bb37488a
commit 5e56c88e45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
96 changed files with 669 additions and 695 deletions

View File

@ -113,7 +113,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-clojure . docker build -t {username}/helloworld-clojure .
@ -126,7 +126,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -148,7 +148,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-clojure.default.1.2.3.4.sslip.io curl http://helloworld-clojure.default.1.2.3.4.sslip.io
Hello World! Hello World!
``` ```
@ -157,6 +157,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -42,7 +42,7 @@ be created using the following instructions.
2. If you want to run locally, install dependencies. If you only want to run in 2. If you want to run locally, install dependencies. If you only want to run in
Docker or Knative, you can skip this step. Docker or Knative, you can skip this step.
```shell ```bash
> pub get > pub get
``` ```
@ -111,7 +111,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-dart . docker build -t {username}/helloworld-dart .
@ -124,7 +124,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -146,7 +146,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-dart.default.1.2.3.4.sslip.io curl http://helloworld-dart.default.1.2.3.4.sslip.io
Hello Dart Sample v1 Hello Dart Sample v1
``` ```
@ -155,6 +155,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -11,7 +11,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-deno cd knative-docs/docs/serving/samples/hello-world/helloworld-deno
``` ```
@ -87,7 +87,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-deno . docker build -t {username}/helloworld-deno .
@ -100,7 +100,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -113,13 +113,13 @@ folder) you're ready to build and deploy the sample app.
1. Run the following command to find the domain URL for your service: 1. Run the following command to find the domain URL for your service:
```shell ```bash
kubectl get ksvc helloworld-deno --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-deno --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
helloworld-deno http://helloworld-deno.default.1.2.3.4.sslip.io helloworld-deno http://helloworld-deno.default.1.2.3.4.sslip.io
``` ```
@ -127,13 +127,13 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-deno.default.1.2.3.4.sslip.io curl http://helloworld-deno.default.1.2.3.4.sslip.io
``` ```
Example: Example:
```shell ```bash
curl http://helloworld-deno.default.1.2.3.4.sslip.io curl http://helloworld-deno.default.1.2.3.4.sslip.io
[1] "Hello R Sample v1!" [1] "Hello R Sample v1!"
``` ```
@ -144,6 +144,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -30,7 +30,7 @@ Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
1. Generate a new project. 1. Generate a new project.
```shell ```bash
mix phoenix.new helloelixir mix phoenix.new helloelixir
``` ```
@ -127,7 +127,7 @@ above.
shell of an example on `config/prod.secret.exs.sample` and you can use the shell of an example on `config/prod.secret.exs.sample` and you can use the
following command to generate a new prod secrets file. following command to generate a new prod secrets file.
```shell ```bash
SECRET_KEY_BASE=$(elixir -e ":crypto.strong_rand_bytes(48) |> Base.encode64 |> IO.puts") SECRET_KEY_BASE=$(elixir -e ":crypto.strong_rand_bytes(48) |> Base.encode64 |> IO.puts")
sed "s|SECRET+KEY+BASE|$SECRET_KEY_BASE|" config/prod.secret.exs.sample >config/prod.secret.exs sed "s|SECRET+KEY+BASE|$SECRET_KEY_BASE|" config/prod.secret.exs.sample >config/prod.secret.exs
``` ```
@ -136,7 +136,7 @@ above.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-elixir . docker build -t {username}/helloworld-elixir .
@ -149,7 +149,7 @@ above.
in `service.yaml` matches the container you built in the previous step. in `service.yaml` matches the container you built in the previous step.
Apply the configuration using `kubectl`: Apply the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -172,7 +172,7 @@ above.
1. Now you can make a request to your app to see the results. Replace 1. Now you can make a request to your app to see the results. Replace
`{IP_ADDRESS}` with the address you see returned in the previous step. `{IP_ADDRESS}` with the address you see returned in the previous step.
```shell ```bash
curl http://helloworld-elixir.default.1.2.3.4.sslip.io curl http://helloworld-elixir.default.1.2.3.4.sslip.io
... ...
@ -294,6 +294,6 @@ above.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -139,7 +139,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, enter these commands replacing `{username}` with your Docker Hub Docker Hub, enter these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-haskell . docker build -t {username}/helloworld-haskell .
@ -152,7 +152,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -174,7 +174,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-haskell.default.1.2.3.4.sslip.io curl http://helloworld-haskell.default.1.2.3.4.sslip.io
Hello world: Haskell Sample v1 Hello world: Haskell Sample v1
``` ```
@ -183,6 +183,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -219,7 +219,7 @@ your sample app to your cluster:
Docker Hub registry. You must replace the `{username}` variables in the Docker Hub registry. You must replace the `{username}` variables in the
following commands with your Docker Hub username. following commands with your Docker Hub username.
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-java-micronaut . docker build -t {username}/helloworld-java-micronaut .
@ -230,7 +230,7 @@ your sample app to your cluster:
1. Now that your container image is in the registry, you can deploy it to your 1. Now that your container image is in the registry, you can deploy it to your
Knative cluster by running the `kubectl apply` command: Knative cluster by running the `kubectl apply` command:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -253,13 +253,13 @@ To verify that your sample app has been successfully deployed:
1. Retrieve the URL for your service, by running the following `kubectl get` 1. Retrieve the URL for your service, by running the following `kubectl get`
command: command:
```shell ```bash
kubectl get ksvc helloworld-java-micronaut --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-java-micronaut --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example result: Example result:
```shell ```bash
NAME URL NAME URL
helloworld-java-micronaut http://helloworld-java-micronaut.default.1.2.3.4.sslip.io helloworld-java-micronaut http://helloworld-java-micronaut.default.1.2.3.4.sslip.io
``` ```
@ -267,13 +267,13 @@ To verify that your sample app has been successfully deployed:
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-java-micronaut.default.1.2.3.4.sslip.io curl http://helloworld-java-micronaut.default.1.2.3.4.sslip.io
``` ```
Example result: Example result:
```shell ```bash
Hello World: Micronaut Sample v1 Hello World: Micronaut Sample v1
``` ```
@ -284,6 +284,6 @@ Congratulations on deploying your sample Java app to Knative!
To remove the sample app from your cluster, run the following `kubectl delete` To remove the sample app from your cluster, run the following `kubectl delete`
command: command:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -53,7 +53,7 @@ which you update and create the necessary build and configuration files:
1. From the console, create a new empty web project using the Maven archetype 1. From the console, create a new empty web project using the Maven archetype
commands: commands:
```shell ```bash
mvn io.quarkus:quarkus-maven-plugin:0.13.3:create \ mvn io.quarkus:quarkus-maven-plugin:0.13.3:create \
-DprojectGroupId=com.redhat.developer.demos \ -DprojectGroupId=com.redhat.developer.demos \
-DprojectArtifactId=helloworld-java-quarkus \ -DprojectArtifactId=helloworld-java-quarkus \
@ -129,13 +129,13 @@ which you update and create the necessary build and configuration files:
1. Remove `src/main/resources/META-INF/resources/index.html` file since it's 1. Remove `src/main/resources/META-INF/resources/index.html` file since it's
unncessary for this example. unncessary for this example.
```shell ```bash
rm src/main/resources/META-INF/resources/index.html rm src/main/resources/META-INF/resources/index.html
``` ```
1. Remove `.dockerignore` file since it's unncessary for this example. 1. Remove `.dockerignore` file since it's unncessary for this example.
```shell ```bash
rm .dockerignore rm .dockerignore
``` ```
@ -206,7 +206,7 @@ which you update and create the necessary build and configuration files:
1. Run the application locally: 1. Run the application locally:
```shell ```bash
./mvnw compile quarkus:dev ./mvnw compile quarkus:dev
``` ```
@ -221,7 +221,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-java-quarkus . docker build -t {username}/helloworld-java-quarkus .
@ -238,7 +238,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -251,7 +251,7 @@ folder) you're ready to build and deploy the sample app.
1. To find the URL for your service, use 1. To find the URL for your service, use
```shell ```bash
kubectl get ksvc helloworld-java-quarkus kubectl get ksvc helloworld-java-quarkus
NAME URL NAME URL
@ -261,7 +261,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-java-quarkus.default.1.2.3.4.sslip.io curl http://helloworld-java-quarkus.default.1.2.3.4.sslip.io
Namaste Knative World! Namaste Knative World!
@ -271,6 +271,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -13,7 +13,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-r cd knative-docs/docs/serving/samples/hello-world/helloworld-r
``` ```
@ -135,7 +135,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-r . docker build -t {username}/helloworld-r .
@ -148,7 +148,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -161,13 +161,13 @@ folder) you're ready to build and deploy the sample app.
1. Run the following command to find the domain URL for your service: 1. Run the following command to find the domain URL for your service:
```shell ```bash
kubectl get ksvc helloworld-r --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-r --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
helloworld-r http://helloworld-r.default.1.2.3.4.sslip.io helloworld-r http://helloworld-r.default.1.2.3.4.sslip.io
``` ```
@ -175,13 +175,13 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-r.default.1.2.3.4.sslip.io curl http://helloworld-r.default.1.2.3.4.sslip.io
``` ```
Example: Example:
```shell ```bash
curl http://helloworld-r.default.1.2.3.4.sslip.io curl http://helloworld-r.default.1.2.3.4.sslip.io
[1] "Hello R Sample v1!" [1] "Hello R Sample v1!"
``` ```
@ -192,6 +192,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -14,7 +14,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-r cd knative-docs/docs/serving/samples/hello-world/helloworld-r
``` ```
@ -106,7 +106,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-rserver . docker build -t {username}/helloworld-rserver .
@ -119,7 +119,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -132,13 +132,13 @@ folder) you're ready to build and deploy the sample app.
1. Run the following command to find the domain URL for your service: 1. Run the following command to find the domain URL for your service:
```shell ```bash
kubectl get ksvc helloworld-r --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-r --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
helloworld-r http://helloworld-r.default.1.2.3.4.sslip.io helloworld-r http://helloworld-r.default.1.2.3.4.sslip.io
``` ```
@ -146,13 +146,13 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-rserver.default.1.2.3.4.sslip.io curl http://helloworld-rserver.default.1.2.3.4.sslip.io
``` ```
Example: Example:
```shell ```bash
curl http://helloworld-rserver.default.1.2.3.4.sslip.io curl http://helloworld-rserver.default.1.2.3.4.sslip.io
[1] "Hello R Sample v1!" [1] "Hello R Sample v1!"
``` ```
@ -163,6 +163,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -140,7 +140,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, enter these commands replacing `{username}` with your Docker Hub Docker Hub, enter these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-rust . docker build -t {username}/helloworld-rust .
@ -153,7 +153,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -166,7 +166,7 @@ folder) you're ready to build and deploy the sample app.
1. To find the URL for your service, enter: 1. To find the URL for your service, enter:
```shell ```bash
kubectl get ksvc helloworld-rust --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-rust --output=custom-columns=NAME:.metadata.name,URL:.status.url
NAME URL NAME URL
helloworld-rust http://helloworld-rust.default.1.2.3.4.sslip.io helloworld-rust http://helloworld-rust.default.1.2.3.4.sslip.io
@ -175,7 +175,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-rust.default.1.2.3.4.sslip.io curl http://helloworld-rust.default.1.2.3.4.sslip.io
Hello World! Hello World!
``` ```
@ -184,6 +184,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -120,7 +120,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands, replacing `{username}` with your Docker Hub Docker Hub, run these commands, replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-swift . docker build -t {username}/helloworld-swift .
@ -133,7 +133,7 @@ folder) you're ready to build and deploy the sample app.
in the `service.yaml` file matches the container you built in the previous in the `service.yaml` file matches the container you built in the previous
step. Apply the configuration using the `kubectl` command: step. Apply the configuration using the `kubectl` command:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -155,7 +155,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-swift.default.1.2.3.4.sslip.io curl http://helloworld-swift.default.1.2.3.4.sslip.io
Hello Swift Hello Swift
``` ```
@ -164,6 +164,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -187,7 +187,7 @@ your sample app to your cluster:
Docker Hub registry. You must replace the `{username}` variables in the Docker Hub registry. You must replace the `{username}` variables in the
following commands with your Docker Hub username. following commands with your Docker Hub username.
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-vertx . docker build -t {username}/helloworld-vertx .
@ -198,7 +198,7 @@ your sample app to your cluster:
1. Now that your container image is in the registry, you can deploy it to your 1. Now that your container image is in the registry, you can deploy it to your
Knative cluster by running the `kubectl apply` command: Knative cluster by running the `kubectl apply` command:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -221,13 +221,13 @@ To verify that your sample app has been successfully deployed:
1. Retrieve the URL for your service, by running the following `kubectl get` 1. Retrieve the URL for your service, by running the following `kubectl get`
command: command:
```shell ```bash
kubectl get ksvc helloworld-vertx --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-vertx --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example result: Example result:
```shell ```bash
NAME URL NAME URL
helloworld-vertx http://helloworld-vertx.default.1.2.3.4.sslip.io helloworld-vertx http://helloworld-vertx.default.1.2.3.4.sslip.io
``` ```
@ -235,13 +235,13 @@ To verify that your sample app has been successfully deployed:
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-vertx.default.1.2.3.4.sslip.io curl http://helloworld-vertx.default.1.2.3.4.sslip.io
``` ```
Example result: Example result:
```shell ```bash
Hello World: Eclipse Vert.x Sample v1 Hello World: Eclipse Vert.x Sample v1
``` ```
@ -252,6 +252,6 @@ Congratulations on deploying your sample Java app to Knative!
To remove the sample app from your cluster, run the following `kubectl delete` To remove the sample app from your cluster, run the following `kubectl delete`
command: command:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -28,7 +28,7 @@ Knative deployment guide with BentoML is also available in the
- Python 3.6 or above installed and running on your local machine. - Python 3.6 or above installed and running on your local machine.
- Install `scikit-learn` and `bentoml` packages: - Install `scikit-learn` and `bentoml` packages:
```shell ```bash
pip install scikit-learn pip install scikit-learn
pip install bentoml pip install bentoml
``` ```
@ -54,19 +54,19 @@ as API endpoint with KNative Serving.
Run the `main.py` file to train and save the model: Run the `main.py` file to train and save the model:
```shell ```bash
python main.py python main.py
``` ```
3. Use BentoML CLI to check saved model's information. 3. Use BentoML CLI to check saved model's information.
```shell ```bash
bentoml get IrisClassifier:latest bentoml get IrisClassifier:latest
``` ```
Example: Example:
```shell ```bash
> bentoml get IrisClassifier:latest > bentoml get IrisClassifier:latest
{ {
"name": "IrisClassifier", "name": "IrisClassifier",
@ -110,14 +110,14 @@ as API endpoint with KNative Serving.
4. Test run API server. BentoML can start an API server from the saved model. Use 4. Test run API server. BentoML can start an API server from the saved model. Use
BentoML CLI command to start an API server locally and test it with the `curl` command. BentoML CLI command to start an API server locally and test it with the `curl` command.
```shell ```bash
bentoml serve IrisClassifier:latest bentoml serve IrisClassifier:latest
``` ```
In another terminal window, make `curl` request with sample data to the API server In another terminal window, make `curl` request with sample data to the API server
and get prediction result: and get prediction result:
```shell ```bash
curl -v -i \ curl -v -i \
--header "Content-Type: application/json" \ --header "Content-Type: application/json" \
--request POST \ --request POST \
@ -133,7 +133,7 @@ a Dockerfile is automatically generated when saving the model.
1. To build an API model server docker image, replace `{username}` with your Docker Hub 1. To build an API model server docker image, replace `{username}` with your Docker Hub
username and run the following commands. username and run the following commands.
```shell ```bash
# jq might not be installed on your local system, please follow jq install # jq might not be installed on your local system, please follow jq install
# instruction at https://stedolan.github.io/jq/download/ # instruction at https://stedolan.github.io/jq/download/
saved_path=$(bentoml get IrisClassifier:latest -q | jq -r ".uri.uri") saved_path=$(bentoml get IrisClassifier:latest -q | jq -r ".uri.uri")
@ -150,7 +150,7 @@ a Dockerfile is automatically generated when saving the model.
{{% readfile file="service.yaml" %}} {{% readfile file="service.yaml" %}}
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -164,7 +164,7 @@ a Dockerfile is automatically generated when saving the model.
4. Run the following command to find the domain URL for your service: 4. Run the following command to find the domain URL for your service:
```shell ```bash
kubectl get ksvc iris-classifier --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc iris-classifier --output=custom-columns=NAME:.metadata.name,URL:.status.url
NAME URL NAME URL
@ -174,7 +174,7 @@ a Dockerfile is automatically generated when saving the model.
5. Replace the request URL with the URL return in the previous command, and execute the 5. Replace the request URL with the URL return in the previous command, and execute the
command to get prediction result from the deployed model API endpoint. command to get prediction result from the deployed model API endpoint.
```shell ```bash
curl -v -i \ curl -v -i \
--header "Content-Type: application/json" \ --header "Content-Type: application/json" \
--request POST \ --request POST \
@ -188,6 +188,6 @@ a Dockerfile is automatically generated when saving the model.
To remove the application from your cluster, delete the service record: To remove the application from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -36,7 +36,7 @@ The `fluent-bit-collector.yaml` file defines a StatefulSet, as well as a Kuberne
1. Apply the configuration by entering the command: 1. Apply the configuration by entering the command:
```shell ```bash
kubectl apply -f https://github.com/knative/docs/raw/main/docs/admin/install/collecting-logs/fluent-bit-collector.yaml kubectl apply -f https://github.com/knative/docs/raw/main/docs/admin/install/collecting-logs/fluent-bit-collector.yaml
``` ```
The default configuration will classify logs into: The default configuration will classify logs into:
@ -52,7 +52,7 @@ The `fluent-bit-collector.yaml` file defines a StatefulSet, as well as a Kuberne
1. To access the logs through your web browser, enter the command: 1. To access the logs through your web browser, enter the command:
```shell ```bash
kubectl port-forward --namespace logging service/log-collector 8080:80 kubectl port-forward --namespace logging service/log-collector 8080:80
``` ```
@ -60,7 +60,7 @@ The `fluent-bit-collector.yaml` file defines a StatefulSet, as well as a Kuberne
4. Optional: You can open a shell in the `nginx` pod and search the logs using Unix tools, by entering the command: 4. Optional: You can open a shell in the `nginx` pod and search the logs using Unix tools, by entering the command:
```shell ```bash
kubectl exec --namespace logging --stdin --tty --container nginx log-collector-0 kubectl exec --namespace logging --stdin --tty --container nginx log-collector-0
``` ```
@ -169,7 +169,7 @@ Minikube requires an explicit command to [mount a directory](https://minikube.si
The following command mounts the `logs` directory inside the current directory onto `/mnt/logs` in the VM: The following command mounts the `logs` directory inside the current directory onto `/mnt/logs` in the VM:
```shell ```bash
minikube mount ./logs:/mnt/logs minikube mount ./logs:/mnt/logs
``` ```

View File

@ -33,7 +33,7 @@ In the following example, you can configure a single collector instance using a
1. Create a namespace for the collector to run in, by entering the following command: 1. Create a namespace for the collector to run in, by entering the following command:
```shell ```bash
kubectl create namespace <namespace> kubectl create namespace <namespace>
``` ```
Where Where
@ -42,14 +42,14 @@ In the following example, you can configure a single collector instance using a
1. Create a Deployment, Service, and ConfigMap for the collector by entering the following command: 1. Create a Deployment, Service, and ConfigMap for the collector by entering the following command:
```shell ```bash
kubectl apply -f https://raw.githubusercontent.com/knative/docs/master/docs/install/collecting-metrics/collector.yaml kubectl apply -f https://raw.githubusercontent.com/knative/docs/master/docs/install/collecting-metrics/collector.yaml
``` ```
1. Update the `config-observability` ConfigMaps in the Knative Serving and 1. Update the `config-observability` ConfigMaps in the Knative Serving and
Eventing namespaces, by entering the follow command: Eventing namespaces, by entering the follow command:
```shell ```bash
kubectl patch --namespace knative-serving configmap/config-observability \ kubectl patch --namespace knative-serving configmap/config-observability \
--type merge \ --type merge \
--patch '{"data":{"metrics.backend-destination":"opencensus","request-metrics-backend-destination":"opencensus","metrics.opencensus-address":"otel-collector.metrics:55678"}}' --patch '{"data":{"metrics.backend-destination":"opencensus","request-metrics-backend-destination":"opencensus","metrics.opencensus-address":"otel-collector.metrics:55678"}}'
@ -62,7 +62,7 @@ In the following example, you can configure a single collector instance using a
1. You can check that metrics are being forwarded by loading the Prometheus export port on the collector, by entering the following command: 1. You can check that metrics are being forwarded by loading the Prometheus export port on the collector, by entering the following command:
```shell ```bash
kubectl port-forward --namespace metrics deployment/otel-collector 8889 kubectl port-forward --namespace metrics deployment/otel-collector 8889
``` ```
@ -77,7 +77,7 @@ aggregating timeseries metrics. It can be used to scrape the OpenTelemetry colle
1. Install the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator) by entering the following command: 1. Install the [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator) by entering the following command:
```shell ```bash
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/master/bundle.yaml kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/master/bundle.yaml
``` ```
@ -88,7 +88,7 @@ aggregating timeseries metrics. It can be used to scrape the OpenTelemetry colle
1. Create a `ServiceAccount` object with the ability to read Kubernetes services and pods, so that Prometheus can track the resource endpoints. 1. Create a `ServiceAccount` object with the ability to read Kubernetes services and pods, so that Prometheus can track the resource endpoints.
1. Apply the `prometheus.yaml` file to create a Prometheus instance, by entering the following command: 1. Apply the `prometheus.yaml` file to create a Prometheus instance, by entering the following command:
```shell ```bash
kubectl apply -f prometheus.yaml kubectl apply -f prometheus.yaml
``` ```
<!--TODO: Add links / commands for the two steps above?--> <!--TODO: Add links / commands for the two steps above?-->
@ -101,7 +101,7 @@ To access the console in your web browser:
1. Enter the command: 1. Enter the command:
```shell ```bash
kubectl port-forward --namespace metrics service/prometheus-operated 9090 kubectl port-forward --namespace metrics service/prometheus-operated 9090
``` ```

View File

@ -56,7 +56,7 @@ mesh by [manually injecting the Istio sidecars][1].
Enter the following command to install Istio: Enter the following command to install Istio:
```shell ```bash
cat << EOF > ./istio-minimal-operator.yaml cat << EOF > ./istio-minimal-operator.yaml
apiVersion: install.istio.io/v1alpha1 apiVersion: install.istio.io/v1alpha1
kind: IstioOperator kind: IstioOperator
@ -139,7 +139,7 @@ need to update gateway configmap `config-istio` under the `knative-serving` name
1. Edit the `config-istio` configmap: 1. Edit the `config-istio` configmap:
```shell ```bash
kubectl edit configmap config-istio -n knative-serving kubectl edit configmap config-istio -n knative-serving
``` ```
@ -153,7 +153,7 @@ custom-local-gateway.istio-system.svc.cluster.local
As an example, if both the custom service and deployment are labeled with `custom: custom-local-gateway`, not the default As an example, if both the custom service and deployment are labeled with `custom: custom-local-gateway`, not the default
`istio: knative-local-gateway`, you must update gateway instance `knative-local-gateway` in the `knative-serving` namespace: `istio: knative-local-gateway`, you must update gateway instance `knative-local-gateway` in the `knative-serving` namespace:
```shell ```bash
kubectl edit gateway knative-local-gateway -n knative-serving kubectl edit gateway knative-local-gateway -n knative-serving
``` ```

View File

@ -19,7 +19,7 @@ To configure a Knative Service so that it is only available on the cluster-local
- To label a Knative Service: - To label a Knative Service:
```shell ```bash
kubectl label kservice ${KSVC_NAME} networking.knative.dev/visibility=cluster-local kubectl label kservice ${KSVC_NAME} networking.knative.dev/visibility=cluster-local
``` ```
@ -28,13 +28,13 @@ To configure a Knative Service so that it is only available on the cluster-local
- To label a Route when the Route is used directly without a Knative Service: - To label a Route when the Route is used directly without a Knative Service:
```shell ```bash
kubectl label route ${ROUTE_NAME} networking.knative.dev/visibility=cluster-local kubectl label route ${ROUTE_NAME} networking.knative.dev/visibility=cluster-local
``` ```
- To label a Kubernetes Service: - To label a Kubernetes Service:
```shell ```bash
kubectl label service ${SERVICE_NAME} networking.knative.dev/visibility=cluster-local kubectl label service ${SERVICE_NAME} networking.knative.dev/visibility=cluster-local
``` ```
@ -42,14 +42,14 @@ To configure a Knative Service so that it is only available on the cluster-local
You can deploy the [Hello World sample](../../../../serving/samples/hello-world/helloworld-go/) and then convert it to be an cluster-local Service by labelling the Service: You can deploy the [Hello World sample](../../../../serving/samples/hello-world/helloworld-go/) and then convert it to be an cluster-local Service by labelling the Service:
```shell ```bash
kubectl label kservice helloworld-go networking.knative.dev/visibility=cluster-local kubectl label kservice helloworld-go networking.knative.dev/visibility=cluster-local
``` ```
You can then verify that the change has been made by verifying the URL for the You can then verify that the change has been made by verifying the URL for the
`helloworld-go` Service: `helloworld-go` Service:
```shell ```bash
kubectl get kservice helloworld-go kubectl get kservice helloworld-go
NAME URL LATESTCREATED LATESTREADY READY REASON NAME URL LATESTCREATED LATESTREADY READY REASON

View File

@ -26,7 +26,7 @@ ERROR: Non-zero return code '1' from command: Process exited with status 1
Run the following command to get the `status` of the `Route` object with which Run the following command to get the `status` of the `Route` object with which
you deployed your application: you deployed your application:
```shell ```bash
kubectl get route <route-name> --output yaml kubectl get route <route-name> --output yaml
``` ```
@ -38,7 +38,7 @@ details, see Knative
To list all Ingress resources and their corresponding labels, run the following command: To list all Ingress resources and their corresponding labels, run the following command:
```shell ```bash
kubectl get ingresses.networking.internal.knative.dev -o=custom-columns='NAME:.metadata.name,LABELS:.metadata.labels' kubectl get ingresses.networking.internal.knative.dev -o=custom-columns='NAME:.metadata.name,LABELS:.metadata.labels'
NAME LABELS NAME LABELS
helloworld-go map[serving.knative.dev/route:helloworld-go serving.knative.dev/routeNamespace:default serving.knative.dev/service:helloworld-go] helloworld-go map[serving.knative.dev/route:helloworld-go serving.knative.dev/routeNamespace:default serving.knative.dev/service:helloworld-go]
@ -64,7 +64,7 @@ Otherwise, there will be error messages.
Now, if Ingress shows status `Ready`, there must be a corresponding Now, if Ingress shows status `Ready`, there must be a corresponding
VirtualService. Run the following command: VirtualService. Run the following command:
```shell ```bash
kubectl get virtualservice -l networking.internal.knative.dev/ingress=<INGRESS_NAME> -n <INGRESS_NAMESPACE> --output yaml kubectl get virtualservice -l networking.internal.knative.dev/ingress=<INGRESS_NAME> -n <INGRESS_NAMESPACE> --output yaml
``` ```
@ -83,13 +83,13 @@ Knative uses a LoadBalancer service called `istio-ingressgateway` Service.
To check the IP address of your Ingress, use To check the IP address of your Ingress, use
```shell ```bash
kubectl get svc -n istio-system istio-ingressgateway kubectl get svc -n istio-system istio-ingressgateway
``` ```
If there is no external IP address, use If there is no external IP address, use
```shell ```bash
kubectl describe svc istio-ingressgateway -n istio-system kubectl describe svc istio-ingressgateway -n istio-system
``` ```
@ -102,7 +102,7 @@ If you configure your `Route` with `Configuration`, run the following command to
get the name of the `Revision` created for you deployment (look up the get the name of the `Revision` created for you deployment (look up the
configuration name in the `Route` .yaml file): configuration name in the `Route` .yaml file):
```shell ```bash
kubectl get configuration <configuration-name> --output jsonpath="{.status.latestCreatedRevisionName}" kubectl get configuration <configuration-name> --output jsonpath="{.status.latestCreatedRevisionName}"
``` ```
@ -111,7 +111,7 @@ name in the `Route` yaml file.
Then run the following command: Then run the following command:
```shell ```bash
kubectl get revision <revision-name> --output yaml kubectl get revision <revision-name> --output yaml
``` ```
@ -138,7 +138,7 @@ Note: some of them are not implemented yet. An alternative is to
To get the `Pod`s for all your deployments: To get the `Pod`s for all your deployments:
```shell ```bash
kubectl get pods kubectl get pods
``` ```
@ -153,7 +153,7 @@ configuration-example-00002-deployment-5f475b7849-gxcht 1/2 CrashLoopBac
Choose one and use the following command to see detailed information for its Choose one and use the following command to see detailed information for its
`status`. Some useful fields are `conditions` and `containerStatuses`: `status`. Some useful fields are `conditions` and `containerStatuses`:
```shell ```bash
kubectl get pod <pod-name> --output yaml kubectl get pod <pod-name> --output yaml
``` ```

View File

@ -72,7 +72,7 @@ You can configure your `config-tracing` with following options:
### Viewing your `config-tracing` ConfigMap ### Viewing your `config-tracing` ConfigMap
To view your current configuration: To view your current configuration:
```shell ```bash
kubectl -n knative-eventing get configmap config-tracing -oyaml kubectl -n knative-eventing get configmap config-tracing -oyaml
``` ```
@ -80,7 +80,7 @@ kubectl -n knative-eventing get configmap config-tracing -oyaml
To edit and then immediately deploy changes to your ConfigMap, run the following command: To edit and then immediately deploy changes to your ConfigMap, run the following command:
```shell ```bash
kubectl -n knative-eventing edit configmap config-tracing kubectl -n knative-eventing edit configmap config-tracing
``` ```

View File

@ -121,7 +121,7 @@ When a broker is created without a specified `BrokerClass` annotation, the defau
The following example creates a broker called `default` in the default namespace, and uses `MTChannelBasedBroker` as the implementation: The following example creates a broker called `default` in the default namespace, and uses `MTChannelBasedBroker` as the implementation:
```shell ```bash
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Broker kind: Broker

View File

@ -16,7 +16,7 @@ You can create a broker by using the `kn` CLI or by applying YAML files using `k
1. You can create a broker in current namespace by entering the following command: 1. You can create a broker in current namespace by entering the following command:
```shell ```bash
kn broker create <broker-name> -n <namespace> kn broker create <broker-name> -n <namespace>
``` ```
@ -24,13 +24,13 @@ You can create a broker by using the `kn` CLI or by applying YAML files using `k
1. Optional: Verify that the broker was created by listing existing brokers. Enter the following command: 1. Optional: Verify that the broker was created by listing existing brokers. Enter the following command:
```shell ```bash
kn broker list kn broker list
``` ```
1. Optional: You can also verify the broker exists by describing the broker you have created. Enter the following command: 1. Optional: You can also verify the broker exists by describing the broker you have created. Enter the following command:
```shell ```bash
kn broker describe <broker-name> kn broker describe <broker-name>
``` ```
@ -52,13 +52,13 @@ You can create a broker by using the `kn` CLI or by applying YAML files using `k
1. Optional: Verify that the broker is working correctly, by entering the following command: 1. Optional: Verify that the broker is working correctly, by entering the following command:
```shell ```bash
kubectl -n <namespace> get broker <broker-name> kubectl -n <namespace> get broker <broker-name>
``` ```
This shows information about your broker. If the broker is working correctly, it shows a `READY` status of `True`: This shows information about your broker. If the broker is working correctly, it shows a `READY` status of `True`:
```shell ```bash
NAME READY REASON URL AGE NAME READY REASON URL AGE
default True http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default 1m default True http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default 1m
``` ```

View File

@ -39,7 +39,7 @@ Channels; `numPartitions` and `replicationFactor`.
To create a Broker that uses the KafkaChannel, specify the `kafka-channel` ConfigMap: To create a Broker that uses the KafkaChannel, specify the `kafka-channel` ConfigMap:
```shell ```bash
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Broker kind: Broker

View File

@ -16,7 +16,7 @@ The `subscriber` value must be a [Destination](https://pkg.go.dev/knative.dev/pk
Simple example which will receive all the events from the given (`default`) broker and Simple example which will receive all the events from the given (`default`) broker and
deliver them to Knative Serving service `my-service`: deliver them to Knative Serving service `my-service`:
```shell ```bash
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Trigger kind: Trigger
@ -35,7 +35,7 @@ EOF
Simple example which will receive all the events from the given (`default`) broker and Simple example which will receive all the events from the given (`default`) broker and
deliver them to the custom path `/my-custom-path` for the Kubernetes service `my-service`: deliver them to the custom path `/my-custom-path` for the Kubernetes service `my-service`:
```shell ```bash
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Trigger kind: Trigger
@ -65,7 +65,7 @@ This example filters events from the `default` broker that are of type
`dev.knative.foo.bar` and have the extension `myextension` with the value `dev.knative.foo.bar` and have the extension `myextension` with the value
`my-extension-value`. `my-extension-value`.
```shell ```bash
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Trigger kind: Trigger

View File

@ -14,7 +14,7 @@ procedure:
1. Update the information in [`channels.yaml`](channels.yaml). 1. Update the information in [`channels.yaml`](channels.yaml).
2. Run the generator tool: 2. Run the generator tool:
```shell ```bash
go run eventing/channels/generator/main.go go run eventing/channels/generator/main.go
``` ```
--> -->

View File

@ -17,7 +17,7 @@ procedure:
1. Update the information in [`channels.yaml`](channels.yaml). 1. Update the information in [`channels.yaml`](channels.yaml).
2. Run the generator tool: 2. Run the generator tool:
```shell ```bash
go run eventing/channels/generator/main.go go run eventing/channels/generator/main.go
``` ```
--> -->

View File

@ -30,7 +30,7 @@ function.
See [example.yaml](example.yaml) for the entire YAML. For any commands in this See [example.yaml](example.yaml) for the entire YAML. For any commands in this
guide to work, you must apply [example.yaml](example.yaml): guide to work, you must apply [example.yaml](example.yaml):
```shell ```bash
kubectl apply --filename example.yaml kubectl apply --filename example.yaml
``` ```
@ -41,7 +41,7 @@ Knative events will occur whenever a Kubernetes
occurs in the `knative-debug` namespace. We can cause this to occur with the occurs in the `knative-debug` namespace. We can cause this to occur with the
following commands: following commands:
```shell ```bash
kubectl --namespace knative-debug run to-be-deleted --image=image-that-doesnt-exist --restart=Never kubectl --namespace knative-debug run to-be-deleted --image=image-that-doesnt-exist --restart=Never
# 5 seconds is arbitrary. We want K8s to notice that the Pod needs to be scheduled and generate at least one event. # 5 seconds is arbitrary. We want K8s to notice that the Pod needs to be scheduled and generate at least one event.
sleep 5 sleep 5
@ -51,13 +51,13 @@ kubectl --namespace knative-debug delete pod to-be-deleted
Then we can see the Kubernetes `Event`s (note that these are not Knative Then we can see the Kubernetes `Event`s (note that these are not Knative
events!): events!):
```shell ```bash
kubectl --namespace knative-debug get events kubectl --namespace knative-debug get events
``` ```
This should produce output along the lines of: This should produce output along the lines of:
```shell ```bash
LAST SEEN FIRST SEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE LAST SEEN FIRST SEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAGE
20s 20s 1 to-be-deleted.157aadb9f376fc4e Pod Normal Scheduled default-scheduler Successfully assigned knative-debug/to-be-deleted to gke-kn24-default-pool-c12ac83b-pjf2 20s 20s 1 to-be-deleted.157aadb9f376fc4e Pod Normal Scheduled default-scheduler Successfully assigned knative-debug/to-be-deleted to gke-kn24-default-pool-c12ac83b-pjf2
``` ```
@ -66,7 +66,7 @@ LAST SEEN FIRST SEEN COUNT NAME KIND SU
You've applied [example.yaml](example.yaml) and you are inspecting `fn`'s logs: You've applied [example.yaml](example.yaml) and you are inspecting `fn`'s logs:
```shell ```bash
kubectl --namespace knative-debug logs -l app=fn -c user-container kubectl --namespace knative-debug logs -l app=fn -c user-container
``` ```
@ -93,14 +93,14 @@ We will attempt to determine why from the most basic pieces out:
##### `fn` ##### `fn`
```shell ```bash
kubectl --namespace knative-debug get deployment fn -o jsonpath='{.status.availableReplicas}' kubectl --namespace knative-debug get deployment fn -o jsonpath='{.status.availableReplicas}'
``` ```
We want to see `1`. If you don't, then you need to debug the `Deployment`. Is We want to see `1`. If you don't, then you need to debug the `Deployment`. Is
there anything obviously wrong mentioned in the `status`? there anything obviously wrong mentioned in the `status`?
```shell ```bash
kubectl --namespace knative-debug get deployment fn --output yaml kubectl --namespace knative-debug get deployment fn --output yaml
``` ```
@ -109,7 +109,7 @@ which is out of scope of this document.
Verify that the `Pod` is `Ready`: Verify that the `Pod` is `Ready`:
```shell ```bash
kubectl --namespace knative-debug get pod -l app=fn -o jsonpath='{.items[*].status.conditions[?(@.type == "Ready")].status}' kubectl --namespace knative-debug get pod -l app=fn -o jsonpath='{.items[*].status.conditions[?(@.type == "Ready")].status}'
``` ```
@ -120,7 +120,7 @@ guide.
##### `svc` ##### `svc`
```shell ```bash
kubectl --namespace knative-debug get service svc kubectl --namespace knative-debug get service svc
``` ```
@ -129,7 +129,7 @@ exist, then you probably need to re-apply [example.yaml](example.yaml).
Verify it points at the expected pod. Verify it points at the expected pod.
```shell ```bash
{% raw %} {% raw %}
svcLabels=$(kubectl --namespace knative-debug get service svc -o go-template='{{range $k, $v := .spec.selector}}{{ $k }}={{ $v }},{{ end }}' | sed 's/.$//' ) svcLabels=$(kubectl --namespace knative-debug get service svc -o go-template='{{range $k, $v := .spec.selector}}{{ $k }}={{ $v }},{{ end }}' | sed 's/.$//' )
kubectl --namespace knative-debug get pods -l $svcLabels kubectl --namespace knative-debug get pods -l $svcLabels
@ -146,13 +146,13 @@ This should return a single Pod, which if you inspect is the one generated by
This is a very basic channel and has few This is a very basic channel and has few
failure modes that will be exhibited in `chan`'s `status`. failure modes that will be exhibited in `chan`'s `status`.
```shell ```bash
kubectl --namespace knative-debug get channel.messaging.knative.dev chan -o jsonpath='{.status.conditions[?(@.type == "Ready")].status}' kubectl --namespace knative-debug get channel.messaging.knative.dev chan -o jsonpath='{.status.conditions[?(@.type == "Ready")].status}'
``` ```
This should return `True`. If it doesn't, get the full resource: This should return `True`. If it doesn't, get the full resource:
```shell ```bash
kubectl --namespace knative-debug get channel.messaging.knative.dev chan --output yaml kubectl --namespace knative-debug get channel.messaging.knative.dev chan --output yaml
``` ```
@ -161,7 +161,7 @@ If `status` is completely missing, it implies that something is wrong with the
Next verify that `chan` is addressable: Next verify that `chan` is addressable:
```shell ```bash
kubectl --namespace knative-debug get channel.messaging.knative.dev chan -o jsonpath='{.status.address.hostname}' kubectl --namespace knative-debug get channel.messaging.knative.dev chan -o jsonpath='{.status.address.hostname}'
``` ```
@ -176,7 +176,7 @@ We will verify that the two resources that the `chan` creates exist and are
`chan` creates a K8s `Service`. `chan` creates a K8s `Service`.
```shell ```bash
kubectl --namespace knative-debug get service -l messaging.knative.dev/role=in-memory-channel kubectl --namespace knative-debug get service -l messaging.knative.dev/role=in-memory-channel
``` ```
@ -191,7 +191,7 @@ something went wrong during `chan` reconciliation. See
First we will verify that `src` is writing to `chan`. First we will verify that `src` is writing to `chan`.
```shell ```bash
kubectl --namespace knative-debug get apiserversource src -o jsonpath='{.spec.sink}' kubectl --namespace knative-debug get apiserversource src -o jsonpath='{.spec.sink}'
``` ```
@ -203,7 +203,7 @@ Fixing should be as simple as updating its `spec` to have the correct `sink`
Now that we know `src` is sending to `chan`, let's verify that it is `Ready`. Now that we know `src` is sending to `chan`, let's verify that it is `Ready`.
```shell ```bash
kubectl --namespace knative-debug get apiserversource src -o jsonpath='{.status.conditions[?(.type == "Ready")].status}' kubectl --namespace knative-debug get apiserversource src -o jsonpath='{.status.conditions[?(.type == "Ready")].status}'
``` ```
@ -213,13 +213,13 @@ kubectl --namespace knative-debug get apiserversource src -o jsonpath='{.status.
Verify that `sub` is `Ready`: Verify that `sub` is `Ready`:
```shell ```bash
kubectl --namespace knative-debug get subscription sub -o jsonpath='{.status.conditions[?(.type == "Ready")].status}' kubectl --namespace knative-debug get subscription sub -o jsonpath='{.status.conditions[?(.type == "Ready")].status}'
``` ```
This should return `True`. If it doesn't then, look at all the status entries. This should return `True`. If it doesn't then, look at all the status entries.
```shell ```bash
kubectl --namespace knative-debug get subscription sub --output yaml kubectl --namespace knative-debug get subscription sub --output yaml
``` ```
@ -245,13 +245,13 @@ There is not a single `Channel` Controller. Instead, there is one
Controller for each Channel CRD. `chan` uses the Controller for each Channel CRD. `chan` uses the
`InMemoryChannel` `Channel CRD`, whose Controller is: `InMemoryChannel` `Channel CRD`, whose Controller is:
```shell ```bash
kubectl --namespace knative-eventing get pod -l messaging.knative.dev/channel=in-memory-channel,messaging.knative.dev/role=controller --output yaml kubectl --namespace knative-eventing get pod -l messaging.knative.dev/channel=in-memory-channel,messaging.knative.dev/role=controller --output yaml
``` ```
See its logs with: See its logs with:
```shell ```bash
kubectl --namespace knative-eventing logs -l messaging.knative.dev/channel=in-memory-channel,messaging.knative.dev/role=controller kubectl --namespace knative-eventing logs -l messaging.knative.dev/channel=in-memory-channel,messaging.knative.dev/role=controller
``` ```
@ -263,7 +263,7 @@ Pay particular attention to any lines that have a logging level of `warning` or
Each Source will have its own Controller. `src` is a `ApiServerSource`, so Each Source will have its own Controller. `src` is a `ApiServerSource`, so
its Controller is: its Controller is:
```shell ```bash
kubectl --namespace knative-eventing get pod -l app=sources-controller kubectl --namespace knative-eventing get pod -l app=sources-controller
``` ```
@ -275,13 +275,13 @@ importantly including [ApiServerSource Controller](#apiserversource-controller).
The `ApiServerSource` Controller is run in the same binary as some other Source The `ApiServerSource` Controller is run in the same binary as some other Source
Controllers from Eventing. It is: Controllers from Eventing. It is:
```shell ```bash
kubectl --namespace knative-debug get pod -l eventing.knative.dev/sourceName=src,eventing.knative.dev/source=apiserver-source-controller kubectl --namespace knative-debug get pod -l eventing.knative.dev/sourceName=src,eventing.knative.dev/source=apiserver-source-controller
``` ```
View its logs with: View its logs with:
```shell ```bash
kubectl --namespace knative-debug logs -l eventing.knative.dev/sourceName=src,eventing.knative.dev/source=apiserver-source-controller kubectl --namespace knative-debug logs -l eventing.knative.dev/sourceName=src,eventing.knative.dev/source=apiserver-source-controller
``` ```
@ -294,13 +294,13 @@ The `Subscription` Controller controls `sub`. It attempts to resolve the
addresses that a `Channel` should send events to, and once resolved, inject addresses that a `Channel` should send events to, and once resolved, inject
those into the `Channel`'s `spec.subscribable`. those into the `Channel`'s `spec.subscribable`.
```shell ```bash
kubectl --namespace knative-eventing get pod -l app=eventing-controller kubectl --namespace knative-eventing get pod -l app=eventing-controller
``` ```
View its logs with: View its logs with:
```shell ```bash
kubectl --namespace knative-eventing logs -l app=eventing-controller kubectl --namespace knative-eventing logs -l app=eventing-controller
``` ```
@ -342,13 +342,13 @@ binary that handles both the receiving and dispatching sides for all
First we will inspect the Dispatcher's logs to see if it is anything obvious: First we will inspect the Dispatcher's logs to see if it is anything obvious:
```shell ```bash
kubectl --namespace knative-eventing logs -l messaging.knative.dev/channel=in-memory-channel,messaging.knative.dev/role=dispatcher -c dispatcher kubectl --namespace knative-eventing logs -l messaging.knative.dev/channel=in-memory-channel,messaging.knative.dev/role=dispatcher -c dispatcher
``` ```
Ideally we will see lines like: Ideally we will see lines like:
```shell ```bash
{"level":"info","ts":"2019-08-16T13:50:55.424Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:147","msg":"Request mapped to channel: knative-debug/chan-kn-channel","knative.dev/controller":"in-memory-channel-dispatcher"} {"level":"info","ts":"2019-08-16T13:50:55.424Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:147","msg":"Request mapped to channel: knative-debug/chan-kn-channel","knative.dev/controller":"in-memory-channel-dispatcher"}
{"level":"info","ts":"2019-08-16T13:50:55.425Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_dispatcher.go:112","msg":"Dispatching message to http://svc.knative-debug.svc.cluster.local/","knative.dev/controller":"in-memory-channel-dispatcher"} {"level":"info","ts":"2019-08-16T13:50:55.425Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_dispatcher.go:112","msg":"Dispatching message to http://svc.knative-debug.svc.cluster.local/","knative.dev/controller":"in-memory-channel-dispatcher"}
{"level":"info","ts":"2019-08-16T13:50:55.981Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:140","msg":"Received request for chan-kn-channel.knative-debug.svc.cluster.local","knative.dev/controller":"in-memory-channel-dispatcher"} {"level":"info","ts":"2019-08-16T13:50:55.981Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:140","msg":"Received request for chan-kn-channel.knative-debug.svc.cluster.local","knative.dev/controller":"in-memory-channel-dispatcher"}
@ -363,7 +363,7 @@ However if we see something like:
NOTE: This error has been produced by settings spec.ports[0].port to 8081 NOTE: This error has been produced by settings spec.ports[0].port to 8081
kubectl patch -n knative-debug svc svc -p '{"spec":{"ports": [{"port": 8081, "targetPort":8080}]}}' --type='merge' kubectl patch -n knative-debug svc svc -p '{"spec":{"ports": [{"port": 8081, "targetPort":8080}]}}' --type='merge'
--> -->
```shell ```bash
{"level":"info","ts":"2019-08-16T16:10:16.859Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:140","msg":"Received request for chan-kn-channel.knative-debug.svc.cluster.local","knative.dev/controller":"in-memory-channel-dispatcher"} {"level":"info","ts":"2019-08-16T16:10:16.859Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:140","msg":"Received request for chan-kn-channel.knative-debug.svc.cluster.local","knative.dev/controller":"in-memory-channel-dispatcher"}
{"level":"info","ts":"2019-08-16T16:10:16.859Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:147","msg":"Request mapped to channel: knative-debug/chan-kn-channel","knative.dev/controller":"in-memory-channel-dispatcher"} {"level":"info","ts":"2019-08-16T16:10:16.859Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_receiver.go:147","msg":"Request mapped to channel: knative-debug/chan-kn-channel","knative.dev/controller":"in-memory-channel-dispatcher"}
{"level":"info","ts":"2019-08-16T16:10:16.859Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_dispatcher.go:112","msg":"Dispatching message to http://svc.knative-debug.svc.cluster.local/","knative.dev/controller":"in-memory-channel-dispatcher"} {"level":"info","ts":"2019-08-16T16:10:16.859Z","logger":"inmemorychannel-dispatcher.in-memory-channel-dispatcher","caller":"provisioners/message_dispatcher.go:112","msg":"Dispatching message to http://svc.knative-debug.svc.cluster.local/","knative.dev/controller":"in-memory-channel-dispatcher"}

View File

@ -79,7 +79,7 @@ spec:
``` ```
```shell ```bash
kubectl -n default create -f ./steps.yaml kubectl -n default create -f ./steps.yaml
``` ```
@ -121,7 +121,7 @@ spec:
Change `default` below to create the `Sequence` in the Namespace where you want Change `default` below to create the `Sequence` in the Namespace where you want
the resources to be created. the resources to be created.
```shell ```bash
kubectl -n default create -f ./sequence.yaml kubectl -n default create -f ./sequence.yaml
``` ```
@ -142,7 +142,7 @@ spec:
Change `default` below to create the `Sequence` in the Namespace where you want Change `default` below to create the `Sequence` in the Namespace where you want
your resources to be created. your resources to be created.
```shell ```bash
kubectl -n default create -f ./event-display.yaml kubectl -n default create -f ./event-display.yaml
``` ```
@ -167,7 +167,7 @@ spec:
name: sequence name: sequence
``` ```
```shell ```bash
kubectl -n default create -f ./ping-source.yaml kubectl -n default create -f ./ping-source.yaml
``` ```
@ -176,13 +176,13 @@ kubectl -n default create -f ./ping-source.yaml
You can now see the final output by inspecting the logs of the event-display You can now see the final output by inspecting the logs of the event-display
pods. pods.
```shell ```bash
kubectl -n default get pods kubectl -n default get pods
``` ```
Wait a bit and then look at the logs for the event-display pod: Wait a bit and then look at the logs for the event-display pod:
```shell ```bash
kubectl -n default logs -l serving.knative.dev/service=event-display -c user-container --tail=-1 kubectl -n default logs -l serving.knative.dev/service=event-display -c user-container --tail=-1
☁️ cloudevents.Event ☁️ cloudevents.Event
Validation: valid Validation: valid

View File

@ -120,7 +120,7 @@ spec:
``` ```
```shell ```bash
kubectl -n default create -f ./steps.yaml kubectl -n default create -f ./steps.yaml
``` ```
@ -162,7 +162,7 @@ spec:
Change `default` below to create the `Sequence` in the Namespace where you want Change `default` below to create the `Sequence` in the Namespace where you want
your resources created. your resources created.
```shell ```bash
kubectl -n default create -f ./sequence1.yaml kubectl -n default create -f ./sequence1.yaml
``` ```
@ -201,7 +201,7 @@ spec:
name: event-display name: event-display
``` ```
```shell ```bash
kubectl -n default create -f ./sequence2.yaml kubectl -n default create -f ./sequence2.yaml
``` ```
@ -222,7 +222,7 @@ spec:
Change `default` below to create the `Sequence` in the Namespace where you want Change `default` below to create the `Sequence` in the Namespace where you want
your resources created. your resources created.
```shell ```bash
kubectl -n default create -f ./event-display.yaml kubectl -n default create -f ./event-display.yaml
``` ```
@ -247,7 +247,7 @@ spec:
name: first-sequence name: first-sequence
``` ```
```shell ```bash
kubectl -n default create -f ./ping-source.yaml kubectl -n default create -f ./ping-source.yaml
``` ```
@ -256,13 +256,13 @@ kubectl -n default create -f ./ping-source.yaml
You can now see the final output by inspecting the logs of the event-display You can now see the final output by inspecting the logs of the event-display
pods. pods.
```shell ```bash
kubectl -n default get pods kubectl -n default get pods
``` ```
Then look at the logs for the event-display pod: Then look at the logs for the event-display pod:
```shell ```bash
kubectl -n default logs -l serving.knative.dev/service=event-display -c user-container --tail=-1 kubectl -n default logs -l serving.knative.dev/service=event-display -c user-container --tail=-1
☁️ cloudevents.Event ☁️ cloudevents.Event
Validation: valid Validation: valid

View File

@ -79,7 +79,7 @@ spec:
``` ```
```shell ```bash
kubectl -n default create -f ./steps.yaml kubectl -n default create -f ./steps.yaml
``` ```
@ -119,7 +119,7 @@ the resources to be created.
Here, if you are using different type of Channel, you need to change the Here, if you are using different type of Channel, you need to change the
spec.channelTemplate to point to your desired Channel. spec.channelTemplate to point to your desired Channel.
```shell ```bash
kubectl -n default create -f ./sequence.yaml kubectl -n default create -f ./sequence.yaml
``` ```
@ -144,7 +144,7 @@ spec:
name: sequence name: sequence
``` ```
```shell ```bash
kubectl -n default create -f ./ping-source.yaml kubectl -n default create -f ./ping-source.yaml
``` ```
@ -154,13 +154,13 @@ You can now see the final output by inspecting the logs of the event-display
pods. Note that since we set the `PingSource` to emit every 2 minutes, it might pods. Note that since we set the `PingSource` to emit every 2 minutes, it might
take some time for the events to show up in the logs. take some time for the events to show up in the logs.
```shell ```bash
kubectl -n default get pods kubectl -n default get pods
``` ```
Let's look at the logs for the first `Step` in the `Sequence`: Let's look at the logs for the first `Step` in the `Sequence`:
```shell ```bash
kubectl -n default logs -l serving.knative.dev/service=first -c user-container --tail=-1 kubectl -n default logs -l serving.knative.dev/service=first -c user-container --tail=-1
2020/03/02 21:28:00 listening on 8080, appending " - Handled by 0" to events 2020/03/02 21:28:00 listening on 8080, appending " - Handled by 0" to events
@ -175,7 +175,7 @@ Exciting :)
Then we can look at the output of the second Step in the `Sequence`: Then we can look at the output of the second Step in the `Sequence`:
```shell ```bash
kubectl -n default logs -l serving.knative.dev/service=second -c user-container --tail=-1 kubectl -n default logs -l serving.knative.dev/service=second -c user-container --tail=-1
2020/03/02 21:28:02 listening on 8080, appending " - Handled by 1" to events 2020/03/02 21:28:02 listening on 8080, appending " - Handled by 1" to events
@ -189,7 +189,7 @@ reflected by the Message being now: "Hello world! - Handled by 0 - Handled by 1"
Then we can look at the output of the last Step in the `Sequence`: Then we can look at the output of the last Step in the `Sequence`:
```shell ```bash
kubectl -n default logs -l serving.knative.dev/service=third -c user-container --tail=-1 kubectl -n default logs -l serving.knative.dev/service=third -c user-container --tail=-1
2020/03/02 21:28:03 listening on 8080, appending " - Handled by 2" to events 2020/03/02 21:28:03 listening on 8080, appending " - Handled by 2" to events

View File

@ -36,7 +36,7 @@ The functions used in these examples live in
To create the cluster default Broker type: To create the cluster default Broker type:
```shell ```bash
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Broker kind: Broker
@ -96,7 +96,7 @@ spec:
Change the `default` namespace below to create the services in the namespace where you have Change the `default` namespace below to create the services in the namespace where you have
configured your broker. configured your broker.
```shell ```bash
kubectl -n default create -f ./steps.yaml kubectl -n default create -f ./steps.yaml
``` ```
@ -140,7 +140,7 @@ spec:
Change the `default` namespace below to create the sequence in the namespace where you have Change the `default` namespace below to create the sequence in the namespace where you have
configured your broker. configured your broker.
```shell ```bash
kubectl -n default create -f ./sequence.yaml kubectl -n default create -f ./sequence.yaml
``` ```
@ -168,7 +168,7 @@ spec:
Change the `default` namespace below to create the PingSource in the namespace where you have Change the `default` namespace below to create the PingSource in the namespace where you have
configured your broker and sequence. configured your broker and sequence.
```shell ```bash
kubectl -n default create -f ./ping-source.yaml kubectl -n default create -f ./ping-source.yaml
``` ```
@ -194,7 +194,7 @@ spec:
Change the `default` namespace below to create the trigger in the namespace where you have Change the `default` namespace below to create the trigger in the namespace where you have
configured your broker and sequence. configured your broker and sequence.
```shell ```bash
kubectl -n default create -f ./trigger.yaml kubectl -n default create -f ./trigger.yaml
``` ```
@ -233,7 +233,7 @@ spec:
Change `default` namespace below to create the service and trigger in the namespace Change `default` namespace below to create the service and trigger in the namespace
where you have configured your broker. where you have configured your broker.
```shell ```bash
kubectl -n default create -f ./display-trigger.yaml kubectl -n default create -f ./display-trigger.yaml
``` ```
@ -242,13 +242,13 @@ kubectl -n default create -f ./display-trigger.yaml
You can now see the final output by inspecting the logs of the sequence-display You can now see the final output by inspecting the logs of the sequence-display
pods. pods.
```shell ```bash
kubectl -n default get pods kubectl -n default get pods
``` ```
View the logs for the `sequence-display` pod: View the logs for the `sequence-display` pod:
```shell ```bash
kubectl -n default logs -l serving.knative.dev/service=sequence-display -c user-container --tail=-1 kubectl -n default logs -l serving.knative.dev/service=sequence-display -c user-container --tail=-1
☁️ cloudevents.Event ☁️ cloudevents.Event
Validation: valid Validation: valid

View File

@ -20,7 +20,7 @@ Namespaces are used to group together and organize your Knative resources.
Create a new namespace called `event-example` by entering the following command: Create a new namespace called `event-example` by entering the following command:
``` ```bash
kubectl create namespace event-example kubectl create namespace event-example
``` ```
@ -30,7 +30,7 @@ The [broker](../broker) allows you to route events to different event sinks or c
1. Add a broker named `default` to your namespace by entering the following command: 1. Add a broker named `default` to your namespace by entering the following command:
``` ```yaml
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: broker kind: broker
@ -42,13 +42,13 @@ The [broker](../broker) allows you to route events to different event sinks or c
1. Verify that the broker is working correctly, by entering the following command: 1. Verify that the broker is working correctly, by entering the following command:
``` ```bash
kubectl -n event-example get broker default kubectl -n event-example get broker default
``` ```
This shows information about your broker. If the broker is working correctly, it shows a `READY` status of `True`: This shows information about your broker. If the broker is working correctly, it shows a `READY` status of `True`:
``` ```{ .bash .no-copy }
NAME READY REASON URL AGE NAME READY REASON URL AGE
default True http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default 1m default True http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default 1m
``` ```
@ -64,7 +64,7 @@ demonstrate how you can configure your event producers to target a specific cons
1. To deploy the `hello-display` consumer to your cluster, run the following 1. To deploy the `hello-display` consumer to your cluster, run the following
command: command:
``` ```yaml
kubectl -n event-example apply -f - << EOF kubectl -n event-example apply -f - << EOF
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -102,7 +102,7 @@ demonstrate how you can configure your event producers to target a specific cons
1. To deploy the `goodbye-display` consumer to your cluster, run the following 1. To deploy the `goodbye-display` consumer to your cluster, run the following
command: command:
``` ```yaml
kubectl -n event-example apply -f - << EOF kubectl -n event-example apply -f - << EOF
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -139,12 +139,12 @@ demonstrate how you can configure your event producers to target a specific cons
``` ```
1. Verify that the event consumers are working by entering the following command: 1. Verify that the event consumers are working by entering the following command:
``` ```bash
kubectl -n event-example get deployments hello-display goodbye-display kubectl -n event-example get deployments hello-display goodbye-display
``` ```
This lists the `hello-display` and `goodbye-display` consumers that you This lists the `hello-display` and `goodbye-display` consumers that you
deployed: deployed:
``` ```{ .bash .no-copy }
NAME READY UP-TO-DATE AVAILABLE AGE NAME READY UP-TO-DATE AVAILABLE AGE
hello-display 1/1 1 1 26s hello-display 1/1 1 1 26s
goodbye-display 1/1 1 1 16s goodbye-display 1/1 1 1 16s
@ -159,7 +159,7 @@ Brokers use triggers to forward events to the correct consumers.
Each trigger can specify a filter that enables selection of relevant events based on the Cloud Event context attributes. Each trigger can specify a filter that enables selection of relevant events based on the Cloud Event context attributes.
1. Create a trigger by entering the following command: 1. Create a trigger by entering the following command:
``` ```yaml
kubectl -n event-example apply -f - << EOF kubectl -n event-example apply -f - << EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Trigger kind: Trigger
@ -181,7 +181,7 @@ Each trigger can specify a filter that enables selection of relevant events base
your event consumer named `hello-display`. your event consumer named `hello-display`.
1. To add a second trigger, enter the following command: 1. To add a second trigger, enter the following command:
``` ```yaml
kubectl -n event-example apply -f - << EOF kubectl -n event-example apply -f - << EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Trigger kind: Trigger
@ -204,12 +204,12 @@ Each trigger can specify a filter that enables selection of relevant events base
1. Verify that the triggers are working correctly by running the following 1. Verify that the triggers are working correctly by running the following
command: command:
``` ```bash
kubectl -n event-example get triggers kubectl -n event-example get triggers
``` ```
This returns the `hello-display` and `goodbye-display` triggers that you This returns the `hello-display` and `goodbye-display` triggers that you
created: created:
``` ```{ .bash .no-copy }
NAME READY REASON BROKER SUBSCRIBER_URI AGE NAME READY REASON BROKER SUBSCRIBER_URI AGE
goodbye-display True default http://goodbye-display.event-example.svc.cluster.local/ 9s goodbye-display True default http://goodbye-display.event-example.svc.cluster.local/ 9s
hello-display True default http://hello-display.event-example.svc.cluster.local/ 16s hello-display True default http://hello-display.event-example.svc.cluster.local/ 16s
@ -227,7 +227,7 @@ This guide uses `curl` commands to manually send individual events as HTTP reque
The broker can only be accessed from within the cluster where Knative Eventing is installed. You must create a pod within that cluster to act as an event producer that will execute the `curl` commands. The broker can only be accessed from within the cluster where Knative Eventing is installed. You must create a pod within that cluster to act as an event producer that will execute the `curl` commands.
To create a pod, enter the following command: To create a pod, enter the following command:
``` ```yaml
kubectl -n event-example apply -f - << EOF kubectl -n event-example apply -f - << EOF
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
@ -252,12 +252,12 @@ EOF
## Sending events to the broker ## Sending events to the broker
1. SSH into the pod by running the following command: 1. SSH into the pod by running the following command:
``` ```bash
kubectl -n event-example attach curl -it kubectl -n event-example attach curl -it
``` ```
You will see a prompt similar to the following: You will see a prompt similar to the following:
``` ```{ .bash .no-copy }
Defaulting container name to curl. Defaulting container name to curl.
Use 'kubectl describe pod/ -n event-example' to see all of the containers in this pod. Use 'kubectl describe pod/ -n event-example' to see all of the containers in this pod.
If you don't see a command prompt, try pressing enter. If you don't see a command prompt, try pressing enter.
@ -267,7 +267,7 @@ EOF
1. Make a HTTP request to the broker. To show the various types of events you can send, you will make three requests: 1. Make a HTTP request to the broker. To show the various types of events you can send, you will make three requests:
- To make the first request, which creates an event that has the `type` - To make the first request, which creates an event that has the `type`
`greeting`, run the following in the SSH terminal: `greeting`, run the following in the SSH terminal:
``` ```bash
curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \ curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \
-X POST \ -X POST \
-H "Ce-Id: say-hello" \ -H "Ce-Id: say-hello" \
@ -282,7 +282,7 @@ EOF
If the event has been received, you will receive a `202 Accepted` response If the event has been received, you will receive a `202 Accepted` response
similar to the one below: similar to the one below:
``` ```{ .bash .no-copy }
< HTTP/1.1 202 Accepted < HTTP/1.1 202 Accepted
< Content-Length: 0 < Content-Length: 0
< Date: Mon, 12 Aug 2019 19:48:18 GMT < Date: Mon, 12 Aug 2019 19:48:18 GMT
@ -290,7 +290,7 @@ EOF
- To make the second request, which creates an event that has the `source` - To make the second request, which creates an event that has the `source`
`sendoff`, run the following in the SSH terminal: `sendoff`, run the following in the SSH terminal:
``` ```bash
curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \ curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \
-X POST \ -X POST \
-H "Ce-Id: say-goodbye" \ -H "Ce-Id: say-goodbye" \
@ -311,7 +311,7 @@ EOF
``` ```
- To make the third request, which creates an event that has the `type` - To make the third request, which creates an event that has the `type`
`greeting` and the`source` `sendoff`, run the following in the SSH terminal: `greeting` and the`source` `sendoff`, run the following in the SSH terminal:
``` ```bash
curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \ curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \
-X POST \ -X POST \
-H "Ce-Id: say-hello-goodbye" \ -H "Ce-Id: say-hello-goodbye" \
@ -325,7 +325,7 @@ EOF
will activate and send the event to the event consumers of the same name. will activate and send the event to the event consumers of the same name.
If the event has been received, you will receive a `202 Accepted` response If the event has been received, you will receive a `202 Accepted` response
similar to the one below: similar to the one below:
``` ```{ .bash .no-copy }
< HTTP/1.1 202 Accepted < HTTP/1.1 202 Accepted
< Content-Length: 0 < Content-Length: 0
< Date: Mon, 12 Aug 2019 19:48:18 GMT < Date: Mon, 12 Aug 2019 19:48:18 GMT
@ -344,12 +344,12 @@ After you send the events, verify that the events were received by the correct s
1. Look at the logs for the `hello-display` event consumer by entering the 1. Look at the logs for the `hello-display` event consumer by entering the
following command: following command:
``` ```bash
kubectl -n event-example logs -l app=hello-display --tail=100 kubectl -n event-example logs -l app=hello-display --tail=100
``` ```
This returns the `Attributes` and `Data` of the events you sent to This returns the `Attributes` and `Data` of the events you sent to
`hello-display`: `hello-display`:
``` ```{ .bash .no-copy }
☁️ cloudevents.Event ☁️ cloudevents.Event
Validation: valid Validation: valid
Context Attributes, Context Attributes,
@ -383,12 +383,12 @@ After you send the events, verify that the events were received by the correct s
``` ```
1. Look at the logs for the `goodbye-display` event consumer by entering the 1. Look at the logs for the `goodbye-display` event consumer by entering the
following command: following command:
``` ```bash
kubectl -n event-example logs -l app=goodbye-display --tail=100 kubectl -n event-example logs -l app=goodbye-display --tail=100
``` ```
This returns the `Attributes` and `Data` of the events you sent to This returns the `Attributes` and `Data` of the events you sent to
`goodbye-display`: `goodbye-display`:
``` ```{ .bash .no-copy }
☁️ cloudevents.Event ☁️ cloudevents.Event
Validation: valid Validation: valid
Context Attributes, Context Attributes,
@ -426,6 +426,6 @@ After you send the events, verify that the events were received by the correct s
You can delete the `event-example` namespace and its associated resources from your cluster if you do not plan to use it again in the future. You can delete the `event-example` namespace and its associated resources from your cluster if you do not plan to use it again in the future.
Delete the `event-example` namespace and all of its resources from your cluster by entering the following command: Delete the `event-example` namespace and all of its resources from your cluster by entering the following command:
``` ```bash
kubectl delete namespace event-example kubectl delete namespace event-example
``` ```

View File

@ -24,7 +24,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/eventing/samples/helloworld/helloworld-go cd knative-docs/docs/eventing/samples/helloworld/helloworld-go
``` ```
@ -220,7 +220,7 @@ cd knative-docs/docs/eventing/samples/helloworld/helloworld-go
1. Use the go tool to create a 1. Use the go tool to create a
[`go.mod`](https://github.com/golang/go/wiki/Modules#gomod) manifest. [`go.mod`](https://github.com/golang/go/wiki/Modules#gomod) manifest.
```shell ```bash
go mod init github.com/knative/docs/docs/serving/samples/hello-world/helloworld-go go mod init github.com/knative/docs/docs/serving/samples/hello-world/helloworld-go
``` ```
@ -233,7 +233,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-go . docker build -t {username}/helloworld-go .
@ -246,13 +246,13 @@ folder) you're ready to build and deploy the sample app.
container image value in `sample-app.yaml` matches the container you built in container image value in `sample-app.yaml` matches the container you built in
the previous step. Apply the configuration using `kubectl`: the previous step. Apply the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename sample-app.yaml kubectl apply --filename sample-app.yaml
``` ```
1. Above command created a namespace `knative-samples` and create a default Broker it. Verify using the following command: 1. Above command created a namespace `knative-samples` and create a default Broker it. Verify using the following command:
```shell ```bash
kubectl get broker --namespace knative-samples kubectl get broker --namespace knative-samples
``` ```
@ -264,7 +264,7 @@ folder) you're ready to build and deploy the sample app.
1. It deployed the helloworld-go app as a K8s Deployment and created a K8s 1. It deployed the helloworld-go app as a K8s Deployment and created a K8s
service names helloworld-go. Verify using the following command. service names helloworld-go. Verify using the following command.
```shell ```bash
kubectl --namespace knative-samples get deployments helloworld-go kubectl --namespace knative-samples get deployments helloworld-go
kubectl --namespace knative-samples get svc helloworld-go kubectl --namespace knative-samples get svc helloworld-go
@ -273,7 +273,7 @@ folder) you're ready to build and deploy the sample app.
1. It created a Knative Eventing Trigger to route certain events to the 1. It created a Knative Eventing Trigger to route certain events to the
helloworld-go application. Make sure that Ready=true helloworld-go application. Make sure that Ready=true
```shell ```bash
kubectl --namespace knative-samples get trigger helloworld-go kubectl --namespace knative-samples get trigger helloworld-go
``` ```

View File

@ -226,11 +226,11 @@ You can send an HTTP request directly to the Knative [broker](../../../broker) i
Helloworld-python app logs the context and the msg of the above event, and replies back with another event. Helloworld-python app logs the context and the msg of the above event, and replies back with another event.
1. Display helloworld-python app logs 1. Display helloworld-python app logs
```shell ```bash
kubectl --namespace knative-samples logs -l app=helloworld-python --tail=50 kubectl --namespace knative-samples logs -l app=helloworld-python --tail=50
``` ```
You should see something similar to: You should see something similar to:
```shell ```bash
Event received. Context: Context Attributes, Event received. Context: Context Attributes,
specversion: 0.3 specversion: 0.3
type: dev.knative.samples.helloworld type: dev.knative.samples.helloworld

View File

@ -26,13 +26,13 @@ here and use them later.
#### Variables you must Change #### Variables you must Change
```shell ```bash
export IOTCORE_PROJECT="s9-demo" export IOTCORE_PROJECT="s9-demo"
``` ```
#### Variables you may Change #### Variables you may Change
```shell ```bash
export IOTCORE_REGISTRY="iot-demo" export IOTCORE_REGISTRY="iot-demo"
export IOTCORE_DEVICE="iot-demo-client" export IOTCORE_DEVICE="iot-demo-client"
export IOTCORE_REGION="us-central1" export IOTCORE_REGION="us-central1"
@ -56,13 +56,13 @@ export IOTCORE_TOPIC_DEVICE="iot-demo-device-pubsub-topic"
1. Enable the `Cloud Pub/Sub API` on that project. 1. Enable the `Cloud Pub/Sub API` on that project.
```shell ```bash
gcloud services enable pubsub.googleapis.com gcloud services enable pubsub.googleapis.com
``` ```
1. Create the two GCP PubSub `topic`s. 1. Create the two GCP PubSub `topic`s.
```shell ```bash
gcloud pubsub topics create $IOTCORE_TOPIC_DATA gcloud pubsub topics create $IOTCORE_TOPIC_DATA
gcloud pubsub topics create $IOTCORE_TOPIC_DEVICE gcloud pubsub topics create $IOTCORE_TOPIC_DEVICE
``` ```
@ -80,7 +80,7 @@ export IOTCORE_TOPIC_DEVICE="iot-demo-device-pubsub-topic"
1. Create two secrets with the downloaded key (one for the Source, one for 1. Create two secrets with the downloaded key (one for the Source, one for
the Receive Adapter): the Receive Adapter):
```shell ```bash
kubectl --namespace knative-sources create secret generic gcppubsub-source-key --from-file=key.json=PATH_TO_KEY_FILE.json kubectl --namespace knative-sources create secret generic gcppubsub-source-key --from-file=key.json=PATH_TO_KEY_FILE.json
kubectl --namespace default create secret generic google-cloud-key --from-file=key.json=PATH_TO_KEY_FILE.json kubectl --namespace default create secret generic google-cloud-key --from-file=key.json=PATH_TO_KEY_FILE.json
``` ```
@ -88,7 +88,7 @@ export IOTCORE_TOPIC_DEVICE="iot-demo-device-pubsub-topic"
1. Deploy the `GcpPubSubSource` controller as part of eventing-source's 1. Deploy the `GcpPubSubSource` controller as part of eventing-source's
controller. controller.
```shell ```bash
kubectl apply --filename https://github.com/knative/eventing-contrib/releases/download/v0.8.2/gcppubsub.yaml kubectl apply --filename https://github.com/knative/eventing-contrib/releases/download/v0.8.2/gcppubsub.yaml
``` ```
@ -98,7 +98,7 @@ export IOTCORE_TOPIC_DEVICE="iot-demo-device-pubsub-topic"
1. Install the default `Broker`. 1. Install the default `Broker`.
```shell ```bash
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Broker kind: Broker
@ -111,7 +111,7 @@ export IOTCORE_TOPIC_DEVICE="iot-demo-device-pubsub-topic"
1. Deploy `gcp-pubsub-source.yaml`. 1. Deploy `gcp-pubsub-source.yaml`.
```shell ```bash
sed -e "s/PROJECT_ID/$IOTCORE_PROJECT/" \ sed -e "s/PROJECT_ID/$IOTCORE_PROJECT/" \
-e "s/TOPIC_NAME/$IOTCORE_TOPIC_DATA/" \ -e "s/TOPIC_NAME/$IOTCORE_TOPIC_DATA/" \
docs/eventing/samples/iot-core/gcp-pubsub-source.yaml | docs/eventing/samples/iot-core/gcp-pubsub-source.yaml |
@ -125,7 +125,7 @@ for all events coming out of it.
1. Deploy `trigger.yaml`. 1. Deploy `trigger.yaml`.
```shell ```bash
kubectl apply --filename docs/eventing/samples/iot-core/trigger.yaml kubectl apply --filename docs/eventing/samples/iot-core/trigger.yaml
``` ```
@ -139,7 +139,7 @@ Core.
1. Create a device registry: 1. Create a device registry:
```shell ```bash
gcloud iot registries create $IOTCORE_REGISTRY \ gcloud iot registries create $IOTCORE_REGISTRY \
--project=$IOTCORE_PROJECT \ --project=$IOTCORE_PROJECT \
--region=$IOTCORE_REGION \ --region=$IOTCORE_REGION \
@ -149,7 +149,7 @@ Core.
1. Create the certificates. 1. Create the certificates.
```shell ```bash
openssl req -x509 -nodes -newkey rsa:2048 \ openssl req -x509 -nodes -newkey rsa:2048 \
-keyout device.key.pem \ -keyout device.key.pem \
-out device.crt.pem \ -out device.crt.pem \
@ -160,7 +160,7 @@ Core.
1. Register a device using the generated certificates. 1. Register a device using the generated certificates.
```shell ```bash
gcloud iot devices create $IOTCORE_DEVICE \ gcloud iot devices create $IOTCORE_DEVICE \
--project=$IOTCORE_PROJECT \ --project=$IOTCORE_PROJECT \
--region=$IOTCORE_REGION \ --region=$IOTCORE_REGION \
@ -175,7 +175,7 @@ see them in the subscriber.
1. Run the following program to generate events: 1. Run the following program to generate events:
```shell ```bash
go run github.com/knative/docs/docs/eventing/samples/iot-core/generator \ go run github.com/knative/docs/docs/eventing/samples/iot-core/generator \
-project $IOTCORE_PROJECT \ -project $IOTCORE_PROJECT \
-region $IOTCORE_REGION \ -region $IOTCORE_REGION \
@ -189,13 +189,13 @@ see them in the subscriber.
1. Inspect the logs of the subscriber: 1. Inspect the logs of the subscriber:
```shell ```bash
kubectl logs --selector serving.knative.dev/service=event-display -c user-container kubectl logs --selector serving.knative.dev/service=event-display -c user-container
``` ```
You should see something along the similar to: You should see something along the similar to:
```shell ```bash
{"ID":"481014114648052","Data":"eyJzb3VyY2VfaWQiOiJpb3QtY29yZSBkZW1vIiwiZXZlbnRfaWQiOiJlaWQtMzI3MjJiMzItZWU5Mi00YzZlLWEzOTgtNDlmYjRkYWYyNGE1IiwiZXZlbnRfdHMiOjE1NTM3MTczOTYsIm1ldHJpYyI6MC4xMzY1MjI5OH0=","Attributes":{"deviceId":"iot-demo-client","deviceNumId":"2754785852315736","deviceRegistryId":"iot-demo","deviceRegistryLocation":"us-central1","projectId":"s9-demo","subFolder":""},"PublishTime":"2019-03-27T20:09:56.685Z"} {"ID":"481014114648052","Data":"eyJzb3VyY2VfaWQiOiJpb3QtY29yZSBkZW1vIiwiZXZlbnRfaWQiOiJlaWQtMzI3MjJiMzItZWU5Mi00YzZlLWEzOTgtNDlmYjRkYWYyNGE1IiwiZXZlbnRfdHMiOjE1NTM3MTczOTYsIm1ldHJpYyI6MC4xMzY1MjI5OH0=","Attributes":{"deviceId":"iot-demo-client","deviceNumId":"2754785852315736","deviceRegistryId":"iot-demo","deviceRegistryLocation":"us-central1","projectId":"s9-demo","subFolder":""},"PublishTime":"2019-03-27T20:09:56.685Z"}
``` ```
@ -205,7 +205,7 @@ To cleanup the knative resources:
1. Remove the `GcpPubSubSource`: 1. Remove the `GcpPubSubSource`:
```shell ```bash
sed -e "s/PROJECT_ID/$IOTCORE_PROJECT/" \ sed -e "s/PROJECT_ID/$IOTCORE_PROJECT/" \
-e "s/TOPIC_NAME/$IOTCORE_TOPIC_DATA/" \ -e "s/TOPIC_NAME/$IOTCORE_TOPIC_DATA/" \
docs/eventing/samples/iot-core/gcp-pubsub-source.yaml | docs/eventing/samples/iot-core/gcp-pubsub-source.yaml |
@ -214,12 +214,12 @@ To cleanup the knative resources:
1. Remove the Trigger: 1. Remove the Trigger:
```shell ```bash
kubectl delete --filename docs/eventing/samples/iot-core/trigger.yaml kubectl delete --filename docs/eventing/samples/iot-core/trigger.yaml
``` ```
1. Remove the `GcpPubSubSource` controller: 1. Remove the `GcpPubSubSource` controller:
```shell ```bash
kubectl delete --filename https://github.com/knative/eventing-contrib/releases/download/v0.8.2/gcppubsub.yaml kubectl delete --filename https://github.com/knative/eventing-contrib/releases/download/v0.8.2/gcppubsub.yaml
``` ```

View File

@ -25,11 +25,11 @@ If you want to run the Apache Kafka cluster on Kubernetes, the simplest option
is to install it by using [Strimzi](https://strimzi.io). is to install it by using [Strimzi](https://strimzi.io).
1. Create a namespace for your Apache Kafka installation, like `kafka`: 1. Create a namespace for your Apache Kafka installation, like `kafka`:
```shell ```bash
kubectl create namespace kafka kubectl create namespace kafka
``` ```
1. Install the Strimzi operator, like: 1. Install the Strimzi operator, like:
```shell ```bash
curl -L "https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.16.2/strimzi-cluster-operator-0.16.2.yaml" \ curl -L "https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.16.2/strimzi-cluster-operator-0.16.2.yaml" \
| sed 's/namespace: .*/namespace: kafka/' \ | sed 's/namespace: .*/namespace: kafka/' \
| kubectl -n kafka apply -f - | kubectl -n kafka apply -f -
@ -71,7 +71,7 @@ This will install a small, non-production, cluster of Apache Kafka. To verify
your installation, check if the pods for Strimzi are all up, in the `kafka` your installation, check if the pods for Strimzi are all up, in the `kafka`
namespace: namespace:
```shell ```bash
$ kubectl get pods -n kafka $ kubectl get pods -n kafka
NAME READY STATUS RESTARTS AGE NAME READY STATUS RESTARTS AGE
my-cluster-entity-operator-65995cf856-ld2zp 3/3 Running 0 102s my-cluster-entity-operator-65995cf856-ld2zp 3/3 Running 0 102s
@ -90,7 +90,7 @@ If you want to install the latest version of Strimzi, in just one step, we have
a [script](./kafka_setup.sh) for your convenience, which does exactly the same a [script](./kafka_setup.sh) for your convenience, which does exactly the same
steps that are listed above: steps that are listed above:
```shell ```bash
$ ./kafka_setup.sh $ ./kafka_setup.sh
``` ```

View File

@ -20,7 +20,7 @@ default channel configuration in Knative Eventing.
## Creating a `KafkaChannel` channel CRD ## Creating a `KafkaChannel` channel CRD
1. Create a new object by configuring the YAML file as follows: 1. Create a new object by configuring the YAML file as follows:
```shell ```bash
kubectl apply -f - <<EOF kubectl apply -f - <<EOF
--- ---
apiVersion: messaging.knative.dev/v1beta1 apiVersion: messaging.knative.dev/v1beta1
@ -36,9 +36,9 @@ default channel configuration in Knative Eventing.
## Specifying the default channel configuration ## Specifying the default channel configuration
1. To configure the usage of the `KafkaChannel` CRD as the 1. To configure the usage of the `KafkaChannel` CRD as the
[default channel configuration](../../../channels/channel-types-defaults), [default channel configuration](../../../channels/channel-types-defaults),
edit the `default-ch-webhook` ConfigMap as follows: edit the `default-ch-webhook` ConfigMap as follows:
```shell ```bash
kubectl apply -f - <<EOF kubectl apply -f - <<EOF
--- ---
apiVersion: v1 apiVersion: v1
@ -63,7 +63,7 @@ default channel configuration in Knative Eventing.
1. Now that `KafkaChannel` is set as the default channel configuration, 1. Now that `KafkaChannel` is set as the default channel configuration,
use the `channels.messaging.knative.dev` CRD to create a new Apache Kafka use the `channels.messaging.knative.dev` CRD to create a new Apache Kafka
channel, using the generic `Channel`: channel, using the generic `Channel`:
```shell ```bash
kubectl apply -f - <<EOF kubectl apply -f - <<EOF
--- ---
apiVersion: messaging.knative.dev/v1 apiVersion: messaging.knative.dev/v1
@ -74,7 +74,7 @@ default channel configuration in Knative Eventing.
``` ```
2. Check Kafka for a `testchannel-one` topic. With Strimzi this can be done by 2. Check Kafka for a `testchannel-one` topic. With Strimzi this can be done by
using the command: using the command:
```shell ```bash
kubectl -n kafka exec -it my-cluster-kafka-0 -- bin/kafka-topics.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --list kubectl -n kafka exec -it my-cluster-kafka-0 -- bin/kafka-topics.sh --bootstrap-server my-cluster-kafka-bootstrap:9092 --list
``` ```
The result is: The result is:
@ -99,7 +99,7 @@ channel from Knative.
1. To setup a broker that will use the new default Kafka channels, you must 1. To setup a broker that will use the new default Kafka channels, you must
create a new _default_ broker, using the command: create a new _default_ broker, using the command:
```shell ```bash
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Broker kind: Broker
@ -131,15 +131,15 @@ the`ApiServerSource` to publish events to the broker as well as the `Trigger`
API, which then routes events to a Knative `Service`. API, which then routes events to a Knative `Service`.
1. Install `ksvc`, using the command: 1. Install `ksvc`, using the command:
```shell ```bash
kubectl apply -f 000-ksvc.yaml kubectl apply -f 000-ksvc.yaml
``` ```
2. Install a source that publishes to the default broker 2. Install a source that publishes to the default broker
```shell ```bash
kubectl apply -f 020-k8s-events.yaml kubectl apply -f 020-k8s-events.yaml
``` ```
3. Create a trigger that routes the events to the `ksvc`: 3. Create a trigger that routes the events to the `ksvc`:
```shell ```bash
kubectl apply -f 030-trigger.yaml kubectl apply -f 030-trigger.yaml
``` ```
@ -151,7 +151,7 @@ your configuration with the following options.
### Receive events via Knative ### Receive events via Knative
1. Observe the events in the log of the `ksvc` using the command: 1. Observe the events in the log of the `ksvc` using the command:
```shell ```bash
kubectl logs --selector='serving.knative.dev/service=broker-kafka-display' -c user-container kubectl logs --selector='serving.knative.dev/service=broker-kafka-display' -c user-container
``` ```
@ -170,7 +170,7 @@ Kafka cluster, with the two supported TLS and SASL authentication methods.
### TLS authentication ### TLS authentication
1. Edit your config-kafka ConfigMap: 1. Edit your config-kafka ConfigMap:
```shell ```bash
kubectl -n knative-eventing edit configmap config-kafka kubectl -n knative-eventing edit configmap config-kafka
``` ```
2. Set the TLS.Enable field to `true`, for example 2. Set the TLS.Enable field to `true`, for example
@ -216,7 +216,7 @@ To use SASL authentication, you will need the following information:
It is recommended to also enable TLS as described in the previous section. It is recommended to also enable TLS as described in the previous section.
1. Edit your config-kafka ConfigMap: 1. Edit your config-kafka ConfigMap:
```shell ```bash
kubectl -n knative-eventing edit configmap config-kafka kubectl -n knative-eventing edit configmap config-kafka
``` ```
2. Set the SASL.Enable field to `true`, for example: 2. Set the SASL.Enable field to `true`, for example:
@ -231,7 +231,7 @@ To use SASL authentication, you will need the following information:
... ...
``` ```
3. Create a secret with the username, password, and SASL mechanism, for example: 3. Create a secret with the username, password, and SASL mechanism, for example:
```shell ```bash
kubectl create secret --namespace <namespace> generic <kafka-auth-secret> \ kubectl create secret --namespace <namespace> generic <kafka-auth-secret> \
--from-literal=password="SecretPassword" \ --from-literal=password="SecretPassword" \
--from-literal=saslType="PLAIN" \ --from-literal=saslType="PLAIN" \

View File

@ -83,7 +83,7 @@ spec:
. .
``` ```
```shell ```bash
kubectl create -f ./filters.yaml -f ./transformers.yaml kubectl create -f ./filters.yaml -f ./transformers.yaml
``` ```
@ -104,7 +104,7 @@ spec:
Change `default` below to create the `Sequence` in the Namespace where you want Change `default` below to create the `Sequence` in the Namespace where you want
your resources to be created. your resources to be created.
```shell ```bash
kubectl -n default create -f ./event-display.yaml kubectl -n default create -f ./event-display.yaml
``` ```
@ -149,7 +149,7 @@ spec:
name: event-display name: event-display
``` ```
```shell ```bash
kubectl create -f ./parallel.yaml kubectl create -f ./parallel.yaml
``` ```
@ -174,7 +174,7 @@ spec:
name: odd-even-parallel name: odd-even-parallel
``` ```
```shell ```bash
kubectl create -f ./ping-source.yaml kubectl create -f ./ping-source.yaml
``` ```
@ -186,7 +186,7 @@ take some time for the events to show up in the logs.
Let's look at the `event-display` log: Let's look at the `event-display` log:
```shell ```bash
kubectl logs -l serving.knative.dev/service=event-display --tail=30 -c user-container kubectl logs -l serving.knative.dev/service=event-display --tail=30 -c user-container
☁️ cloudevents.Event ☁️ cloudevents.Event

View File

@ -74,7 +74,7 @@ spec:
. .
``` ```
```shell ```bash
kubectl create -f ./switcher.yaml -f ./transformers.yaml kubectl create -f ./switcher.yaml -f ./transformers.yaml
``` ```
@ -92,7 +92,7 @@ spec:
- image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display - image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display
``` ```
```shell ```bash
kubectl -n default create -f ./event-display.yaml kubectl -n default create -f ./event-display.yaml
``` ```
@ -132,7 +132,7 @@ spec:
name: me-event-display name: me-event-display
``` ```
```shell ```bash
kubectl create -f ./parallel.yaml kubectl create -f ./parallel.yaml
``` ```
@ -157,7 +157,7 @@ spec:
name: me-odd-even-parallel name: me-odd-even-parallel
``` ```
```shell ```bash
kubectl create -f ./ping-source.yaml kubectl create -f ./ping-source.yaml
``` ```
@ -169,7 +169,7 @@ minute, it might take some time for the events to show up in the logs.
Let's look at the `me-event-display` log: Let's look at the `me-event-display` log:
```shell ```bash
kubectl logs -l serving.knative.dev/service=me-event-display --tail=50 -c user-container kubectl logs -l serving.knative.dev/service=me-event-display --tail=50 -c user-container
☁️ cloudevents.Event ☁️ cloudevents.Event

View File

@ -14,22 +14,22 @@ The Source object defines the arguments and parameters needed to instantiate a C
All Sources are part of the `sources` category. All Sources are part of the `sources` category.
=== "kn"
You can list existing event sources on your cluster by entering the kn command:
```bash
kn source list
```
=== "kubectl" === "kubectl"
You can list existing event sources on your cluster by entering the command: You can list existing event sources on your cluster by entering the command:
```shell ```bash
kubectl get sources kubectl get sources
``` ```
=== "kn"
You can list existing event sources on your cluster by entering the kn command:
```shell
kn source list
```

View File

@ -33,7 +33,7 @@ All Camel Sources use [Apache Camel K](https://github.com/apache/camel-k) as the
1. Install the Camel Source from the `camel.yaml` in the 1. Install the Camel Source from the `camel.yaml` in the
[Knative Eventing Camel release page](https://github.com/knative-sandbox/eventing-camel/releases): [Knative Eventing Camel release page](https://github.com/knative-sandbox/eventing-camel/releases):
```shell ```bash
kubectl apply --filename camel.yaml kubectl apply --filename camel.yaml
``` ```
@ -50,7 +50,7 @@ The following resources need to be created:
Deploy the [`display_resources.yaml`](./display_resources.yaml): Deploy the [`display_resources.yaml`](./display_resources.yaml):
```shell ```bash
kubectl apply --filename display_resources.yaml kubectl apply --filename display_resources.yaml
``` ```
@ -72,14 +72,14 @@ All Camel components are documented in the
Install the [timer CamelSource](source_timer.yaml) from source: Install the [timer CamelSource](source_timer.yaml) from source:
```shell ```bash
kubectl apply -f source_timer.yaml kubectl apply -f source_timer.yaml
``` ```
Verify that the published events were sent into the Knative eventing system by Verify that the published events were sent into the Knative eventing system by
looking at what is downstream of the `CamelSource`. looking at what is downstream of the `CamelSource`.
```shell ```bash
kubectl logs --selector serving.knative.dev/service=camel-event-display -c user-container kubectl logs --selector serving.knative.dev/service=camel-event-display -c user-container
``` ```
@ -108,13 +108,13 @@ By default it creates *2* replicas for demonstration purposes.
To reduce noise in the event display, you can remove all previously created To reduce noise in the event display, you can remove all previously created
CamelSources from the namespace: CamelSources from the namespace:
```shell ```bash
kubectl delete camelsource --all kubectl delete camelsource --all
``` ```
Install the [mqtt CamelSource](source_mqtt.yaml): Install the [mqtt CamelSource](source_mqtt.yaml):
```shell ```bash
kubectl apply -f source_mqtt.yaml kubectl apply -f source_mqtt.yaml
``` ```
@ -124,7 +124,7 @@ Each message you send to the MQTT broker will be printed by the event display as
You can verify that your messages reach the event display by checking its logs: You can verify that your messages reach the event display by checking its logs:
```shell ```bash
kubectl logs --selector serving.knative.dev/service=camel-event-display -c user-container kubectl logs --selector serving.knative.dev/service=camel-event-display -c user-container
``` ```
@ -149,13 +149,13 @@ authorization token, replacing the `<put-your-token-here>` placeholder.
To reduce noise in the event display, you can remove all previously created To reduce noise in the event display, you can remove all previously created
CamelSources from the namespace: CamelSources from the namespace:
```shell ```bash
kubectl delete camelsource --all kubectl delete camelsource --all
``` ```
Install the [telegram CamelSource](source_telegram.yaml): Install the [telegram CamelSource](source_telegram.yaml):
```shell ```bash
kubectl apply -f source_telegram.yaml kubectl apply -f source_telegram.yaml
``` ```
@ -164,7 +164,7 @@ the bot will be printed by the event display as a Cloudevent.
You can verify that your messages reach the event display by checking its logs: You can verify that your messages reach the event display by checking its logs:
```shell ```bash
kubectl logs --selector serving.knative.dev/service=camel-event-display -c user-container kubectl logs --selector serving.knative.dev/service=camel-event-display -c user-container
``` ```
@ -183,19 +183,19 @@ The example will retrieve a static JSON file from a remote URL, but you can edit
If you have previously deployed other CamelSources, to reduce noise in the event If you have previously deployed other CamelSources, to reduce noise in the event
display, you can remove them all from the namespace: display, you can remove them all from the namespace:
```shell ```bash
kubectl delete camelsource --all kubectl delete camelsource --all
``` ```
Install the [HTTP poller CamelSource](source_http_poller.yaml): Install the [HTTP poller CamelSource](source_http_poller.yaml):
```shell ```bash
kubectl apply -f source_http_poller.yaml kubectl apply -f source_http_poller.yaml
``` ```
The event display will show some JSON data periodically pulled from the external The event display will show some JSON data periodically pulled from the external
REST API. To check the logs: REST API. To check the logs:
```shell ```bash
kubectl logs --selector serving.knative.dev/service=camel-event-display -c user-container kubectl logs --selector serving.knative.dev/service=camel-event-display -c user-container
``` ```

View File

@ -17,11 +17,10 @@ Before you can create an API server source, you must install Knative Eventing an
1. Optional: Create a namespace for the API server source instance: 1. Optional: Create a namespace for the API server source instance:
```shell ```bash
kubectl create namespace <namespace> kubectl create namespace <namespace>
``` ```
where; Where `<namespace>` is the name of the namespace that you want to create.
- `<namespace>` is the name of the namespace that you want to create.
Creating a namespace for your API server source and related components allows you to view changes and events for this workflow more easily, since these are isolated from the many other components that may exist in your `default` namespace. Creating a namespace for your API server source and related components allows you to view changes and events for this workflow more easily, since these are isolated from the many other components that may exist in your `default` namespace.
@ -90,7 +89,23 @@ Before you can create an API server source, you must install Knative Eventing an
1. Create an ApiServerSource object: 1. Create an ApiServerSource object:
=== "kn"
```bash
kn source apiserver create <apiserversource> \
--namespace <namespace> \
--mode "Resource" \
--resource "Event:v1" \
--service-account <service-account> \
--sink <sink>
```
where;
- `<apiserversource>` is the name of the source that you want to create.
- `<namespace>` is the name of the namespace that you created in step 1 above.
- `<service-account>` is the name of the service account that you created in step 2 above.
- `<sink>` is the name of the PodSpecable object that you want to use as a sink.
=== "YAML" === "YAML"
```yaml ```yaml
@ -120,29 +135,13 @@ Before you can create an API server source, you must install Knative Eventing an
- `<sink>` is the name of the Knative service that you want to use as a sink. A service is used here as an example, however you can use any supported PodSpecable object by updating the `kind` from `Service` to another object type. - `<sink>` is the name of the Knative service that you want to use as a sink. A service is used here as an example, however you can use any supported PodSpecable object by updating the `kind` from `Service` to another object type.
=== "kn"
```shell
kn source apiserver create <apiserversource> \
--namespace <namespace> \
--mode "Resource" \
--resource "Event:v1" \
--service-account <service-account> \
--sink <sink>
```
where;
- `<apiserversource>` is the name of the source that you want to create.
- `<namespace>` is the name of the namespace that you created in step 1 above.
- `<service-account>` is the name of the service account that you created in step 2 above.
- `<sink>` is the name of the PodSpecable object that you want to use as a sink.
6. Create events by launching a test pod in your namespace: 6. Create events by launching a test pod in your namespace:
```shell ```bash
kubectl run busybox --image=busybox --namespace=<namespace> --restart=Never -- ls kubectl run busybox --image=busybox --namespace=<namespace> --restart=Never -- ls
``` ```
where; where;
@ -150,7 +149,7 @@ Before you can create an API server source, you must install Knative Eventing an
1. Delete the test pod: 1. Delete the test pod:
```shell ```bash
kubectl --namespace=<namespace> delete pod busybox kubectl --namespace=<namespace> delete pod busybox
``` ```
where; where;
@ -158,7 +157,7 @@ Before you can create an API server source, you must install Knative Eventing an
1. View the logs to verify that Kubernetes events were sent to the Knative Eventing system: 1. View the logs to verify that Kubernetes events were sent to the Knative Eventing system:
```shell ```bash
kubectl logs --namespace=<namespace> -l app=<sink> --tail=100 kubectl logs --namespace=<namespace> -l app=<sink> --tail=100
``` ```
where; where;
@ -167,7 +166,7 @@ Before you can create an API server source, you must install Knative Eventing an
Example log output: Example log output:
```shell ```bash
☁️ cloudevents.Event ☁️ cloudevents.Event
Validation: valid Validation: valid
Context Attributes, Context Attributes,
@ -222,8 +221,7 @@ Before you can create an API server source, you must install Knative Eventing an
Deleting the namespace removes the API server source and all of the related resources that were created in this namespace: Deleting the namespace removes the API server source and all of the related resources that were created in this namespace:
```shell ```bash
kubectl delete namespace <namespace> kubectl delete namespace <namespace>
``` ```
where; Where `<namespace>` is the name of the namespace that you created in step 1 above.
- `<namespace>` is the name of the namespace that you created in step 1 above.

View File

@ -61,13 +61,13 @@ spec:
Use following command to create the service from `service.yaml`: Use following command to create the service from `service.yaml`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
The status of the created service can be seen using: The status of the created service can be seen using:
```shell ```bash
kubectl get ksvc kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON NAME URL LATESTCREATED LATESTREADY READY REASON
@ -111,7 +111,7 @@ spec:
Use the following command to create the event source from Use the following command to create the event source from
`heartbeats-source.yaml`: `heartbeats-source.yaml`:
```shell ```bash
kubectl apply --filename heartbeats-source.yaml kubectl apply --filename heartbeats-source.yaml
``` ```
@ -120,7 +120,7 @@ kubectl apply --filename heartbeats-source.yaml
We will verify that the message was sent to the Knative eventing system by We will verify that the message was sent to the Knative eventing system by
looking at event-display service logs. looking at event-display service logs.
```shell ```bash
kubectl logs -l serving.knative.dev/service=event-display -c user-container --since=10m kubectl logs -l serving.knative.dev/service=event-display -c user-container --since=10m
``` ```

View File

@ -48,7 +48,7 @@ ko publish ko://knative.dev/eventing/cmd/heartbeats
Create a new namespace called `containersource-example` by entering the following Create a new namespace called `containersource-example` by entering the following
command: command:
```shell ```bash
kubectl create namespace containersource-example kubectl create namespace containersource-example
``` ```
@ -57,7 +57,7 @@ kubectl create namespace containersource-example
In order to verify `ContainerSource` is working, we will create a Event Display In order to verify `ContainerSource` is working, we will create a Event Display
Service that dumps incoming messages to its log. Service that dumps incoming messages to its log.
```shell ```bash
kubectl -n containersource-example apply -f - << EOF kubectl -n containersource-example apply -f - << EOF
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -102,7 +102,7 @@ image you published in the previous step.
Note that arguments and environment variables are set and will be passed Note that arguments and environment variables are set and will be passed
to the container. to the container.
```shell ```bash
kubectl -n containersource-example apply -f - << EOF kubectl -n containersource-example apply -f - << EOF
apiVersion: sources.knative.dev/v1 apiVersion: sources.knative.dev/v1
kind: ContainerSource kind: ContainerSource
@ -136,7 +136,7 @@ EOF
View the logs for the `event-display` event consumer by View the logs for the `event-display` event consumer by
entering the following command: entering the following command:
```shell ```bash
kubectl -n containersource-example logs -l app=event-display --tail=200 kubectl -n containersource-example logs -l app=event-display --tail=200
``` ```
@ -168,7 +168,7 @@ Data,
Delete the `containersource-example` namespace and all of its resources from your Delete the `containersource-example` namespace and all of its resources from your
cluster by entering the following command: cluster by entering the following command:
```shell ```bash
kubectl delete namespace containersource-example kubectl delete namespace containersource-example
``` ```

View File

@ -1,10 +1,3 @@
---
title: "GitHub source"
linkTitle: "GitHub source"
weight: 30
type: "docs"
---
# GitHub source # GitHub source
GitHub Source example shows how to wire GitHub events for consumption GitHub Source example shows how to wire GitHub events for consumption
@ -16,7 +9,7 @@ by a Knative Service.
1. Ensure Knative Serving is [configured with a domain 1. Ensure Knative Serving is [configured with a domain
name](../../../serving/using-a-custom-domain.md) name](../../../serving/using-a-custom-domain.md)
that allows GitHub to call into the cluster. that allows GitHub to call into the cluster.
1. If you're using GKE, you'll also want to [assign a static IP address](../../../serving/gke-assigning-static-ip-address.md). 1. You must ensure that your Knative cluster uses a static IP address refer to your provider's documentation.
1. Set up [Knative Eventing](../../../eventing) with the GitHub source. 1. Set up [Knative Eventing](../../../eventing) with the GitHub source.
### Create a Knative Service ### Create a Knative Service
@ -39,7 +32,7 @@ spec:
Enter the following command to create the service from `service.yaml`: Enter the following command to create the service from `service.yaml`:
```shell ```bash
kubectl --namespace default apply --filename service.yaml kubectl --namespace default apply --filename service.yaml
``` ```
@ -78,13 +71,13 @@ stringData:
Hint: you can makeup a random _secretToken_ with: Hint: you can makeup a random _secretToken_ with:
```shell ```bash
head -c 8 /dev/urandom | base64 head -c 8 /dev/urandom | base64
``` ```
Then, apply the githubsecret using `kubectl`: Then, apply the githubsecret using `kubectl`:
```shell ```bash
kubectl --namespace default apply --filename githubsecret.yaml kubectl --namespace default apply --filename githubsecret.yaml
``` ```
@ -125,7 +118,7 @@ spec:
Then, apply that yaml using `kubectl`: Then, apply that yaml using `kubectl`:
```shell ```bash
kubectl --namespace default apply --filename github-source.yaml kubectl --namespace default apply --filename github-source.yaml
``` ```
@ -144,7 +137,7 @@ Create a pull request in your GitHub repository. We will verify
that the GitHub events were sent into the Knative eventing system that the GitHub events were sent into the Knative eventing system
by looking at our message dumper function logs. by looking at our message dumper function logs.
```shell ```bash
kubectl --namespace default get pods kubectl --namespace default get pods
kubectl --namespace default logs github-event-display-XXXX user-container kubectl --namespace default logs github-event-display-XXXX user-container
``` ```
@ -180,13 +173,13 @@ X-Request-Id: 8a2201af-5075-9447-b593-ec3a243aff52
You can remove the Github webhook by deleting the Github source: You can remove the Github webhook by deleting the Github source:
```shell ```bash
kubectl --namespace default delete --filename github-source.yaml kubectl --namespace default delete --filename github-source.yaml
``` ```
Similarly, you can remove the Service and Secret via: Similarly, you can remove the Service and Secret via:
```shell ```bash
kubectl --namespace default delete --filename service.yaml kubectl --namespace default delete --filename service.yaml
kubectl --namespace default delete --filename githubsecret.yaml kubectl --namespace default delete --filename githubsecret.yaml

View File

@ -1,10 +1,3 @@
---
title: "GitLab source"
linkTitle: "GitLab source"
weight: 30
type: "docs"
---
# GitLab source # GitLab source
GitLab Source example shows how to wire GitLab events for consumption by a GitLab Source example shows how to wire GitLab events for consumption by a
@ -21,9 +14,8 @@ You will need:
need to create one. need to create one.
1. Ensure Knative Serving is 1. Ensure Knative Serving is
[configured with a domain name](../../../serving/using-a-custom-domain.md) [configured with a domain name](../../../serving/using-a-custom-domain.md)
1. You must ensure that your Knative cluster uses a static IP address refer to your provider's documentation.
that allows GitLab to call into the cluster. that allows GitLab to call into the cluster.
1. If you're using GKE, you'll also want to
[assign a static IP address](../../../serving/gke-assigning-static-ip-address.md).
1. Install [Knative Eventing](../../../eventing). 1. Install [Knative Eventing](../../../eventing).
### Install GitLab Event Source ### Install GitLab Event Source
@ -31,13 +23,13 @@ You will need:
GitLab Event source lives in the [knative-sandbox/eventing-gitlab](https://github.com/knative-sandbox/eventing-gitlab). Head to the releases page, find the latest release with `gitlab.yaml` GitLab Event source lives in the [knative-sandbox/eventing-gitlab](https://github.com/knative-sandbox/eventing-gitlab). Head to the releases page, find the latest release with `gitlab.yaml`
artifact and replace the `<RELEASE>` with version tag: artifact and replace the `<RELEASE>` with version tag:
```shell ```bash
kubectl apply -f https://github.com/knative-sandbox/eventing-gitlab/releases/download/<RELEASE>/gitlab.yaml kubectl apply -f https://github.com/knative-sandbox/eventing-gitlab/releases/download/<RELEASE>/gitlab.yaml
``` ```
Check that the manager is running: Check that the manager is running:
```shell ```bash
kubectl -n knative-sources get pods --selector control-plane=gitlab-controller-manager kubectl -n knative-sources get pods --selector control-plane=gitlab-controller-manager
``` ```
@ -78,7 +70,7 @@ spec:
Create the service: Create the service:
```shell ```bash
kubectl -n default apply -f event-display.yaml kubectl -n default apply -f event-display.yaml
``` ```
@ -98,7 +90,7 @@ kubectl -n default apply -f event-display.yaml
Hint: you can generate a random _secretToken_ with: Hint: you can generate a random _secretToken_ with:
```shell ```bash
head -c 8 /dev/urandom | base64 head -c 8 /dev/urandom | base64
``` ```
@ -117,7 +109,7 @@ kubectl -n default apply -f event-display.yaml
1. Create the secret using `kubectl`. 1. Create the secret using `kubectl`.
```shell ```bash
kubectl -n default apply -f secret.yaml kubectl -n default apply -f secret.yaml
``` ```
@ -157,7 +149,7 @@ kubectl -n default apply -f event-display.yaml
1. Apply the yaml file using `kubectl`: 1. Apply the yaml file using `kubectl`:
```shell ```bash
kubectl -n default apply -f gitlabsource.yaml kubectl -n default apply -f gitlabsource.yaml
``` ```
@ -190,13 +182,13 @@ Data,
You can remove the GitLab webhook by deleting the GitLab source: You can remove the GitLab webhook by deleting the GitLab source:
```shell ```bash
kubectl --namespace default delete --filename gitlabsource.yaml kubectl --namespace default delete --filename gitlabsource.yaml
``` ```
Similarly, you can remove the Service and Secret via: Similarly, you can remove the Service and Secret via:
```shell ```bash
kubectl --namespace default delete --filename event-display.yaml kubectl --namespace default delete --filename event-display.yaml
kubectl --namespace default delete --filename secret.yaml kubectl --namespace default delete --filename secret.yaml

View File

@ -47,14 +47,14 @@ The `KafkaSource` reads all the messages, from all partitions, and sends those m
2. Deploy the `KafkaTopic` 2. Deploy the `KafkaTopic`
```shell ```bash
$ kubectl apply -f strimzi-topic.yaml $ kubectl apply -f strimzi-topic.yaml
kafkatopic.kafka.strimzi.io/knative-demo-topic created kafkatopic.kafka.strimzi.io/knative-demo-topic created
``` ```
3. Ensure the `KafkaTopic` is running. 3. Ensure the `KafkaTopic` is running.
```shell ```bash
$ kubectl -n kafka get kafkatopics.kafka.strimzi.io $ kubectl -n kafka get kafkatopics.kafka.strimzi.io
NAME AGE NAME AGE
knative-demo-topic 16s knative-demo-topic 16s
@ -64,7 +64,7 @@ The `KafkaSource` reads all the messages, from all partitions, and sends those m
1. Download a copy of the code: 1. Download a copy of the code:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/eventing/samples/kafka/source cd knative-docs/docs/eventing/samples/kafka/source
``` ```
@ -246,7 +246,7 @@ The `KafkaSource` reads all the messages, from all partitions, and sends those m
``` ```
4. (Optional) Remove the Apache Kafka Topic 4. (Optional) Remove the Apache Kafka Topic
```shell ```bash
$ kubectl delete -f kafka-topic.yaml $ kubectl delete -f kafka-topic.yaml
kafkatopic.kafka.strimzi.io "knative-demo-topic" deleted kafkatopic.kafka.strimzi.io "knative-demo-topic" deleted
``` ```

View File

@ -26,7 +26,7 @@ The following example shows how you can configure a PingSource as an event sourc
1. Optional: Create a new namespace called `pingsource-example` by entering the following command: 1. Optional: Create a new namespace called `pingsource-example` by entering the following command:
```shell ```bash
kubectl create namespace pingsource-example kubectl create namespace pingsource-example
``` ```
@ -37,7 +37,7 @@ The following example shows how you can configure a PingSource as an event sourc
=== "kubectl" === "kubectl"
```shell ```bash
kubectl -n pingsource-example apply -f - << EOF kubectl -n pingsource-example apply -f - << EOF
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
@ -81,7 +81,7 @@ The following example shows how you can configure a PingSource as an event sourc
=== "YAML" === "YAML"
```shell ```bash
kubectl create -n pingsource-example -f - <<EOF kubectl create -n pingsource-example -f - <<EOF
apiVersion: sources.knative.dev/v1 apiVersion: sources.knative.dev/v1
kind: PingSource kind: PingSource
@ -102,7 +102,7 @@ The following example shows how you can configure a PingSource as an event sourc
=== "kn" === "kn"
```shell ```bash
kn source ping create test-ping-source \ kn source ping create test-ping-source \
--namespace pingsource-example \ --namespace pingsource-example \
--schedule "*/1 * * * *" \ --schedule "*/1 * * * *" \
@ -121,7 +121,7 @@ The following example shows how you can configure a PingSource as an event sourc
To create a PingSource that uses base64 encoded data, enter the command: To create a PingSource that uses base64 encoded data, enter the command:
```shell ```bash
kubectl -n pingsource-example apply -f - <<EOF kubectl -n pingsource-example apply -f - <<EOF
apiVersion: sources.knative.dev/v1 apiVersion: sources.knative.dev/v1
kind: PingSource kind: PingSource
@ -145,14 +145,14 @@ entering the following command:
=== "kubectl" === "kubectl"
```shell ```bash
kubectl -n pingsource-example logs -l app=event-display --tail=100 kubectl -n pingsource-example logs -l app=event-display --tail=100
``` ```
=== "kail" === "kail"
```shell ```bash
kail -l serving.knative.dev/service=event-display -c user-container --since=10m kail -l serving.knative.dev/service=event-display -c user-container --since=10m
``` ```
@ -163,7 +163,7 @@ entering the following command:
This returns the `Attributes` and `Data` of the events that the PingSource sent to the `event-display` service: This returns the `Attributes` and `Data` of the events that the PingSource sent to the `event-display` service:
```shell ```bash
☁️ cloudevents.Event ☁️ cloudevents.Event
Validation: valid Validation: valid
Context Attributes, Context Attributes,
@ -181,7 +181,7 @@ entering the following command:
If you created a PingSource that sends binary data, you will also see output similar to the following: If you created a PingSource that sends binary data, you will also see output similar to the following:
```shell ```bash
☁️ cloudevents.Event ☁️ cloudevents.Event
Validation: valid Validation: valid
Context Attributes, Context Attributes,
@ -198,7 +198,7 @@ entering the following command:
1. Optional: You can delete the `pingsource-example` namespace and all related resources from your cluster by entering the following command: 1. Optional: You can delete the `pingsource-example` namespace and all related resources from your cluster by entering the following command:
```shell ```bash
kubectl delete namespace pingsource-example kubectl delete namespace pingsource-example
``` ```
@ -207,28 +207,28 @@ entering the following command:
=== "kubectl" === "kubectl"
```shell ```bash
kubectl delete pingsources.sources.knative.dev test-ping-source kubectl delete pingsources.sources.knative.dev test-ping-source
``` ```
=== "kn" === "kn"
```shell ```bash
kn source ping delete test-ping-source kn source ping delete test-ping-source
``` ```
=== "kubectl: binary data PingSource" === "kubectl: binary data PingSource"
```shell ```bash
kubectl delete pingsources.sources.knative.dev test-ping-source-binary kubectl delete pingsources.sources.knative.dev test-ping-source-binary
``` ```
=== "kn: binary data PingSource" === "kn: binary data PingSource"
```shell ```bash
kn source ping delete test-ping-source-binary kn source ping delete test-ping-source-binary
``` ```
@ -243,14 +243,14 @@ entering the following command:
=== "kubectl" === "kubectl"
```shell ```bash
kubectl delete service.serving.knative.dev event-display kubectl delete service.serving.knative.dev event-display
``` ```
=== "kn" === "kn"
```shell ```bash
kn service delete event-display kn service delete event-display
``` ```

View File

@ -292,7 +292,7 @@ sent by the source to the display function. For example:
To delete the SinkBinding object and all of the related resources in the namespace, To delete the SinkBinding object and all of the related resources in the namespace,
delete the namespace by running: delete the namespace by running:
```shell ```bash
kubectl delete namespace <namespace> kubectl delete namespace <namespace>
``` ```
Where `<namespace>` is the name of the namespace that contains the SinkBinding object. Where `<namespace>` is the name of the namespace that contains the SinkBinding object.

View File

@ -27,7 +27,7 @@ kubectl apply --filename {{ artifact( repo="eventing", file="eventing-sugar-cont
One way to create a Broker is to manually apply a resource to a cluster using One way to create a Broker is to manually apply a resource to a cluster using
the default settings: the default settings:
```shell ```bash
kubectl create -f - <<EOF kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Broker kind: Broker
@ -55,7 +55,7 @@ Sugar Controller will automatically recreate a default Broker.
Creating a "default" Broker when creating a Namespace: Creating a "default" Broker when creating a Namespace:
```shell ```bash
kubectl apply -f - <<EOF kubectl apply -f - <<EOF
apiVersion: v1 apiVersion: v1
kind: Namespace kind: Namespace
@ -68,7 +68,7 @@ EOF
To automatically create a Broker after a namespace exists, label the Namespace: To automatically create a Broker after a namespace exists, label the Namespace:
```shell ```bash
kubectl label namespace default eventing.knative.dev/injection=enabled kubectl label namespace default eventing.knative.dev/injection=enabled
``` ```
@ -79,7 +79,7 @@ Controller will do nothing.
Create a Broker named by a Trigger (`spec.broker`) in the Trigger's Namespace: Create a Broker named by a Trigger (`spec.broker`) in the Trigger's Namespace:
```shell ```bash
kubectl apply -f - << EOF kubectl apply -f - << EOF
apiVersion: eventing.knative.dev/v1 apiVersion: eventing.knative.dev/v1
kind: Trigger kind: Trigger

View File

@ -4,5 +4,5 @@
- [Knative MkDocs Conributor Guide](./mkdocs-contributor-guide.md) - [Knative MkDocs Conributor Guide](./mkdocs-contributor-guide.md)
- [Knative Style Guide](./style-guide/README.md) - [Knative Style Guide](./style-guide/README.md)
- [Content Re-Use](../../snippets/README.md) - [Content Re-Use](../snippets/README.md)
- [Using Shortcodes (Coming Soon!)]() - [Using Shortcodes (Coming Soon!)]()

View File

@ -1,6 +0,0 @@
---
title: "Knative API Reference Documentation"
linkTitle: "API"
weight: 50
type: "docs"
---

View File

@ -72,9 +72,9 @@ For more information on the resources and their interactions, see the [Resource
## Configuration and Networking ## Configuration and Networking
- [Configuring cluster local routes](docs/developer/serving/services/private-services.md) - [Configuring cluster local routes](../developer/serving/services/private-services.md)
- [Using a custom domain](./using-a-custom-domain) - [Using a custom domain](../developer/serving/services/using-a-custom-domain)
- [Using subroutes](./using-subroutes) - [Using subroutes](../developer/serving/services/using-subroutes)
## Observability ## Observability

View File

@ -18,7 +18,7 @@ You can update the configuration file for tracing in [config-tracing.yaml](https
Follow the instructions in the file to set your configuration options. This file includes options such as sample rate (to determine what percentage of requests to trace), debug mode, and backend selection (zipkin or stackdriver). Follow the instructions in the file to set your configuration options. This file includes options such as sample rate (to determine what percentage of requests to trace), debug mode, and backend selection (zipkin or stackdriver).
You can quickly explore and update the ConfigMap object with the following command: You can quickly explore and update the ConfigMap object with the following command:
```shell ```bash
kubectl -n knative-serving edit configmap config-tracing kubectl -n knative-serving edit configmap config-tracing
``` ```
@ -28,7 +28,7 @@ In order to access request traces, you use the Zipkin visualization tool.
1. To open the Zipkin UI, enter the following command: 1. To open the Zipkin UI, enter the following command:
```shell ```bash
kubectl proxy kubectl proxy
``` ```
@ -50,7 +50,7 @@ In order to access request traces, you use the Jaeger visualization tool.
1. To open the Jaeger UI, enter the following command: 1. To open the Jaeger UI, enter the following command:
```shell ```bash
kubectl proxy kubectl proxy
``` ```

View File

@ -18,7 +18,7 @@ A demonstration of the autoscaling capabilities of a Knative Serving Revision.
1. The `hey` load generator installed (`go get -u github.com/rakyll/hey`). 1. The `hey` load generator installed (`go get -u github.com/rakyll/hey`).
1. Clone this repository, and move into the sample directory: 1. Clone this repository, and move into the sample directory:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs cd knative-docs
``` ```
@ -43,7 +43,7 @@ A demonstration of the autoscaling capabilities of a Knative Serving Revision.
1. Make a request to the autoscale app to see it consume some resources. 1. Make a request to the autoscale app to see it consume some resources.
```shell ```bash
curl "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5" curl "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5"
``` ```
@ -55,13 +55,13 @@ A demonstration of the autoscaling capabilities of a Knative Serving Revision.
1. Send 30 seconds of traffic maintaining 50 in-flight requests. 1. Send 30 seconds of traffic maintaining 50 in-flight requests.
```shell ```bash
hey -z 30s -c 50 \ hey -z 30s -c 50 \
"http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5" \ "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5" \
&& kubectl get pods && kubectl get pods
``` ```
```shell ```bash
Summary: Summary:
Total: 30.3379 secs Total: 30.3379 secs
Slowest: 0.7433 secs Slowest: 0.7433 secs
@ -105,7 +105,7 @@ A demonstration of the autoscaling capabilities of a Knative Serving Revision.
[200] 5424 responses [200] 5424 responses
``` ```
```shell ```bash
NAME READY STATUS RESTARTS AGE NAME READY STATUS RESTARTS AGE
autoscale-go-00001-deployment-78cdc67bf4-2w4sk 3/3 Running 0 26s autoscale-go-00001-deployment-78cdc67bf4-2w4sk 3/3 Running 0 26s
autoscale-go-00001-deployment-78cdc67bf4-dd2zb 3/3 Running 0 24s autoscale-go-00001-deployment-78cdc67bf4-dd2zb 3/3 Running 0 24s
@ -220,21 +220,21 @@ customization (32 minutes).
1. Send 60 seconds of traffic maintaining 100 concurrent requests. 1. Send 60 seconds of traffic maintaining 100 concurrent requests.
```shell ```bash
hey -z 60s -c 100 \ hey -z 60s -c 100 \
"http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5" "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5"
``` ```
1. Send 60 seconds of traffic maintaining 100 qps with short requests (10 ms). 1. Send 60 seconds of traffic maintaining 100 qps with short requests (10 ms).
```shell ```bash
hey -z 60s -q 100 \ hey -z 60s -q 100 \
"http://autoscale-go.default.1.2.3.4.sslip.io?sleep=10" "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=10"
``` ```
1. Send 60 seconds of traffic maintaining 100 qps with long requests (1 sec). 1. Send 60 seconds of traffic maintaining 100 qps with long requests (1 sec).
```shell ```bash
hey -z 60s -q 100 \ hey -z 60s -q 100 \
"http://autoscale-go.default.1.2.3.4.sslip.io?sleep=1000" "http://autoscale-go.default.1.2.3.4.sslip.io?sleep=1000"
``` ```
@ -242,7 +242,7 @@ customization (32 minutes).
1. Send 60 seconds of traffic with heavy CPU usage (~1 cpu/sec/request, total 1. Send 60 seconds of traffic with heavy CPU usage (~1 cpu/sec/request, total
100 cpus). 100 cpus).
```shell ```bash
hey -z 60s -q 100 \ hey -z 60s -q 100 \
"http://autoscale-go.default.1.2.3.4.sslip.io?prime=40000000" "http://autoscale-go.default.1.2.3.4.sslip.io?prime=40000000"
``` ```
@ -250,7 +250,7 @@ customization (32 minutes).
1. Send 60 seconds of traffic with heavy memory usage (1 gb/request, total 5 1. Send 60 seconds of traffic with heavy memory usage (1 gb/request, total 5
gb). gb).
```shell ```bash
hey -z 60s -c 5 \ hey -z 60s -c 5 \
"http://autoscale-go.default.1.2.3.4.sslip.io?bloat=1000" "http://autoscale-go.default.1.2.3.4.sslip.io?bloat=1000"
``` ```

View File

@ -7,7 +7,8 @@ Knative Serving supports the implementation of Knative Pod Autoscaler (KPA) and
!!! important !!! important
If you want to use Kubernetes Horizontal Pod Autoscaler (HPA), you must install it after you install Knative Serving. If you want to use Kubernetes Horizontal Pod Autoscaler (HPA), you must install it after you install Knative Serving.
For how to install HPA, see [Install optional Serving extensions](../../admin/install/install-extensions.md#install-optional-serving-extensions). For how to install HPA, see [Install optional Serving extensions](../../admin/install/serving/install-serving-with-yaml.md#install-optional-serving-extensions).
### Knative Pod Autoscaler (KPA) ### Knative Pod Autoscaler (KPA)
* Part of the Knative Serving core and enabled by default once Knative Serving is installed. * Part of the Knative Serving core and enabled by default once Knative Serving is installed.

View File

@ -21,7 +21,7 @@ You need:
1. Create a `imagePullSecrets` that contains your credentials as a list of secrets: 1. Create a `imagePullSecrets` that contains your credentials as a list of secrets:
```shell ```bash
kubectl create secret docker-registry [REGISTRY-CRED-SECRETS] \ kubectl create secret docker-registry [REGISTRY-CRED-SECRETS] \
--docker-server=[PRIVATE_REGISTRY_SERVER_URL] \ --docker-server=[PRIVATE_REGISTRY_SERVER_URL] \
--docker-email=[PRIVATE_REGISTRY_EMAIL] \ --docker-email=[PRIVATE_REGISTRY_EMAIL] \
@ -51,7 +51,7 @@ You need:
Example: Example:
```shell ```bash
kubectl create secret `container-registry` \ kubectl create secret `container-registry` \
--docker-server=https://gcr.io/ \ --docker-server=https://gcr.io/ \
--docker-email=my-account-email@address.com \ --docker-email=my-account-email@address.com \
@ -61,7 +61,7 @@ You need:
Tip: After creating the `imagePullSecrets`, you can view those secret's by running: Tip: After creating the `imagePullSecrets`, you can view those secret's by running:
```shell ```bash
kubectl get secret [REGISTRY-CRED-SECRETS] --output=yaml kubectl get secret [REGISTRY-CRED-SECRETS] --output=yaml
``` ```
@ -75,7 +75,7 @@ You need:
Run the following command to modify your `default` service account, assuming Run the following command to modify your `default` service account, assuming
you named your secrets `container-registry`: you named your secrets `container-registry`:
```shell ```bash
kubectl patch serviceaccount default -p "{\"imagePullSecrets\": [{\"name\": \"container-registry\"}]}" kubectl patch serviceaccount default -p "{\"imagePullSecrets\": [{\"name\": \"container-registry\"}]}"
``` ```

View File

@ -52,7 +52,7 @@ The only mandatory flag for creating a Service is `--image` with the container i
To create a Service directly at the cluster, use: To create a Service directly at the cluster, use:
```shell ```bash
# Create a Knative service with the Knative CLI kn # Create a Knative service with the Knative CLI kn
kn service create helloworld-go --image gcr.io/knative-samples/helloworld-go --env TARGET="Go Sample v1" kn service create helloworld-go --image gcr.io/knative-samples/helloworld-go --env TARGET="Go Sample v1"
``` ```
@ -123,7 +123,7 @@ To see if your app has been deployed successfully, you need the URL created by K
=== "kn" === "kn"
```shell ```bash
kn service describe helloworld-go kn service describe helloworld-go
``` ```
@ -149,13 +149,13 @@ To see if your app has been deployed successfully, you need the URL created by K
=== "kubectl" === "kubectl"
```shell ```bash
kubectl get ksvc helloworld-go kubectl get ksvc helloworld-go
``` ```
The command will return the following: The command will return the following:
```shell ```bash
NAME URL LATESTCREATED LATESTREADY READY REASON NAME URL LATESTCREATED LATESTREADY READY REASON
helloworld-go http://helloworld-go.default.34.83.80.117.sslip.io helloworld-go-96dtk helloworld-go-96dtk True helloworld-go http://helloworld-go.default.34.83.80.117.sslip.io helloworld-go-96dtk helloworld-go-96dtk True
``` ```
@ -173,7 +173,7 @@ To see if your app has been deployed successfully, you need the URL created by K
1. Now you can make a request to your app and see the results. Replace 1. Now you can make a request to your app and see the results. Replace
the URL with the one returned by the command in the previous step. the URL with the one returned by the command in the previous step.
```shell ```bash
# curl http://helloworld-go.default.34.83.80.117.sslip.io # curl http://helloworld-go.default.34.83.80.117.sslip.io
Hello World: Go Sample v1! Hello World: Go Sample v1!
``` ```
@ -192,13 +192,13 @@ You've successfully deployed your first application using Knative!
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kn service delete helloworld-go kn service delete helloworld-go
``` ```
Alternatively, you can also delete the service with `kubectl` via the definition file or by name. Alternatively, you can also delete the service with `kubectl` via the definition file or by name.
```shell ```bash
# Delete with the KService given in the yaml file: # Delete with the KService given in the yaml file:
kubectl delete --filename service.yaml kubectl delete --filename service.yaml

View File

@ -26,7 +26,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/cloudevents/cloudevents-dotnet cd knative-docs/docs/serving/samples/cloudevents/cloudevents-dotnet
``` ```
@ -60,7 +60,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-dotnet
dependencies and building an ASP.NET container based on Alpine. You can build dependencies and building an ASP.NET container based on Alpine. You can build
and push this to your registry of choice via: and push this to your registry of choice via:
```shell ```bash
docker build -t <image> . docker build -t <image> .
docker push <image> docker push <image>
``` ```
@ -68,7 +68,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-dotnet
1. If you look in `service.yaml`, take the `<image>` name above and insert it 1. If you look in `service.yaml`, take the `<image>` name above and insert it
into the `image:` field. into the `image:` field.
```shell ```bash
kubectl apply -f service.yaml kubectl apply -f service.yaml
``` ```
@ -76,7 +76,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-dotnet
Get the URL for your Service with: Get the URL for your Service with:
```shell ```bash
$ kubectl get ksvc $ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON NAME URL LATESTCREATED LATESTREADY READY REASON
cloudevents-dotnet http://cloudevents-dotnet... cloudevents-dotnet-ss5pj cloudevents-dotnet-ss5pj True cloudevents-dotnet http://cloudevents-dotnet... cloudevents-dotnet-ss5pj cloudevents-dotnet-ss5pj True
@ -84,7 +84,7 @@ cloudevents-dotnet http://cloudevents-dotnet... cloudevents-dotnet-ss5pj c
Then send a cloud event to it with: Then send a cloud event to it with:
```shell ```bash
$ curl -X POST \ $ curl -X POST \
-H "content-type: application/json" \ -H "content-type: application/json" \
-H "ce-specversion: 1.0" \ -H "ce-specversion: 1.0" \
@ -115,6 +115,6 @@ You will get back:
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -26,7 +26,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go
``` ```
@ -65,7 +65,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go
dependencies and building a small Go container based on Alpine. You can build dependencies and building a small Go container based on Alpine. You can build
and push this to your registry of choice via: and push this to your registry of choice via:
```shell ```bash
docker build -t <image> . docker build -t <image> .
docker push <image> docker push <image>
``` ```
@ -75,7 +75,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go
You can use [`ko`](https://github.com/google/ko) to build and push just the image with: You can use [`ko`](https://github.com/google/ko) to build and push just the image with:
```shell ```bash
ko publish github.com/knative/docs/docs/serving/samples/cloudevents/cloudevents-go ko publish github.com/knative/docs/docs/serving/samples/cloudevents/cloudevents-go
``` ```
@ -93,7 +93,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go
If you look in `service.yaml`, take the `<image>` name above and insert it If you look in `service.yaml`, take the `<image>` name above and insert it
into the `image:` field, then run: into the `image:` field, then run:
```shell ```bash
kubectl apply -f service.yaml kubectl apply -f service.yaml
``` ```
@ -102,7 +102,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go
If using `ko` to build and push: If using `ko` to build and push:
```shell ```bash
ko apply -f service.yaml ko apply -f service.yaml
``` ```
@ -111,7 +111,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go
If using `kn` to deploy: If using `kn` to deploy:
```shell ```bash
kn service create cloudevents-go --image=<IMAGE> kn service create cloudevents-go --image=<IMAGE>
``` ```
@ -120,7 +120,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go
You can compose `kn` and `ko` to build and deploy with a single step using: You can compose `kn` and `ko` to build and deploy with a single step using:
```shell ```bash
kn service create cloudevents-go --image=$(ko publish github.com/knative/docs/docs/serving/samples/cloudevents/cloudevents-go) kn service create cloudevents-go --image=$(ko publish github.com/knative/docs/docs/serving/samples/cloudevents/cloudevents-go)
``` ```
@ -133,7 +133,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go
Get the URL for your Service with: Get the URL for your Service with:
```shell ```bash
$ kubectl get ksvc $ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON NAME URL LATESTCREATED LATESTREADY READY REASON
cloudevents-go http://cloudevents-go.default.1.2.3.4.sslip.io cloudevents-go-ss5pj cloudevents-go-ss5pj True cloudevents-go http://cloudevents-go.default.1.2.3.4.sslip.io cloudevents-go-ss5pj cloudevents-go-ss5pj True
@ -141,7 +141,7 @@ cloudevents-go http://cloudevents-go.default.1.2.3.4.sslip.io cloudevents-go
Then send a cloud event to it with: Then send a cloud event to it with:
```shell ```bash
$ curl -X POST \ $ curl -X POST \
-H "content-type: application/json" \ -H "content-type: application/json" \
-H "ce-specversion: 1.0" \ -H "ce-specversion: 1.0" \
@ -154,7 +154,7 @@ $ curl -X POST \
You will get back: You will get back:
```shell ```bash
{"message":"Hello, Dave"} {"message":"Hello, Dave"}
``` ```
@ -162,6 +162,6 @@ You will get back:
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -26,7 +26,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/cloudevents/cloudevents-nodejs cd knative-docs/docs/serving/samples/cloudevents/cloudevents-nodejs
``` ```
@ -61,7 +61,7 @@ of operation:
In the `Dockerfile`, you can see how the dependencies are installed using npm. In the `Dockerfile`, you can see how the dependencies are installed using npm.
You can build and push this to your registry of choice via: You can build and push this to your registry of choice via:
```shell ```bash
docker build -t <image> . docker build -t <image> .
docker push <image> docker push <image>
``` ```
@ -71,7 +71,7 @@ In the `Dockerfile`, you can see how the dependencies are installed using npm.
To deploy the Knative service, edit the `service.yaml` file and replace To deploy the Knative service, edit the `service.yaml` file and replace
`<registry/repository/image:tag>` with the image you have just created. `<registry/repository/image:tag>` with the image you have just created.
```shell ```bash
kubectl apply -f service.yaml kubectl apply -f service.yaml
``` ```
@ -79,7 +79,7 @@ In the `Dockerfile`, you can see how the dependencies are installed using npm.
To deploy using the `kn` CLI: To deploy using the `kn` CLI:
```shell ```bash
kn service create cloudevents-nodejs --image=<image> kn service create cloudevents-nodejs --image=<image>
``` ```
@ -90,7 +90,7 @@ In the `Dockerfile`, you can see how the dependencies are installed using npm.
Get the URL for your Service with: Get the URL for your Service with:
```shell ```bash
$ kubectl get ksvc $ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON NAME URL LATESTCREATED LATESTREADY READY REASON
cloudevents-nodejs http://cloudevents-nodejs.default.1.2.3.4.sslip.io cloudevents-nodejs-ss5pj cloudevents-nodejs-ss5pj True cloudevents-nodejs http://cloudevents-nodejs.default.1.2.3.4.sslip.io cloudevents-nodejs-ss5pj cloudevents-nodejs-ss5pj True
@ -98,7 +98,7 @@ cloudevents-nodejs http://cloudevents-nodejs.default.1.2.3.4.sslip.io cloude
Then send a cloud event to it with: Then send a cloud event to it with:
```shell ```bash
$ curl -X POST \ $ curl -X POST \
-H "content-type: application/json" \ -H "content-type: application/json" \
-H "ce-specversion: 1.0" \ -H "ce-specversion: 1.0" \
@ -111,7 +111,7 @@ $ curl -X POST \
You will get back: You will get back:
```shell ```bash
{"message":"Hello, Dave"} {"message":"Hello, Dave"}
``` ```
@ -123,7 +123,7 @@ To remove the sample app from your cluster, delete the service.
Run: Run:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
@ -131,7 +131,7 @@ To remove the sample app from your cluster, delete the service.
Run: Run:
```shell ```bash
kn service delete cloudevents-nodejs kn service delete cloudevents-nodejs
``` ```

View File

@ -28,7 +28,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample by running the cluster. You can also download a working copy of the sample by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/cloudevents/cloudevents-rust cd knative-docs/docs/serving/samples/cloudevents/cloudevents-rust
``` ```
@ -48,13 +48,13 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-rust
To build the binary, run: To build the binary, run:
```shell ```bash
cargo build --target x86_64-unknown-linux-musl --release cargo build --target x86_64-unknown-linux-musl --release
``` ```
This will build a statically linked binary, in order to create an image from scratch. Now build the docker image: This will build a statically linked binary, in order to create an image from scratch. Now build the docker image:
```shell ```bash
docker build -t <image> . docker build -t <image> .
``` ```
@ -63,7 +63,7 @@ docker build -t <image> .
To deploy the Knative Service, look in the `service.yaml` and replace `<image>` with the deployed image name. Then run: To deploy the Knative Service, look in the `service.yaml` and replace `<image>` with the deployed image name. Then run:
```shell ```bash
kubectl apply -f service.yaml kubectl apply -f service.yaml
``` ```
@ -72,7 +72,7 @@ docker build -t <image> .
If using `kn` to deploy: If using `kn` to deploy:
```shell ```bash
kn service create cloudevents-rust --image=<image> kn service create cloudevents-rust --image=<image>
``` ```
@ -84,7 +84,7 @@ docker build -t <image> .
Get the URL for your Service with: Get the URL for your Service with:
```shell ```bash
$ kubectl get ksvc $ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON NAME URL LATESTCREATED LATESTREADY READY REASON
cloudevents-rust http://cloudevents-rust.sslip.io cloudevents-rust-vl8fq cloudevents-rust-vl8fq True cloudevents-rust http://cloudevents-rust.sslip.io cloudevents-rust-vl8fq cloudevents-rust-vl8fq True
@ -92,7 +92,7 @@ cloudevents-rust http://cloudevents-rust.sslip.io cloudevents
Then send a CloudEvent to it with: Then send a CloudEvent to it with:
```shell ```bash
$ curl \ $ curl \
-X POST -v \ -X POST -v \
-H "content-type: application/json" \ -H "content-type: application/json" \
@ -106,7 +106,7 @@ $ curl \
You can also send CloudEvents spawning a temporary curl pod in your cluster with: You can also send CloudEvents spawning a temporary curl pod in your cluster with:
```shell ```bash
$ kubectl run curl \ $ kubectl run curl \
--image=curlimages/curl --rm=true --restart=Never -ti -- \ --image=curlimages/curl --rm=true --restart=Never -ti -- \
-X POST -v \ -X POST -v \
@ -121,7 +121,7 @@ $ kubectl run curl \
You'll get as result: You'll get as result:
```shell ```bash
> POST / HTTP/1.1 > POST / HTTP/1.1
> Host: localhost:8080 > Host: localhost:8080
> User-Agent: curl/7.69.1 > User-Agent: curl/7.69.1
@ -154,7 +154,7 @@ To remove the sample app from your cluster, delete the service.
Run: Run:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
@ -163,7 +163,7 @@ To remove the sample app from your cluster, delete the service.
Run: Run:
```shell ```bash
kn service delete cloudevents-rust kn service delete cloudevents-rust
``` ```

View File

@ -28,7 +28,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/cloudevents/cloudevents-spring cd knative-docs/docs/serving/samples/cloudevents/cloudevents-spring
``` ```
@ -45,14 +45,14 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-spring
To build the image, run: To build the image, run:
```shell ```bash
mvn compile jib:build -Dimage=<image_name> mvn compile jib:build -Dimage=<image_name>
``` ```
To deploy the Knative Service, edit the `service.yaml` file and replace `<image>` To deploy the Knative Service, edit the `service.yaml` file and replace `<image>`
with the deployed image name. Then run: with the deployed image name. Then run:
```shell ```bash
kubectl apply -f service.yaml kubectl apply -f service.yaml
``` ```
@ -60,7 +60,7 @@ kubectl apply -f service.yaml
Get the URL for your Service with: Get the URL for your Service with:
```shell ```bash
$ kubectl get ksvc $ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON NAME URL LATESTCREATED LATESTREADY READY REASON
cloudevents-spring http://cloudevents-java.sslip.io cloudevents-spring-86h28 cloudevents-spring-86h28 True cloudevents-spring http://cloudevents-java.sslip.io cloudevents-spring-86h28 cloudevents-spring-86h28 True
@ -68,7 +68,7 @@ cloudevents-spring http://cloudevents-java.sslip.io cloudevent
Then send a CloudEvent to it with: Then send a CloudEvent to it with:
```shell ```bash
$ curl \ $ curl \
-X POST -v \ -X POST -v \
-H "content-type: application/json" \ -H "content-type: application/json" \
@ -83,7 +83,7 @@ $ curl \
You can also send CloudEvents spawning a temporary curl pod in your cluster You can also send CloudEvents spawning a temporary curl pod in your cluster
with: with:
```shell ```bash
$ kubectl run curl \ $ kubectl run curl \
--image=curlimages/curl --rm=true --restart=Never -ti -- \ --image=curlimages/curl --rm=true --restart=Never -ti -- \
-X POST -v \ -X POST -v \
@ -98,7 +98,7 @@ $ kubectl run curl \
You'll see on the console: You'll see on the console:
```shell ```bash
> POST / HTTP/1.1 > POST / HTTP/1.1
> Host: localhost:8080 > Host: localhost:8080
> User-Agent: curl/7.69.1 > User-Agent: curl/7.69.1
@ -125,7 +125,7 @@ You'll see on the console:
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
@ -138,7 +138,7 @@ To remove the sample app from your cluster, delete the service:
Run: Run:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
@ -147,7 +147,7 @@ To remove the sample app from your cluster, delete the service:
Run: Run:
```shell ```bash
kn service delete cloudevents-spring kn service delete cloudevents-spring
``` ```

View File

@ -28,7 +28,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/cloudevents/cloudevents-vertx cd knative-docs/docs/serving/samples/cloudevents/cloudevents-vertx
``` ```
@ -45,7 +45,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-vertx
To build the image, run: To build the image, run:
```shell ```bash
mvn compile jib:build -Dimage=<image_name> mvn compile jib:build -Dimage=<image_name>
``` ```
@ -54,7 +54,7 @@ mvn compile jib:build -Dimage=<image_name>
To deploy the Knative Service, look in the `service.yaml` and replace `<image>` with the deployed image name. Then run: To deploy the Knative Service, look in the `service.yaml` and replace `<image>` with the deployed image name. Then run:
```shell ```bash
kubectl apply -f service.yaml kubectl apply -f service.yaml
``` ```
@ -63,7 +63,7 @@ mvn compile jib:build -Dimage=<image_name>
If using `kn` to deploy: If using `kn` to deploy:
```shell ```bash
kn service create cloudevents-vertx --image=<image> kn service create cloudevents-vertx --image=<image>
``` ```
@ -75,7 +75,7 @@ mvn compile jib:build -Dimage=<image_name>
Get the URL for your Service with: Get the URL for your Service with:
```shell ```bash
$ kubectl get ksvc $ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON NAME URL LATESTCREATED LATESTREADY READY REASON
cloudevents-vertx http://cloudevents-java.sslip.io cloudevents-vertx-86h28 cloudevents-vertx-86h28 True cloudevents-vertx http://cloudevents-java.sslip.io cloudevents-vertx-86h28 cloudevents-vertx-86h28 True
@ -83,7 +83,7 @@ cloudevents-vertx http://cloudevents-java.sslip.io cloudevents
Then send a CloudEvent to it with: Then send a CloudEvent to it with:
```shell ```bash
$ curl \ $ curl \
-X POST -v \ -X POST -v \
-H "content-type: application/json" \ -H "content-type: application/json" \
@ -98,7 +98,7 @@ $ curl \
You can also send CloudEvents spawning a temporary curl pod in your cluster You can also send CloudEvents spawning a temporary curl pod in your cluster
with: with:
```shell ```bash
$ kubectl run curl \ $ kubectl run curl \
--image=curlimages/curl --rm=true --restart=Never -ti -- \ --image=curlimages/curl --rm=true --restart=Never -ti -- \
-X POST -v \ -X POST -v \
@ -113,7 +113,7 @@ $ kubectl run curl \
You'll see on the console: You'll see on the console:
```shell ```bash
> POST / HTTP/1.1 > POST / HTTP/1.1
> Host: localhost:8080 > Host: localhost:8080
> User-Agent: curl/7.69.1 > User-Agent: curl/7.69.1
@ -145,7 +145,7 @@ To remove the sample app from your cluster, delete the service:
Run: Run:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
@ -154,6 +154,6 @@ To remove the sample app from your cluster, delete the service:
Run: Run:
```shell ```bash
kn service delete cloudevents-vertx kn service delete cloudevents-vertx
``` ```

View File

@ -21,10 +21,7 @@ You must meet the following requirements to run this sample:
cluster, see the [installation guides](../../../install/). cluster, see the [installation guides](../../../install/).
- Your Knative cluster must be - Your Knative cluster must be
[configured to use your custom domain](../../using-a-custom-domain.md). [configured to use your custom domain](../../using-a-custom-domain.md).
- You must ensure that your Knative cluster uses a static IP address: - You must ensure that your Knative cluster uses a static IP address refer to your provider's documentation.
- For Google Kubernetes Engine, see
[assigning a static IP address](../../gke-assigning-static-ip-address.md).
- For other cloud providers, refer to your provider's documentation.
- An installed version of [Docker](https://www.docker.com). - An installed version of [Docker](https://www.docker.com).
- A [Docker Hub account](https://hub.docker.com/) to which you are able to - A [Docker Hub account](https://hub.docker.com/) to which you are able to
upload your sample's container image. upload your sample's container image.
@ -33,7 +30,7 @@ You must meet the following requirements to run this sample:
1. Download a copy of the code: 1. Download a copy of the code:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/gitwebhook-go cd knative-docs/docs/serving/samples/gitwebhook-go
``` ```
@ -42,7 +39,7 @@ You must meet the following requirements to run this sample:
`{DOCKER_HUB_USERNAME}` with your Docker Hub username in the following `{DOCKER_HUB_USERNAME}` with your Docker Hub username in the following
commands. commands.
```shell ```bash
export DOCKER_HUB_USERNAME=username export DOCKER_HUB_USERNAME=username
# Build the container, run from the project folder # Build the container, run from the project folder
@ -66,7 +63,7 @@ You must meet the following requirements to run this sample:
1. Base64 encode the access token: 1. Base64 encode the access token:
```shell ```bash
$ echo -n "45d382d4a9a93c453fb7c8adc109121e7c29fa3ca" | base64 $ echo -n "45d382d4a9a93c453fb7c8adc109121e7c29fa3ca" | base64
NDVkMzgyZDRhOWE5M2M0NTNmYjdjOGFkYzEwOTEyMWU3YzI5ZmEzY2E= NDVkMzgyZDRhOWE5M2M0NTNmYjdjOGFkYzEwOTEyMWU3YzI5ZmEzY2E=
``` ```
@ -77,14 +74,14 @@ You must meet the following requirements to run this sample:
1. Create a webhook secret value unique to this sample, base64 encode it, and 1. Create a webhook secret value unique to this sample, base64 encode it, and
copy it into `github-secret.yaml` next to `webhookSecret:`: copy it into `github-secret.yaml` next to `webhookSecret:`:
```shell ```bash
$ echo -n "mygithubwebhooksecret" | base64 $ echo -n "mygithubwebhooksecret" | base64
bXlnaXRodWJ3ZWJob29rc2VjcmV0 bXlnaXRodWJ3ZWJob29rc2VjcmV0
``` ```
1. Apply the secret to your cluster: 1. Apply the secret to your cluster:
```shell ```bash
kubectl apply --filename github-secret.yaml kubectl apply --filename github-secret.yaml
``` ```
@ -118,13 +115,13 @@ You must meet the following requirements to run this sample:
1. Use `kubectl` to apply the `service.yaml` file. 1. Use `kubectl` to apply the `service.yaml` file.
```shell ```bash
$ kubectl apply --filename service.yaml $ kubectl apply --filename service.yaml
``` ```
Response: Response:
```shell ```bash
service "gitwebhook" created service "gitwebhook" created
``` ```
@ -133,14 +130,14 @@ You must meet the following requirements to run this sample:
1. Retrieve the hostname for this service, using the following command: 1. Retrieve the hostname for this service, using the following command:
```shell ```bash
$ kubectl get ksvc gitwebhook \ $ kubectl get ksvc gitwebhook \
--output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain --output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
``` ```
Example response: Example response:
```shell ```bash
NAME DOMAIN NAME DOMAIN
gitwebhook gitwebhook.default.MYCUSTOMDOMAIN.com gitwebhook gitwebhook.default.MYCUSTOMDOMAIN.com
``` ```
@ -173,7 +170,7 @@ You must meet the following requirements to run this sample:
Once deployed, you can inspect the created resources with `kubectl` commands: Once deployed, you can inspect the created resources with `kubectl` commands:
```shell ```bash
# This will show the Knative service that we created: # This will show the Knative service that we created:
kubectl get ksvc --output yaml kubectl get ksvc --output yaml
@ -198,6 +195,6 @@ right, you'll see the title of the PR will be modified, with the text
To clean up the sample service: To clean up the sample service:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -28,7 +28,7 @@ for production containers.
1. Download a copy of the code: 1. Download a copy of the code:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/grpc-ping-go cd knative-docs/docs/serving/samples/grpc-ping-go
``` ```
@ -37,7 +37,7 @@ for production containers.
Replace `{username}` with your Docker Hub username then run the commands: Replace `{username}` with your Docker Hub username then run the commands:
```shell ```bash
# Build the container on your local machine. # Build the container on your local machine.
docker build --tag "{username}/grpc-ping-go" . docker build --tag "{username}/grpc-ping-go" .
@ -68,13 +68,13 @@ for production containers.
4. Use `kubectl` to deploy the service. 4. Use `kubectl` to deploy the service.
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
Response: Response:
```shell ```bash
service "grpc-ping" created service "grpc-ping" created
``` ```
@ -82,7 +82,7 @@ for production containers.
Once deployed, you can inspect the created resources with `kubectl` commands: Once deployed, you can inspect the created resources with `kubectl` commands:
```shell ```bash
# This will show the Knative service that we created: # This will show the Knative service that we created:
kubectl get ksvc --output yaml kubectl get ksvc --output yaml
@ -107,7 +107,7 @@ entrypoint command to use the client binary instead of the server binary.
Replace `{username}` with your Docker Hub user name and run the command: Replace `{username}` with your Docker Hub user name and run the command:
```shell ```bash
docker run --rm {username}/grpc-ping-go \ docker run --rm {username}/grpc-ping-go \
/client \ /client \
-server_addr="grpc-ping.default.1.2.3.4.sslip.io:80" \ -server_addr="grpc-ping.default.1.2.3.4.sslip.io:80" \

View File

@ -15,7 +15,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-csharp cd knative-docs/docs/serving/samples/hello-world/helloworld-csharp
``` ```
@ -34,14 +34,14 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-csharp
1. First, make sure you have 1. First, make sure you have
[.NET Core SDK 3.1](https://www.microsoft.com/net/core) installed: [.NET Core SDK 3.1](https://www.microsoft.com/net/core) installed:
```shell ```bash
dotnet --version dotnet --version
3.1.100 3.1.100
``` ```
1. From the console, create a new empty web project using the dotnet command: 1. From the console, create a new empty web project using the dotnet command:
```shell ```bash
dotnet new web -o helloworld-csharp dotnet new web -o helloworld-csharp
``` ```
@ -146,7 +146,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-csharp . docker build -t {username}/helloworld-csharp .
@ -159,7 +159,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -181,7 +181,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-csharp.default.1.2.3.4.sslip.io curl http://helloworld-csharp.default.1.2.3.4.sslip.io
Hello C# Sample v1! Hello C# Sample v1!
``` ```
@ -190,6 +190,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -60,7 +60,7 @@ You will need:
You can also download a working copy of the sample, by running the You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-go cd knative-docs/docs/serving/samples/hello-world/helloworld-go
``` ```
@ -104,7 +104,7 @@ You will need:
1. Use the Go tool to create a 1. Use the Go tool to create a
[`go.mod`](https://github.com/golang/go/wiki/Modules#gomod) manifest. [`go.mod`](https://github.com/golang/go/wiki/Modules#gomod) manifest.
```shell ```bash
go mod init github.com/knative/docs/docs/serving/samples/hello-world/helloworld-go go mod init github.com/knative/docs/docs/serving/samples/hello-world/helloworld-go
``` ```
@ -112,7 +112,7 @@ You will need:
1. To build the sample code into a container, and push using Docker Hub, enter the following commands and replace `{username}` with your Docker Hub username: 1. To build the sample code into a container, and push using Docker Hub, enter the following commands and replace `{username}` with your Docker Hub username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-go . docker build -t {username}/helloworld-go .
@ -151,7 +151,7 @@ You will need:
1. Apply the configuration using `kubectl`: 1. Apply the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -164,13 +164,13 @@ You will need:
1. Run the following command to find the domain URL for your service: 1. Run the following command to find the domain URL for your service:
```shell ```bash
kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
helloworld-go http://helloworld-go.default.1.2.3.4.xip.io helloworld-go http://helloworld-go.default.1.2.3.4.xip.io
``` ```
@ -180,12 +180,12 @@ You will need:
Use `kn` to deploy the service: Use `kn` to deploy the service:
```shell ```bash
kn service create helloworld-go --image=docker.io/{username}/helloworld-go --env TARGET="Go Sample v1" kn service create helloworld-go --image=docker.io/{username}/helloworld-go --env TARGET="Go Sample v1"
``` ```
You should see output like this: You should see output like this:
```shell ```bash
Creating service 'helloworld-go' in namespace 'default': Creating service 'helloworld-go' in namespace 'default':
0.031s The Configuration is still working to reflect the latest desired specification. 0.031s The Configuration is still working to reflect the latest desired specification.
@ -213,7 +213,7 @@ You will need:
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-go.default.1.2.3.4.sslip.io curl http://helloworld-go.default.1.2.3.4.sslip.io
Hello Go Sample v1! Hello Go Sample v1!
``` ```
@ -226,11 +226,11 @@ To remove the sample app from your cluster, delete the service record:
=== "kubectl" === "kubectl"
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
=== "kn" === "kn"
```shell ```bash
kn service delete helloworld-go kn service delete helloworld-go
``` ```

View File

@ -26,14 +26,14 @@ If `TARGET` is not specified, `World` is used as the default value.
You can also download a working copy of the sample, by running the You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-java cd knative-docs/docs/serving/samples/hello-world/helloworld-java
``` ```
1. Run the application locally: 1. Run the application locally:
```shell ```bash
./mvnw package && java -jar target/helloworld-0.0.1-SNAPSHOT-jar-with-dependencies.jar ./mvnw package && java -jar target/helloworld-0.0.1-SNAPSHOT-jar-with-dependencies.jar
``` ```
@ -68,7 +68,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-java
1. To build the sample code into a container, and push using Docker Hub, enter the following commands and replace `{username}` with your Docker Hub username: 1. To build the sample code into a container, and push using Docker Hub, enter the following commands and replace `{username}` with your Docker Hub username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-java . docker build -t {username}/helloworld-java .
# Push the container to docker registry # Push the container to docker registry
@ -85,7 +85,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-java
Use `kn` to deploy the service, make sure to replace `{username}` with your Docker Hub username: Use `kn` to deploy the service, make sure to replace `{username}` with your Docker Hub username:
```shell ```bash
kn service create helloworld-java --image=docker.io/{username}/helloworld-java --env TARGET="SparkJava Sample v1" kn service create helloworld-java --image=docker.io/{username}/helloworld-java --env TARGET="SparkJava Sample v1"
``` ```
@ -116,7 +116,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-java
1. Ensure that the container image value in `service.yaml` matches the container you built in the previous step. Apply the configuration using `kubectl`: 1. Ensure that the container image value in `service.yaml` matches the container you built in the previous step. Apply the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -138,24 +138,24 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-java
=== "kn" === "kn"
```shell ```bash
kn service describe helloworld-java -o url kn service describe helloworld-java -o url
``` ```
Example: Example:
```shell ```bash
http://helloworld-java.default.1.2.3.4.xip.io http://helloworld-java.default.1.2.3.4.xip.io
``` ```
=== "kubectl" === "kubectl"
```shell ```bash
kubectl get ksvc helloworld-java --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-java --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
helloworld-java http://helloworld-java.default.1.2.3.4.xip.io helloworld-java http://helloworld-java.default.1.2.3.4.xip.io
``` ```
@ -169,7 +169,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-java
Example: Example:
```shell ```bash
curl http://helloworld-java.default.1.2.3.4.sslip.io curl http://helloworld-java.default.1.2.3.4.sslip.io
Hello SparkJava Sample v1! Hello SparkJava Sample v1!
# Even easier with kn: # Even easier with kn:
@ -184,11 +184,11 @@ To remove the sample app from your cluster, delete the service record.
=== "kn" === "kn"
```shell ```bash
kn service delete helloworld-java kn service delete helloworld-java
``` ```
=== "kubectl" === "kubectl"
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -15,7 +15,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-kotlin cd knative-docs/docs/serving/samples/hello-world/helloworld-kotlin
``` ```
@ -32,7 +32,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-kotlin
1. Create a new directory and cd into it: 1. Create a new directory and cd into it:
```shell ```bash
mkdir hello mkdir hello
cd hello cd hello
``` ```
@ -40,7 +40,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-kotlin
2. Create a file named `Main.kt` at `src/main/kotlin/com/example/hello` and copy 2. Create a file named `Main.kt` at `src/main/kotlin/com/example/hello` and copy
the code block below into it: the code block below into it:
```shell ```bash
mkdir -p src/main/kotlin/com/example/hello mkdir -p src/main/kotlin/com/example/hello
``` ```
@ -150,7 +150,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-kotlin . docker build -t {username}/helloworld-kotlin .
@ -163,7 +163,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -176,7 +176,7 @@ folder) you're ready to build and deploy the sample app.
1. To find the URL for your service, use 1. To find the URL for your service, use
```shell ```bash
kubectl get ksvc helloworld-kotlin --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-kotlin --output=custom-columns=NAME:.metadata.name,URL:.status.url
NAME URL NAME URL
@ -186,7 +186,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-kotlin.default.1.2.3.4.sslip.io curl http://helloworld-kotlin.default.1.2.3.4.sslip.io
Hello Kotlin Sample v1! Hello Kotlin Sample v1!
``` ```
@ -195,6 +195,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -15,7 +15,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-nodejs cd knative-docs/docs/serving/samples/hello-world/helloworld-nodejs
``` ```
@ -33,7 +33,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-nodejs
1. Create a new directory and initialize `npm`: 1. Create a new directory and initialize `npm`:
```shell ```bash
npm init npm init
package name: (helloworld-nodejs) package name: (helloworld-nodejs)
@ -49,7 +49,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-nodejs
1. Install the `express` package: 1. Install the `express` package:
```shell ```bash
npm install express npm install express
``` ```
@ -158,7 +158,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-nodejs . docker build -t {username}/helloworld-nodejs .
@ -171,7 +171,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -193,7 +193,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-nodejs.default.1.2.3.4.sslip.io curl http://helloworld-nodejs.default.1.2.3.4.sslip.io
Hello Node.js Sample v1! Hello Node.js Sample v1!
``` ```
@ -202,6 +202,6 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -15,7 +15,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-php cd knative-docs/docs/serving/samples/hello-world/helloworld-php
``` ```
@ -32,7 +32,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-php
1. Create a new directory and cd into it: 1. Create a new directory and cd into it:
```shell ```bash
mkdir app mkdir app
cd app cd app
``` ```
@ -106,7 +106,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-php . docker build -t {username}/helloworld-php .
@ -119,7 +119,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -128,7 +128,7 @@ folder) you're ready to build and deploy the sample app.
With `kn` you can deploy the service with With `kn` you can deploy the service with
```shell ```bash
kn service create helloworld-php --image=docker.io/{username}/helloworld-php --env TARGET="Ruby Sample v1" kn service create helloworld-php --image=docker.io/{username}/helloworld-php --env TARGET="Ruby Sample v1"
``` ```
@ -176,13 +176,13 @@ folder) you're ready to build and deploy the sample app.
=== "kn" === "kn"
```shell ```bash
kn service describe helloworld-php -o url kn service describe helloworld-php -o url
``` ```
Example: Example:
```shell ```bash
http://helloworld-php.default.1.2.3.4.xip.io http://helloworld-php.default.1.2.3.4.xip.io
``` ```
@ -192,7 +192,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://helloworld-php.default.1.2.3.4.sslip.io curl http://helloworld-php.default.1.2.3.4.sslip.io
Hello PHP Sample v1! Hello PHP Sample v1!
``` ```
@ -203,12 +203,12 @@ To remove the sample app from your cluster, delete the service record.
=== "kubectl" === "kubectl"
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
=== "kn" === "kn"
```shell ```bash
kn service delete helloworld-php kn service delete helloworld-php
``` ```

View File

@ -17,7 +17,7 @@ value.
You can also download a working copy of the sample, by running the following You can also download a working copy of the sample, by running the following
commands: commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-python cd knative-docs/docs/serving/samples/hello-world/helloworld-python
``` ```
@ -37,7 +37,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-python
1. Create a new directory and cd into it: 1. Create a new directory and cd into it:
```shell ```bash
mkdir app mkdir app
cd app cd app
``` ```
@ -107,7 +107,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-python
1. Use Docker to build the sample code into a container, then push the container 1. Use Docker to build the sample code into a container, then push the container
to the Docker registry: to the Docker registry:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-python . docker build -t {username}/helloworld-python .
@ -145,7 +145,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-python
Ensure that the container image value in `service.yaml` matches the container Ensure that the container image value in `service.yaml` matches the container
you built in the previous step. Apply the configuration using `kubectl`: you built in the previous step. Apply the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -153,7 +153,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-python
With `kn` you can deploy the service with With `kn` you can deploy the service with
```shell ```bash
kn service create helloworld-python --image=docker.io/{username}/helloworld-python --env TARGET="Python Sample v1" kn service create helloworld-python --image=docker.io/{username}/helloworld-python --env TARGET="Python Sample v1"
``` ```
@ -179,26 +179,26 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-python
=== "kubectl" === "kubectl"
```shell ```bash
kubectl get ksvc helloworld-python --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-python --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
helloworld-python http://helloworld-python.default.1.2.3.4.sslip.io helloworld-python http://helloworld-python.default.1.2.3.4.sslip.io
``` ```
=== "kn" === "kn"
```shell ```bash
kn service describe helloworld-python -o url kn service describe helloworld-python -o url
``` ```
Example: Example:
```shell ```bash
http://helloworld-python.default.1.2.3.4.sslip.io http://helloworld-python.default.1.2.3.4.sslip.io
``` ```
@ -210,7 +210,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-python
Example: Example:
```shell ```bash
curl http://helloworld-python.default.1.2.3.4.sslip.io curl http://helloworld-python.default.1.2.3.4.sslip.io
Hello Python Sample v1! Hello Python Sample v1!
@ -226,12 +226,12 @@ To remove the sample app from your cluster, delete the service record.
=== "kubectl" === "kubectl"
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
=== "kn" === "kn"
```shell ```bash
kn service delete helloworld-python kn service delete helloworld-python
``` ```

View File

@ -15,7 +15,7 @@ If `TARGET` is not specified, `World` is used as the default value.
You can also download a working copy of the sample, by running the You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
``` ```
@ -32,7 +32,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
1. Create a new directory and cd into it: 1. Create a new directory and cd into it:
```shell ```bash
mkdir app mkdir app
cd app cd app
``` ```
@ -84,7 +84,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
1. Run bundle. If you don't have bundler installed, copy the 1. Run bundle. If you don't have bundler installed, copy the
[Gemfile.lock](./Gemfile.lock) to your working directory. [Gemfile.lock](./Gemfile.lock) to your working directory.
```shell ```bash
bundle install bundle install
``` ```
@ -140,7 +140,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -149,7 +149,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
With `kn` you can deploy the service with With `kn` you can deploy the service with
```shell ```bash
kn service create helloworld-ruby --image=docker.io/{username}/helloworld-ruby --env TARGET="Ruby Sample v1" kn service create helloworld-ruby --image=docker.io/{username}/helloworld-ruby --env TARGET="Ruby Sample v1"
``` ```
@ -189,13 +189,13 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
=== "kubectl" === "kubectl"
```shell ```bash
kubectl get ksvc helloworld-ruby --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-ruby --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
helloworld-ruby http://helloworld-ruby.default.1.2.3.4.sslip.io helloworld-ruby http://helloworld-ruby.default.1.2.3.4.sslip.io
``` ```
@ -203,13 +203,13 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
=== "kn" === "kn"
```shell ```bash
kn service describe helloworld-ruby -o url kn service describe helloworld-ruby -o url
``` ```
Example: Example:
```shell ```bash
http://helloworld-ruby.default.1.2.3.4.sslip.io http://helloworld-ruby.default.1.2.3.4.sslip.io
``` ```
@ -221,7 +221,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-ruby
Example: Example:
```shell ```bash
curl http://helloworld-ruby.default.1.2.3.4.sslip.io curl http://helloworld-ruby.default.1.2.3.4.sslip.io
Hello Ruby Sample v1! Hello Ruby Sample v1!
@ -238,12 +238,12 @@ To remove the sample app from your cluster, delete the service record.
=== "kubectl" === "kubectl"
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
=== "kn" === "kn"
```shell ```bash
kn service delete helloworld-ruby kn service delete helloworld-ruby
``` ```

View File

@ -17,7 +17,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-scala cd knative-docs/docs/serving/samples/hello-world/helloworld-scala
``` ```
@ -41,7 +41,7 @@ If you want to use your Docker Hub repository, set the repository to
If you use Minikube, you first need to run: If you use Minikube, you first need to run:
```shell ```bash
eval $(minikube docker-env) eval $(minikube docker-env)
``` ```
@ -49,7 +49,7 @@ If want to use the Docker Repository inside Minikube, either set this to
"dev.local" or if you want to use another repository name, then you need to run "dev.local" or if you want to use another repository name, then you need to run
the following command after `docker:publishLocal`: the following command after `docker:publishLocal`:
```shell ```bash
docker tag yourreponame/helloworld-scala:<version> dev.local/helloworld-scala:<version> docker tag yourreponame/helloworld-scala:<version> dev.local/helloworld-scala:<version>
``` ```
@ -93,13 +93,13 @@ spec:
In order to build the project and create and push the Docker image, run either: In order to build the project and create and push the Docker image, run either:
```shell ```bash
sbt docker:publishLocal sbt docker:publishLocal
``` ```
or or
```shell ```bash
sbt docker:publish sbt docker:publish
``` ```
@ -166,19 +166,19 @@ local Docker Repository.
=== "kn" === "kn"
```shell ```bash
kn service describe helloworld-scala -o url kn service describe helloworld-scala -o url
``` ```
Example: Example:
```shell ```bash
http://helloworld-scala.default.1.2.3.4.sslip.io http://helloworld-scala.default.1.2.3.4.sslip.io
``` ```
Finally, to try your service, use the obtained URL: Finally, to try your service, use the obtained URL:
```shell ```bash
curl -v http://helloworld-scala.default.1.2.3.4.sslip.io curl -v http://helloworld-scala.default.1.2.3.4.sslip.io
``` ```

View File

@ -16,7 +16,7 @@ If `TARGET` is not specified, `World` is used as the default value.
You can also download a working copy of the sample, by running the You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-shell cd knative-docs/docs/serving/samples/hello-world/helloworld-shell
``` ```
@ -33,7 +33,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-shell
1. Create a new file named `script.sh` and paste the script below. This will run BusyBox' `http` returning a friendly welcome message as `plain/text` plus some extra information: 1. Create a new file named `script.sh` and paste the script below. This will run BusyBox' `http` returning a friendly welcome message as `plain/text` plus some extra information:
```shell ```bash
#!/bin/sh #!/bin/sh
# Print out CGI header # Print out CGI header
@ -77,7 +77,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/helloworld-shell . docker build -t {username}/helloworld-shell .
@ -117,7 +117,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -126,7 +126,7 @@ folder) you're ready to build and deploy the sample app.
With `kn` you can deploy the service with With `kn` you can deploy the service with
```shell ```bash
kn service create helloworld-shell --image=docker.io/{username}/helloworld-shell --env TARGET="Shell Sample v1" kn service create helloworld-shell --image=docker.io/{username}/helloworld-shell --env TARGET="Shell Sample v1"
``` ```
@ -166,13 +166,13 @@ folder) you're ready to build and deploy the sample app.
=== "kubectl" === "kubectl"
```shell ```bash
kubectl get ksvc helloworld-shell --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc helloworld-shell --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
helloworld-shell http://helloworld-shell.default.1.2.3.4.sslip.io helloworld-shell http://helloworld-shell.default.1.2.3.4.sslip.io
``` ```
@ -180,13 +180,13 @@ folder) you're ready to build and deploy the sample app.
=== "kn" === "kn"
```shell ```bash
kn service describe helloworld-shell -o url kn service describe helloworld-shell -o url
``` ```
Example: Example:
```shell ```bash
http://helloworld-shell.default.1.2.3.4.sslip.io http://helloworld-shell.default.1.2.3.4.sslip.io
``` ```
@ -198,7 +198,7 @@ folder) you're ready to build and deploy the sample app.
Example: Example:
```shell ```bash
curl http://helloworld-shell.default.1.2.3.4.sslip.io curl http://helloworld-shell.default.1.2.3.4.sslip.io
Hello Shell Sample v1! Hello Shell Sample v1!
@ -214,11 +214,11 @@ To remove the sample app from your cluster, delete the service record.
=== "kubectl" === "kubectl"
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```
=== "kn" === "kn"
```shell ```bash
kn service delete helloworld-shell kn service delete helloworld-shell
``` ```

View File

@ -53,7 +53,7 @@ Build the application container and publish it to a container registry:
1. Move into the sample directory: 1. Move into the sample directory:
```shell ```bash
cd $GOPATH/src/github.com/knative/docs cd $GOPATH/src/github.com/knative/docs
``` ```
@ -63,14 +63,14 @@ If you use Google Container Registry (GCR), you will need to enable the
[GCR API](https://console.cloud.google.com/apis/library/containerregistry.googleapis.com) [GCR API](https://console.cloud.google.com/apis/library/containerregistry.googleapis.com)
in your GCP project. in your GCP project.
```shell ```bash
export REPO="gcr.io/<YOUR_PROJECT_ID>" export REPO="gcr.io/<YOUR_PROJECT_ID>"
``` ```
If you use Docker Hub as your docker image registry, replace <username> with If you use Docker Hub as your docker image registry, replace <username> with
your dockerhub username and run the following command: your dockerhub username and run the following command:
```shell ```bash
export REPO="docker.io/<username>" export REPO="docker.io/<username>"
``` ```
@ -145,7 +145,7 @@ You should see 2 Knative services: `search-service` and `login-service`.
1. Find the shared Gateway IP and export as an environment variable: 1. Find the shared Gateway IP and export as an environment variable:
```shell ```bash
INGRESSGATEWAY=istio-ingressgateway INGRESSGATEWAY=istio-ingressgateway
export GATEWAY_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system \ export GATEWAY_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system \
@ -154,7 +154,7 @@ export GATEWAY_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system \
2. Find the `Search` service URL with: 2. Find the `Search` service URL with:
```shell ```bash
# kubectl get route search-service --output=custom-columns=NAME:.metadata.name,URL:.status.url # kubectl get route search-service --output=custom-columns=NAME:.metadata.name,URL:.status.url
NAME URL NAME URL
search-service http://search-service.default.example.com search-service http://search-service.default.example.com
@ -162,7 +162,7 @@ search-service http://search-service.default.example.com
3. Make a curl request to the service: 3. Make a curl request to the service:
```shell ```bash
curl http://${GATEWAY_IP} --header "Host:search-service.default.example.com" curl http://${GATEWAY_IP} --header "Host:search-service.default.example.com"
``` ```
@ -170,7 +170,7 @@ You should see: `Search Service is called !`
4. Similarly, you can also directly access "Login" service with: 4. Similarly, you can also directly access "Login" service with:
```shell ```bash
curl http://${GATEWAY_IP} --header "Host:login-service.default.example.com" curl http://${GATEWAY_IP} --header "Host:login-service.default.example.com"
``` ```
@ -218,7 +218,7 @@ kubectl get VirtualService entry-route --output yaml
corresponding URIs. You should get the same results as directly accessing corresponding URIs. You should get the same results as directly accessing
these services. Get the ingress IP: these services. Get the ingress IP:
```shell ```bash
INGRESSGATEWAY=istio-ingressgateway INGRESSGATEWAY=istio-ingressgateway
export GATEWAY_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system \ export GATEWAY_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system \
@ -227,13 +227,13 @@ kubectl get VirtualService entry-route --output yaml
* Send a request to the Search service: * Send a request to the Search service:
```shell ```bash
curl http://${GATEWAY_IP}/search --header "Host: example.com" curl http://${GATEWAY_IP}/search --header "Host: example.com"
``` ```
or or
```shell ```bash
curl http://${GATEWAY_IP}/search --header "Host: <YOUR_DOMAIN_NAME>" curl http://${GATEWAY_IP}/search --header "Host: <YOUR_DOMAIN_NAME>"
``` ```
@ -241,13 +241,13 @@ kubectl get VirtualService entry-route --output yaml
* Send a request to the Login service: * Send a request to the Login service:
```shell ```bash
curl http://${GATEWAY_IP}/login --header "Host: example.com" curl http://${GATEWAY_IP}/login --header "Host: example.com"
``` ```
or or
```shell ```bash
curl http://${GATEWAY_IP}/login --header "Host: <YOUR_DOMAIN_NAME>" curl http://${GATEWAY_IP}/login --header "Host: <YOUR_DOMAIN_NAME>"
``` ```
@ -305,7 +305,7 @@ VirtualService requests from HTTP to HTTPS, failing the request.
To clean up the sample resources: To clean up the sample resources:
```shell ```bash
kubectl delete --filename docs/serving/samples/knative-routing-go/sample.yaml kubectl delete --filename docs/serving/samples/knative-routing-go/sample.yaml
kubectl delete --filename docs/serving/samples/knative-routing-go/routing.yaml kubectl delete --filename docs/serving/samples/knative-routing-go/routing.yaml
``` ```

View File

@ -24,7 +24,7 @@ cluster.
You can download a working copy of the sample, by entering the You can download a working copy of the sample, by entering the
following command: following command:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
``` ```
@ -185,13 +185,13 @@ You can do this by copying the following code into the `sidecarcontainer.go` fil
[`go.mod`](https://github.com/golang/go/wiki/Modules#gomod) manifest: [`go.mod`](https://github.com/golang/go/wiki/Modules#gomod) manifest:
servingcontainer servingcontainer
```shell ```bash
cd - cd -
cd knative-docs/docs/serving/samples/multi-container/servingcontainer cd knative-docs/docs/serving/samples/multi-container/servingcontainer
go mod init github.com/knative/docs/docs/serving/samples/multi-container/servingcontainer go mod init github.com/knative/docs/docs/serving/samples/multi-container/servingcontainer
``` ```
sidecarcontainer sidecarcontainer
```shell ```bash
cd - cd -
cd knative-docs/docs/serving/samples/multi-container/sidecarcontainer cd knative-docs/docs/serving/samples/multi-container/sidecarcontainer
go mod init github.com/knative/docs/docs/serving/samples/multi-container/sidecarcontainer go mod init github.com/knative/docs/docs/serving/samples/multi-container/sidecarcontainer
@ -205,7 +205,7 @@ After you have modified the sample code files you can build and deploy the sampl
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
cd - cd -
cd knative-docs/docs/serving/samples/multi-container/servingcontainer cd knative-docs/docs/serving/samples/multi-container/servingcontainer
@ -223,7 +223,7 @@ After you have modified the sample code files you can build and deploy the sampl
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
cd - cd -
cd knative-docs/docs/serving/samples/multi-container cd knative-docs/docs/serving/samples/multi-container
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
@ -238,13 +238,13 @@ After you have modified the sample code files you can build and deploy the sampl
1. Run the following command to find the domain URL for your service: 1. Run the following command to find the domain URL for your service:
```shell ```bash
kubectl get ksvc multi-container --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc multi-container --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
multi-container http://multi-container.default.1.2.3.4.sslip.io multi-container http://multi-container.default.1.2.3.4.sslip.io
``` ```
@ -252,7 +252,7 @@ After you have modified the sample code files you can build and deploy the sampl
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://multi-container.default.1.2.3.4.sslip.io curl http://multi-container.default.1.2.3.4.sslip.io
Yay!! multi-container works Yay!! multi-container works
``` ```
@ -263,6 +263,6 @@ After you have modified the sample code files you can build and deploy the sampl
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
``` ```

View File

@ -23,7 +23,7 @@ like `AAPL`,`AMZN`, `GOOG`, `MSFT`, etc.
[Homebrew](https://brew.sh/) on OS X. [Homebrew](https://brew.sh/) on OS X.
1. Download a copy of the code: 1. Download a copy of the code:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs cd knative-docs
``` ```
@ -43,7 +43,7 @@ To build and push to a container registry using Docker:
This sample uses This sample uses
[Google Container Registry (GCR)](https://cloud.google.com/container-registry/): [Google Container Registry (GCR)](https://cloud.google.com/container-registry/):
```shell ```bash
export REPO="gcr.io/<YOUR_PROJECT_ID>" export REPO="gcr.io/<YOUR_PROJECT_ID>"
``` ```
@ -64,7 +64,7 @@ To build and push to a container registry using Docker:
1. Use Docker to build your application container: 1. Use Docker to build your application container:
```shell ```bash
docker build \ docker build \
--tag "${REPO}/rest-api-go" \ --tag "${REPO}/rest-api-go" \
--file docs/serving/samples/rest-api-go/Dockerfile . --file docs/serving/samples/rest-api-go/Dockerfile .
@ -72,7 +72,7 @@ To build and push to a container registry using Docker:
1. Push your container to a container registry: 1. Push your container to a container registry:
```shell ```bash
docker push "${REPO}/rest-api-go" docker push "${REPO}/rest-api-go"
``` ```
@ -80,7 +80,7 @@ To build and push to a container registry using Docker:
path. The command below substitutes using the \${REPO} variable into a new path. The command below substitutes using the \${REPO} variable into a new
file called `docs/serving/samples/rest-api-go/sample.yaml`. file called `docs/serving/samples/rest-api-go/sample.yaml`.
```shell ```bash
envsubst < docs/serving/samples/rest-api-go/sample-template.yaml > \ envsubst < docs/serving/samples/rest-api-go/sample-template.yaml > \
docs/serving/samples/rest-api-go/sample.yaml docs/serving/samples/rest-api-go/sample.yaml
``` ```
@ -90,7 +90,7 @@ To build and push to a container registry using Docker:
Now that our image is available from the container registry, we can deploy the Now that our image is available from the container registry, we can deploy the
Knative Serving sample: Knative Serving sample:
```shell ```bash
kubectl apply --filename docs/serving/samples/rest-api-go/sample.yaml kubectl apply --filename docs/serving/samples/rest-api-go/sample.yaml
``` ```
@ -111,41 +111,41 @@ You can inspect the created resources with the following `kubectl` commands:
- View the created Service resource: - View the created Service resource:
```shell ```bash
kubectl get ksvc stock-service-example --output yaml kubectl get ksvc stock-service-example --output yaml
``` ```
- View the created Route resource: - View the created Route resource:
```shell ```bash
kubectl get route -l \ kubectl get route -l \
"serving.knative.dev/service=stock-service-example" --output yaml "serving.knative.dev/service=stock-service-example" --output yaml
``` ```
- View the Kubernetes Service created by the Route - View the Kubernetes Service created by the Route
```shell ```bash
kubectl get service -l \ kubectl get service -l \
"serving.knative.dev/service=stock-service-example" --output yaml "serving.knative.dev/service=stock-service-example" --output yaml
``` ```
- View the created Configuration resource: - View the created Configuration resource:
```shell ```bash
kubectl get configuration -l \ kubectl get configuration -l \
"serving.knative.dev/service=stock-service-example" --output yaml "serving.knative.dev/service=stock-service-example" --output yaml
``` ```
- View the Revision that was created by our Configuration: - View the Revision that was created by our Configuration:
```shell ```bash
kubectl get revision -l \ kubectl get revision -l \
"serving.knative.dev/service=stock-service-example" --output yaml "serving.knative.dev/service=stock-service-example" --output yaml
``` ```
- View the Deployment created by our Revision - View the Deployment created by our Revision
```shell ```bash
kubectl get deployment -l \ kubectl get deployment -l \
"serving.knative.dev/service=stock-service-example" --output yaml "serving.knative.dev/service=stock-service-example" --output yaml
``` ```
@ -157,7 +157,7 @@ and then you run `curl` commands to send request with your stock symbol.
1. Get the URL of the service: 1. Get the URL of the service:
```shell ```bash
kubectl get ksvc stock-service-example --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc stock-service-example --output=custom-columns=NAME:.metadata.name,URL:.status.url
NAME URL NAME URL
stock-service-example http://stock-service-example.default.1.2.3.4.sslip.io stock-service-example http://stock-service-example.default.1.2.3.4.sslip.io
@ -167,7 +167,7 @@ and then you run `curl` commands to send request with your stock symbol.
1. Send a request to the index endpoint: 1. Send a request to the index endpoint:
```shell ```bash
curl http://stock-service-example.default.1.2.3.4.sslip.io curl http://stock-service-example.default.1.2.3.4.sslip.io
``` ```
@ -175,7 +175,7 @@ and then you run `curl` commands to send request with your stock symbol.
2. Send a request to the `/stock` endpoint: 2. Send a request to the `/stock` endpoint:
```shell ```bash
curl http://stock-service-example.default.1.2.3.4.sslip.io/stock curl http://stock-service-example.default.1.2.3.4.sslip.io/stock
``` ```
@ -184,7 +184,7 @@ and then you run `curl` commands to send request with your stock symbol.
3. Send a request to the `/stock` endpoint with your 3. Send a request to the `/stock` endpoint with your
"[stock symbol](https://www.marketwatch.com/tools/quotes/lookup.asp)": "[stock symbol](https://www.marketwatch.com/tools/quotes/lookup.asp)":
```shell ```bash
curl http://stock-service-example.default.1.2.3.4.sslip.io/stock/<SYMBOL> curl http://stock-service-example.default.1.2.3.4.sslip.io/stock/<SYMBOL>
``` ```
@ -196,7 +196,7 @@ and then you run `curl` commands to send request with your stock symbol.
Request: Request:
```shell ```bash
curl http://stock-service-example.default.1.2.3.4.sslip.io/stock/FAKE curl http://stock-service-example.default.1.2.3.4.sslip.io/stock/FAKE
``` ```
@ -212,6 +212,6 @@ splitting between those Revisions.
To clean up the sample Service: To clean up the sample Service:
```shell ```bash
kubectl delete --filename docs/serving/samples/rest-api-go/sample.yaml kubectl delete --filename docs/serving/samples/rest-api-go/sample.yaml
``` ```

View File

@ -16,7 +16,7 @@ Follow the steps below to create the sample code and then deploy the app to your
cluster. You can also download a working copy of the sample, by running the cluster. You can also download a working copy of the sample, by running the
following commands: following commands:
```shell ```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/secrets-go cd knative-docs/docs/serving/samples/secrets-go
``` ```
@ -132,20 +132,20 @@ cd knative-docs/docs/serving/samples/secrets-go
This Service Account doesn't need any privileges, the GCS bucket has been This Service Account doesn't need any privileges, the GCS bucket has been
configured so that any authenticated identity may read it. configured so that any authenticated identity may read it.
```shell ```bash
gcloud iam service-accounts create knative-secrets gcloud iam service-accounts create knative-secrets
``` ```
1. Create a new JSON key for this account 1. Create a new JSON key for this account
```shell ```bash
gcloud iam service-accounts keys create robot.json \ gcloud iam service-accounts keys create robot.json \
--iam-account=knative-secrets@$PROJECT_ID.iam.gserviceaccount.com --iam-account=knative-secrets@$PROJECT_ID.iam.gserviceaccount.com
``` ```
1. Create a new Kubernetes secret from this JSON key: 1. Create a new Kubernetes secret from this JSON key:
```shell ```bash
kubectl create secret generic google-robot-secret --from-file=./robot.json kubectl create secret generic google-robot-secret --from-file=./robot.json
``` ```
@ -205,7 +205,7 @@ folder) you're ready to build and deploy the sample app.
Docker Hub, run these commands replacing `{username}` with your Docker Hub Docker Hub, run these commands replacing `{username}` with your Docker Hub
username: username:
```shell ```bash
# Build the container on your local machine # Build the container on your local machine
docker build -t {username}/secrets-go . docker build -t {username}/secrets-go .
@ -218,7 +218,7 @@ folder) you're ready to build and deploy the sample app.
in `service.yaml` matches the container you built in the previous step. Apply in `service.yaml` matches the container you built in the previous step. Apply
the configuration using `kubectl`: the configuration using `kubectl`:
```shell ```bash
kubectl apply --filename service.yaml kubectl apply --filename service.yaml
``` ```
@ -231,13 +231,13 @@ folder) you're ready to build and deploy the sample app.
1. Run the following command to find the domain URL for your service: 1. Run the following command to find the domain URL for your service:
```shell ```bash
kubectl get ksvc secrets-go --output=custom-columns=NAME:.metadata.name,URL:.status.url kubectl get ksvc secrets-go --output=custom-columns=NAME:.metadata.name,URL:.status.url
``` ```
Example: Example:
```shell ```bash
NAME URL NAME URL
secrets-go http://secrets-go.default.1.2.3.4.sslip.io secrets-go http://secrets-go.default.1.2.3.4.sslip.io
``` ```
@ -245,7 +245,7 @@ folder) you're ready to build and deploy the sample app.
1. Now you can make a request to your app and see the result. Replace 1. Now you can make a request to your app and see the result. Replace
the URL below with the URL returned in the previous command. the URL below with the URL returned in the previous command.
```shell ```bash
curl http://secrets-go.default.1.2.3.4.sslip.io curl http://secrets-go.default.1.2.3.4.sslip.io
bucket knative-secrets-sample, created at 2019-02-01 14:44:05.804 +0000 UTC, is located in US with storage class MULTI_REGIONAL bucket knative-secrets-sample, created at 2019-02-01 14:44:05.804 +0000 UTC, is located in US with storage class MULTI_REGIONAL
``` ```
@ -256,7 +256,7 @@ folder) you're ready to build and deploy the sample app.
To remove the sample app from your cluster, delete the service record: To remove the sample app from your cluster, delete the service record:
```shell ```bash
kubectl delete --filename service.yaml kubectl delete --filename service.yaml
kubectl delete secret google-robot-secret kubectl delete secret google-robot-secret
``` ```

View File

@ -23,7 +23,7 @@ with Knative version 0.16 and above.
1. Move into the docs directory: 1. Move into the docs directory:
```shell ```bash
cd $GOPATH/src/github.com/knative/docs cd $GOPATH/src/github.com/knative/docs
``` ```

View File

@ -142,7 +142,7 @@ extending our `traffic` list, and splitting the `percent` across them.
split evenly between `Welcome to the share app!` and split evenly between `Welcome to the share app!` and
`Welcome to the stock app!`. `Welcome to the stock app!`.
```shell ```bash
curl --header "Host:${SERVICE_HOSTNAME}" http://${INGRESS_IP} curl --header "Host:${SERVICE_HOSTNAME}" http://${INGRESS_IP}
``` ```

View File

@ -52,7 +52,7 @@ spec:
Update gateway instance `knative-ingress-gateway` under `knative-serving` Update gateway instance `knative-ingress-gateway` under `knative-serving`
namespace: namespace:
```shell ```bash
kubectl edit gateway knative-ingress-gateway -n knative-serving kubectl edit gateway knative-ingress-gateway -n knative-serving
``` ```
@ -76,7 +76,7 @@ If there is a change in service ports (compared with that of
Update gateway configmap `config-istio` under `knative-serving` Update gateway configmap `config-istio` under `knative-serving`
namespace: namespace:
```shell ```bash
kubectl edit configmap config-istio -n knative-serving kubectl edit configmap config-istio -n knative-serving
``` ```

View File

@ -18,7 +18,7 @@ To change the {default-domain} value there are a few steps involved:
1. Edit the domain configuration config-map to replace `example.com` with your 1. Edit the domain configuration config-map to replace `example.com` with your
own domain, for example `mydomain.com`: own domain, for example `mydomain.com`:
```shell ```bash
kubectl edit cm config-domain --namespace knative-serving kubectl edit cm config-domain --namespace knative-serving
``` ```
@ -79,7 +79,7 @@ You can also apply an updated domain configuration:
1. Apply updated domain configuration to your cluster: 1. Apply updated domain configuration to your cluster:
```shell ```bash
kubectl apply --filename config-domain.yaml kubectl apply --filename config-domain.yaml
``` ```
@ -94,7 +94,7 @@ Deploy an app (for example,
cluster as normal. You can retrieve the URL in Knative Route "helloworld-go" cluster as normal. You can retrieve the URL in Knative Route "helloworld-go"
with the following command: with the following command:
```shell ```bash
kubectl get route helloworld-go --output jsonpath="{.status.url}" kubectl get route helloworld-go --output jsonpath="{.status.url}"
``` ```
@ -102,7 +102,7 @@ You should see the full customized domain: `helloworld-go.default.mydomain.com`.
And you can check the IP address of your Knative gateway by running: And you can check the IP address of your Knative gateway by running:
```shell ```bash
export INGRESSGATEWAY=istio-ingressgateway export INGRESSGATEWAY=istio-ingressgateway
if kubectl get configmap config-istio -n knative-serving &> /dev/null; then if kubectl get configmap config-istio -n knative-serving &> /dev/null; then
@ -117,7 +117,7 @@ kubectl get svc $INGRESSGATEWAY --namespace istio-system --output jsonpath="{.st
You can map the domain to the IP address of your Knative gateway in your local You can map the domain to the IP address of your Knative gateway in your local
machine with: machine with:
```shell ```bash
INGRESSGATEWAY=istio-ingressgateway INGRESSGATEWAY=istio-ingressgateway
export GATEWAY_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system --output jsonpath="{.status.loadBalancer.ingress[*]['ip']}"` export GATEWAY_IP=`kubectl get svc $INGRESSGATEWAY --namespace istio-system --output jsonpath="{.status.loadBalancer.ingress[*]['ip']}"`

View File

@ -101,7 +101,7 @@ manually obtain a TLS certificate from Let's Encrypt.
1. Run the following command to use Certbot to request a certificate using DNS 1. Run the following command to use Certbot to request a certificate using DNS
challenge during authorization: challenge during authorization:
```shell ```bash
./certbot-auto certonly --manual --preferred-challenges dns -d '*.default.yourdomain.com' ./certbot-auto certonly --manual --preferred-challenges dns -d '*.default.yourdomain.com'
``` ```
@ -164,7 +164,7 @@ continue below for instructions about manually adding a certificate.
1. Create a Kubernetes secret to hold your TLS certificate, `cert.pem`, and the 1. Create a Kubernetes secret to hold your TLS certificate, `cert.pem`, and the
private key, `key.pem`, by entering the following command: private key, `key.pem`, by entering the following command:
```shell ```bash
kubectl create --namespace contour-external secret tls default-cert \ kubectl create --namespace contour-external secret tls default-cert \
--key key.pem \ --key key.pem \
--cert cert.pem --cert cert.pem
@ -192,7 +192,7 @@ continue below for instructions about manually adding a certificate.
1. Update the Knative Contour plugin to start using the certificate as a fallback 1. Update the Knative Contour plugin to start using the certificate as a fallback
when auto-TLS is disabled. This can be done with the following patch: when auto-TLS is disabled. This can be done with the following patch:
```shell ```bash
kubectl patch cm config-contour -n knative-serving \ kubectl patch cm config-contour -n knative-serving \
-p '{"data":{"default-tls-secret":"contour-external/default-cert"}}' -p '{"data":{"default-tls-secret":"contour-external/default-cert"}}'
``` ```
@ -206,7 +206,7 @@ continue below for instructions about manually adding a certificate.
1. Create a Kubernetes secret to hold your TLS certificate, `cert.pem`, and the 1. Create a Kubernetes secret to hold your TLS certificate, `cert.pem`, and the
private key, `key.pem`, by entering the following command: private key, `key.pem`, by entering the following command:
```shell ```bash
kubectl create --namespace istio-system secret tls tls-cert \ kubectl create --namespace istio-system secret tls tls-cert \
--key key.pem \ --key key.pem \
--cert cert.pem --cert cert.pem
@ -219,7 +219,7 @@ continue below for instructions about manually adding a certificate.
1. Run the following command to open the Knative shared `gateway` in edit 1. Run the following command to open the Knative shared `gateway` in edit
mode: mode:
```shell ```bash
kubectl edit gateway knative-ingress-gateway --namespace knative-serving kubectl edit gateway knative-ingress-gateway --namespace knative-serving
``` ```

View File

@ -62,11 +62,9 @@ and which DNS provider validates those requests.
The following `letsencrypt-issuer` named `ClusterIssuer` file is The following `letsencrypt-issuer` named `ClusterIssuer` file is
configured for the Let's Encrypt CA and Google Cloud DNS. Under `spec`, configured for the Let's Encrypt CA and Google Cloud DNS. Under `spec`,
the Let's Encrypt account info, required `DNS-01` challenge type, and the Let's Encrypt account info, required `DNS-01` challenge type, and
Cloud DNS provider info defined. For the complete Google Cloud DNS Cloud DNS provider info defined.
example, see
[Configuring HTTPS with cert-manager and Google Cloud DNS](./using-cert-manager-on-gcp).
```shell ```bash
apiVersion: cert-manager.io/v1 apiVersion: cert-manager.io/v1
kind: ClusterIssuer kind: ClusterIssuer
metadata: metadata:
@ -142,13 +140,13 @@ See how the Google Cloud DNS is defined as the provider:
1. Determine if `networking-certmanager` is already installed by running the 1. Determine if `networking-certmanager` is already installed by running the
following command: following command:
```shell ```bash
kubectl get deployment networking-certmanager -n knative-serving kubectl get deployment networking-certmanager -n knative-serving
``` ```
1. If `networking-certmanager` is not found, run the following command: 1. If `networking-certmanager` is not found, run the following command:
```shell ```bash
kubectl apply --filename {{ artifact( repo="net-certmanager", file="release.yaml") }} kubectl apply --filename {{ artifact( repo="net-certmanager", file="release.yaml") }}
``` ```
@ -162,13 +160,13 @@ If you choose to use the mode of provisioning certificate per namespace, you nee
1. Determine if `networking-ns-cert` deployment is already installed by 1. Determine if `networking-ns-cert` deployment is already installed by
running the following command: running the following command:
```shell ```bash
kubectl get deployment networking-ns-cert -n knative-serving kubectl get deployment networking-ns-cert -n knative-serving
``` ```
1. If `networking-ns-cert` deployment is not found, run the following command: 1. If `networking-ns-cert` deployment is not found, run the following command:
```shell ```bash
kubectl apply --filename {{ artifact( repo="serving", file="serving-nscert.yaml") }} kubectl apply --filename {{ artifact( repo="serving", file="serving-nscert.yaml") }}
``` ```
@ -179,13 +177,13 @@ in the `knative-serving` namespace to reference your new `ClusterIssuer`.
1. Run the following command to edit your `config-certmanager` ConfigMap: 1. Run the following command to edit your `config-certmanager` ConfigMap:
```shell ```bash
kubectl edit configmap config-certmanager --namespace knative-serving kubectl edit configmap config-certmanager --namespace knative-serving
``` ```
1. Add the `issuerRef` within the `data` section: 1. Add the `issuerRef` within the `data` section:
```shell ```bash
data: data:
issuerRef: | issuerRef: |
kind: ClusterIssuer kind: ClusterIssuer
@ -194,7 +192,7 @@ in the `knative-serving` namespace to reference your new `ClusterIssuer`.
Example: Example:
```shell ```bash
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
@ -213,7 +211,7 @@ in the `knative-serving` namespace to reference your new `ClusterIssuer`.
1. Ensure that the file was updated successfully: 1. Ensure that the file was updated successfully:
```shell ```bash
kubectl get configmap config-certmanager --namespace knative-serving --output yaml kubectl get configmap config-certmanager --namespace knative-serving --output yaml
``` ```
@ -226,20 +224,20 @@ requests are handled:
1. Run the following command to edit your `config-network` ConfigMap: 1. Run the following command to edit your `config-network` ConfigMap:
```shell ```bash
kubectl edit configmap config-network --namespace knative-serving kubectl edit configmap config-network --namespace knative-serving
``` ```
1. Add the `autoTLS: Enabled` attribute under the `data` section: 1. Add the `autoTLS: Enabled` attribute under the `data` section:
```shell ```bash
data: data:
autoTLS: Enabled autoTLS: Enabled
``` ```
Example: Example:
```shell ```bash
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
@ -267,14 +265,14 @@ requests are handled:
- `Redirected`: Responds to HTTP request with a `302` redirect to ask the - `Redirected`: Responds to HTTP request with a `302` redirect to ask the
clients to use HTTPS. clients to use HTTPS.
```shell ```bash
data: data:
httpProtocol: Redirected httpProtocol: Redirected
``` ```
Example: Example:
```shell ```bash
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
@ -292,7 +290,7 @@ requests are handled:
1. Ensure that the file was updated successfully: 1. Ensure that the file was updated successfully:
```shell ```bash
kubectl get configmap config-network --namespace knative-serving --output yaml kubectl get configmap config-network --namespace knative-serving --output yaml
``` ```
@ -303,7 +301,7 @@ be able to handle HTTPS traffic.
### Verify Auto TLS ### Verify Auto TLS
1. Run the following comand to create a Knative Service: 1. Run the following comand to create a Knative Service:
```shell ```bash
kubectl apply -f https://raw.githubusercontent.com/knative/docs/main/docs/serving/autoscaling/autoscale-go/service.yaml kubectl apply -f https://raw.githubusercontent.com/knative/docs/main/docs/serving/autoscaling/autoscale-go/service.yaml
``` ```

View File

@ -26,7 +26,7 @@ To check out your fork of the `knative/docs` repository:
1. Clone your fork to your machine and set the `upstream` remote to the 1. Clone your fork to your machine and set the `upstream` remote to the
`knative/docs` repository: `knative/docs` repository:
```shell ```bash
mkdir -p ${GOPATH}/src/knative.dev mkdir -p ${GOPATH}/src/knative.dev
cd ${GOPATH}/src/knative.dev cd ${GOPATH}/src/knative.dev
git clone git@github.com:${YOUR_GITHUB_USERNAME}/docs.git git clone git@github.com:${YOUR_GITHUB_USERNAME}/docs.git

View File

@ -45,14 +45,14 @@ details about installing the required software.
1. Clone this repo (or your fork) using `--recurse-submodules`, like so: 1. Clone this repo (or your fork) using `--recurse-submodules`, like so:
```shell ```bash
git clone --recurse-submodules https://github.com/knative/website.git git clone --recurse-submodules https://github.com/knative/website.git
``` ```
If you accidentally cloned this repo without `--recurse-submodules`, you'll If you accidentally cloned this repo without `--recurse-submodules`, you'll
need to do the following inside the repo: need to do the following inside the repo:
```shell ```bash
git submodule init git submodule init
git submodule update git submodule update
cd themes/docsy cd themes/docsy
@ -65,13 +65,13 @@ details about installing the required software.
1. Clone the docs repo next to (_not inside_) the website repo. This allows you 1. Clone the docs repo next to (_not inside_) the website repo. This allows you
to test docs changes alongside the website: to test docs changes alongside the website:
```shell ```bash
git clone https://github.com/knative/docs.git git clone https://github.com/knative/docs.git
``` ```
You may also want to clone the community repo: You may also want to clone the community repo:
```shell ```bash
git clone https://github.com/knative/community.git git clone https://github.com/knative/community.git
``` ```
@ -161,7 +161,7 @@ If you want to develop on a Mac, you'll find two obstacles:
The scripts assume GNU `sed`. You can install this with The scripts assume GNU `sed`. You can install this with
[Homebrew](https://brew.sh/): [Homebrew](https://brew.sh/):
```shell ```bash
brew install gnu-sed brew install gnu-sed
# You need to put it in your PATH before the built-in Mac sed # You need to put it in your PATH before the built-in Mac sed
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH" PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
@ -178,7 +178,7 @@ ERROR 2020/04/14 12:37:16 Error: listen tcp 127.0.0.1:1313: socket: too many ope
You can fix this with the following (may be needed for each new shell): You can fix this with the following (may be needed for each new shell):
```shell ```bash
sudo launchctl limit maxfiles 65535 200000 sudo launchctl limit maxfiles 65535 200000
# Probably only need around 4k FDs, but 64k is defensive... # Probably only need around 4k FDs, but 64k is defensive...
ulimit -n 65535 ulimit -n 65535

View File

@ -92,7 +92,7 @@ nav:
- Configuring the requests per second (RPS) target: serving/autoscaling/rps-target.md - Configuring the requests per second (RPS) target: serving/autoscaling/rps-target.md
- Configuring scale bounds: serving/autoscaling/scale-bounds.md - Configuring scale bounds: serving/autoscaling/scale-bounds.md
- Additional autoscaling configuration for Knative Pod Autoscaler: serving/autoscaling/kpa-specific.md - Additional autoscaling configuration for Knative Pod Autoscaler: serving/autoscaling/kpa-specific.md
- Autoscale Sample App - Go: serving/autoscaling/autoscale-go/index.md - Autoscale Sample App - Go: serving/autoscaling/autoscale-go/README.md
# Admin topics - serving # Admin topics - serving
- Administrator Topics: - Administrator Topics:
- Kubernetes services: serving/knative-kubernetes-services.md - Kubernetes services: serving/knative-kubernetes-services.md
@ -148,7 +148,7 @@ nav:
- Overview: eventing/sources/apiserversource/README.md - Overview: eventing/sources/apiserversource/README.md
- Getting started: eventing/sources/apiserversource/getting-started/README.md - Getting started: eventing/sources/apiserversource/getting-started/README.md
- ContainerSource: eventing/sources/containersource.md - ContainerSource: eventing/sources/containersource.md
- PingSource: eventing/sources/ping-source/index.md - PingSource: eventing/sources/ping-source/README.md
- SinkBinding: - SinkBinding:
- Overview: eventing/sources/sinkbinding/README.md - Overview: eventing/sources/sinkbinding/README.md
- Create a SinkBinding object: eventing/sources/sinkbinding/getting-started.md - Create a SinkBinding object: eventing/sources/sinkbinding/getting-started.md
@ -173,10 +173,10 @@ nav:
- Parallel: eventing/flows/parallel.md - Parallel: eventing/flows/parallel.md
- Sequence: - Sequence:
- Overview: eventing/flows/sequence/README.md - Overview: eventing/flows/sequence/README.md
- Displaying sequence output: eventing/flows/sequence/sequence-reply-to-event-display/index.md - Displaying sequence output: eventing/flows/sequence/sequence-reply-to-event-display/README.md
- Using Sequences in series: eventing/flows/sequence/sequence-reply-to-sequence/index.md - Using Sequences in series: eventing/flows/sequence/sequence-reply-to-sequence/README.md
- Create additional events: eventing/flows/sequence/sequence-terminal/index.md - Create additional events: eventing/flows/sequence/sequence-terminal/README.md
- Using with Broker and Trigger: eventing/flows/sequence/sequence-with-broker-trigger/index.md - Using with Broker and Trigger: eventing/flows/sequence/sequence-with-broker-trigger/README.md
- Channels: - Channels:
- Overview: eventing/channels/README.md - Overview: eventing/channels/README.md
- Channel types and defaults: eventing/channels/channel-types-defaults.md - Channel types and defaults: eventing/channels/channel-types-defaults.md
@ -198,7 +198,7 @@ nav:
- Sink: - Sink:
- Overview: eventing/sink/README.md - Overview: eventing/sink/README.md
- Apache Kafka Sink: eventing/sink/kafka-sink.md - Apache Kafka Sink: eventing/sink/kafka-sink.md
- Debugging: eventing/debugging/index.md - Debugging: eventing/debugging/README.md
- Accessing CloudEvent traces: eventing/accessing-traces.md - Accessing CloudEvent traces: eventing/accessing-traces.md
- Experimental Features: eventing/experimental-features.md - Experimental Features: eventing/experimental-features.md
- Code samples: - Code samples:
@ -210,7 +210,7 @@ nav:
- Python: eventing/samples/helloworld/helloworld-python/README.md - Python: eventing/samples/helloworld/helloworld-python/README.md
- Apache Kafka: - Apache Kafka:
- Overview: eventing/samples/kafka/README.md - Overview: eventing/samples/kafka/README.md
- Binding Example: eventing/samples/kafka/binding/index.md - Binding Example: eventing/samples/kafka/binding/README.md
- Channel Example: eventing/samples/kafka/channel/README.md - Channel Example: eventing/samples/kafka/channel/README.md
- Parallel: - Parallel:
- Overview: eventing/samples/parallel/README.md - Overview: eventing/samples/parallel/README.md
@ -222,8 +222,7 @@ nav:
- CloudStorageSource: eventing/sources/cloud-storage-source/README.md - CloudStorageSource: eventing/sources/cloud-storage-source/README.md
- GitHub source: eventing/sources/github-source/README.md - GitHub source: eventing/sources/github-source/README.md
- GitLab source: eventing/sources/gitlab-source/README.md - GitLab source: eventing/sources/gitlab-source/README.md
- IoT core: eventing/samples/iot-core/index.md - IoT core: eventing/samples/iot-core/README.md
- ... | *
# Reference docs # Reference docs
- Reference: - Reference:
- Serving: reference/api/serving.md - Serving: reference/api/serving.md
@ -293,9 +292,10 @@ plugins:
# Redirects # Redirects
- redirects: - redirects:
redirect_maps: redirect_maps:
'help/README.md': 'docs/help/contributor/README.md'
'serving/metrics.md': 'admin/collecting-metrics/serving-metrics/metrics.md' 'serving/metrics.md': 'admin/collecting-metrics/serving-metrics/metrics.md'
'eventing/metrics.md': 'admin/collecting-metrics/eventing-metrics/metrics.md' 'eventing/metrics.md': 'admin/collecting-metrics/eventing-metrics/metrics.md'
'help/README.md' : 'docs/help/README.md' 'help/README.md': 'docs/help/contributor/README.md'
'eventing/samples/sinkbinding/README.md': 'eventing/sources/sinkbinding/README.md' 'eventing/samples/sinkbinding/README.md': 'eventing/sources/sinkbinding/README.md'
'admin/install/install-serving-with-yaml.md': 'admin/install/serving/install-serving-with-yaml.md' 'admin/install/install-serving-with-yaml.md': 'admin/install/serving/install-serving-with-yaml.md'
'admin/install/install-eventing-with-yaml.md': 'admin/install/eventing/install-eventing-with-yaml.md' 'admin/install/install-eventing-with-yaml.md': 'admin/install/eventing/install-eventing-with-yaml.md'
@ -306,6 +306,7 @@ plugins:
'install/README.md': 'admin/install/README.md' 'install/README.md': 'admin/install/README.md'
'install/collecting-metrics/index.md': 'admin/collecting-metrics/README.md' 'install/collecting-metrics/index.md': 'admin/collecting-metrics/README.md'
'install/install-eventing-with-yaml.md': 'admin/install/eventing/install-eventing-with-yaml.md' 'install/install-eventing-with-yaml.md': 'admin/install/eventing/install-eventing-with-yaml.md'
# This doesn't exist anymore, we should probably replace it
'install/install-extensions.md': 'admin/install/install-extensions.md' 'install/install-extensions.md': 'admin/install/install-extensions.md'
'install/install-serving-with-yaml.md': 'admin/install/serving/install-serving-with-yaml.md' 'install/install-serving-with-yaml.md': 'admin/install/serving/install-serving-with-yaml.md'
'install/installation-files.md': 'admin/install/README.md' 'install/installation-files.md': 'admin/install/README.md'

View File

@ -23,7 +23,7 @@ TODO(#66): Write real unit tests.
You might need to install `kubetest` in order to run the end-to-end tests You might need to install `kubetest` in order to run the end-to-end tests
locally: locally:
```shell ```bash
go get -u k8s.io/test-infra/kubetest go get -u k8s.io/test-infra/kubetest
``` ```

View File

@ -136,7 +136,7 @@ If envconfig can't find an environment variable in the form `PREFIX_MYVAR`, and
is a struct tag defined, it will try to populate your variable with an environment is a struct tag defined, it will try to populate your variable with an environment
variable that directly matches the envconfig tag in your struct definition: variable that directly matches the envconfig tag in your struct definition:
```shell ```bash
export SERVICE_HOST=127.0.0.1 export SERVICE_HOST=127.0.0.1
export MYAPP_DEBUG=true export MYAPP_DEBUG=true
``` ```

View File

@ -4,7 +4,7 @@ Simple wrappers for primitive types to enforce atomic access.
## Installation ## Installation
```shell ```bash
$ go get -u go.uber.org/atomic@v1 $ go get -u go.uber.org/atomic@v1
``` ```
@ -25,7 +25,7 @@ replace github.com/uber-go/atomic => github.com/uber-go/atomic v1.4.0
You can do so automatically by running the following command. You can do so automatically by running the following command.
```shell ```bash
$ go mod edit -replace github.com/uber-go/atomic=github.com/uber-go/atomic@v1.4.0 $ go mod edit -replace github.com/uber-go/atomic=github.com/uber-go/atomic@v1.4.0
``` ```

View File

@ -23,7 +23,7 @@ Installation
Use go get. Use go get.
```shell ```bash
go get -u gopkg.in/go-playground/webhooks.v3 go get -u gopkg.in/go-playground/webhooks.v3
``` ```