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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-clojure.default.1.2.3.4.sslip.io
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:
```shell
```bash
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
Docker or Knative, you can skip this step.
```shell
```bash
> 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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-dart.default.1.2.3.4.sslip.io
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:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs
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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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:
```shell
```bash
kubectl get ksvc helloworld-deno --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-deno.default.1.2.3.4.sslip.io
```
Example:
```shell
```bash
curl http://helloworld-deno.default.1.2.3.4.sslip.io
[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:
```shell
```bash
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.
```shell
```bash
mix phoenix.new helloelixir
```
@ -127,7 +127,7 @@ above.
shell of an example on `config/prod.secret.exs.sample` and you can use the
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")
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
username:
```shell
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-elixir .
@ -149,7 +149,7 @@ above.
in `service.yaml` matches the container you built in the previous step.
Apply the configuration using `kubectl`:
```shell
```bash
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
`{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
...
@ -294,6 +294,6 @@ above.
To remove the sample app from your cluster, delete the service record:
```shell
```bash
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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-haskell.default.1.2.3.4.sslip.io
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:
```shell
```bash
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
following commands with your Docker Hub username.
```shell
```bash
# Build the container on your local machine
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
Knative cluster by running the `kubectl apply` command:
```shell
```bash
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`
command:
```shell
```bash
kubectl get ksvc helloworld-java-micronaut --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example result:
```shell
```bash
NAME URL
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
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
```
Example result:
```shell
```bash
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`
command:
```shell
```bash
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
commands:
```shell
```bash
mvn io.quarkus:quarkus-maven-plugin:0.13.3:create \
-DprojectGroupId=com.redhat.developer.demos \
-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
unncessary for this example.
```shell
```bash
rm src/main/resources/META-INF/resources/index.html
```
1. Remove `.dockerignore` file since it's unncessary for this example.
```shell
```bash
rm .dockerignore
```
@ -206,7 +206,7 @@ which you update and create the necessary build and configuration files:
1. Run the application locally:
```shell
```bash
./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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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
```shell
```bash
kubectl get ksvc helloworld-java-quarkus
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
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
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:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs
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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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:
```shell
```bash
kubectl get ksvc helloworld-r --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-r.default.1.2.3.4.sslip.io
```
Example:
```shell
```bash
curl http://helloworld-r.default.1.2.3.4.sslip.io
[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:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{< branch >}}" https://github.com/knative/docs knative-docs
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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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:
```shell
```bash
kubectl get ksvc helloworld-r --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-rserver.default.1.2.3.4.sslip.io
```
Example:
```shell
```bash
curl http://helloworld-rserver.default.1.2.3.4.sslip.io
[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:
```shell
```bash
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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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:
```shell
```bash
kubectl get ksvc helloworld-rust --output=custom-columns=NAME:.metadata.name,URL:.status.url
NAME URL
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-rust.default.1.2.3.4.sslip.io
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:
```shell
```bash
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
username:
```shell
```bash
# Build the container on your local machine
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
step. Apply the configuration using the `kubectl` command:
```shell
```bash
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-swift.default.1.2.3.4.sslip.io
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:
```shell
```bash
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
following commands with your Docker Hub username.
```shell
```bash
# Build the container on your local machine
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
Knative cluster by running the `kubectl apply` command:
```shell
```bash
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`
command:
```shell
```bash
kubectl get ksvc helloworld-vertx --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example result:
```shell
```bash
NAME URL
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-vertx.default.1.2.3.4.sslip.io
```
Example result:
```shell
```bash
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`
command:
```shell
```bash
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.
- Install `scikit-learn` and `bentoml` packages:
```shell
```bash
pip install scikit-learn
pip install bentoml
```
@ -54,19 +54,19 @@ as API endpoint with KNative Serving.
Run the `main.py` file to train and save the model:
```shell
```bash
python main.py
```
3. Use BentoML CLI to check saved model's information.
```shell
```bash
bentoml get IrisClassifier:latest
```
Example:
```shell
```bash
> bentoml get IrisClassifier:latest
{
"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
BentoML CLI command to start an API server locally and test it with the `curl` command.
```shell
```bash
bentoml serve IrisClassifier:latest
```
In another terminal window, make `curl` request with sample data to the API server
and get prediction result:
```shell
```bash
curl -v -i \
--header "Content-Type: application/json" \
--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
username and run the following commands.
```shell
```bash
# jq might not be installed on your local system, please follow jq install
# instruction at https://stedolan.github.io/jq/download/
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" %}}
```shell
```bash
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:
```shell
```bash
kubectl get ksvc iris-classifier --output=custom-columns=NAME:.metadata.name,URL:.status.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
command to get prediction result from the deployed model API endpoint.
```shell
```bash
curl -v -i \
--header "Content-Type: application/json" \
--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:
```shell
```bash
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:
```shell
```bash
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:
@ -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:
```shell
```bash
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:
```shell
```bash
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:
```shell
```bash
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:
```shell
```bash
kubectl create namespace <namespace>
```
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:
```shell
```bash
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
Eventing namespaces, by entering the follow command:
```shell
```bash
kubectl patch --namespace knative-serving configmap/config-observability \
--type merge \
--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:
```shell
```bash
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:
```shell
```bash
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. Apply the `prometheus.yaml` file to create a Prometheus instance, by entering the following command:
```shell
```bash
kubectl apply -f prometheus.yaml
```
<!--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:
```shell
```bash
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:
```shell
```bash
cat << EOF > ./istio-minimal-operator.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
@ -139,7 +139,7 @@ need to update gateway configmap `config-istio` under the `knative-serving` name
1. Edit the `config-istio` configmap:
```shell
```bash
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
`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
```

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:
```shell
```bash
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:
```shell
```bash
kubectl label route ${ROUTE_NAME} networking.knative.dev/visibility=cluster-local
```
- To label a Kubernetes Service:
```shell
```bash
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:
```shell
```bash
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
`helloworld-go` Service:
```shell
```bash
kubectl get kservice helloworld-go
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
you deployed your application:
```shell
```bash
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:
```shell
```bash
kubectl get ingresses.networking.internal.knative.dev -o=custom-columns='NAME:.metadata.name,LABELS:.metadata.labels'
NAME LABELS
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
VirtualService. Run the following command:
```shell
```bash
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
```shell
```bash
kubectl get svc -n istio-system istio-ingressgateway
```
If there is no external IP address, use
```shell
```bash
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
configuration name in the `Route` .yaml file):
```shell
```bash
kubectl get configuration <configuration-name> --output jsonpath="{.status.latestCreatedRevisionName}"
```
@ -111,7 +111,7 @@ name in the `Route` yaml file.
Then run the following command:
```shell
```bash
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:
```shell
```bash
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
`status`. Some useful fields are `conditions` and `containerStatuses`:
```shell
```bash
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
To view your current configuration:
```shell
```bash
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:
```shell
```bash
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:
```shell
```bash
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
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:
```shell
```bash
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:
```shell
```bash
kn broker list
```
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>
```
@ -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:
```shell
```bash
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`:
```shell
```bash
NAME READY REASON URL AGE
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:
```shell
```bash
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
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
deliver them to Knative Serving service `my-service`:
```shell
```bash
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
kind: Trigger
@ -35,7 +35,7 @@ EOF
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`:
```shell
```bash
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
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
`my-extension-value`.
```shell
```bash
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
kind: Trigger

View File

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

View File

@ -17,7 +17,7 @@ procedure:
1. Update the information in [`channels.yaml`](channels.yaml).
2. Run the generator tool:
```shell
```bash
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
guide to work, you must apply [example.yaml](example.yaml):
```shell
```bash
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
following commands:
```shell
```bash
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.
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
events!):
```shell
```bash
kubectl --namespace knative-debug get events
```
This should produce output along the lines of:
```shell
```bash
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
```
@ -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:
```shell
```bash
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`
```shell
```bash
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
there anything obviously wrong mentioned in the `status`?
```shell
```bash
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`:
```shell
```bash
kubectl --namespace knative-debug get pod -l app=fn -o jsonpath='{.items[*].status.conditions[?(@.type == "Ready")].status}'
```
@ -120,7 +120,7 @@ guide.
##### `svc`
```shell
```bash
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.
```shell
```bash
{% raw %}
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
@ -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
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}'
```
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
```
@ -161,7 +161,7 @@ If `status` is completely missing, it implies that something is wrong with the
Next verify that `chan` is addressable:
```shell
```bash
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`.
```shell
```bash
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`.
```shell
```bash
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`.
```shell
```bash
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`:
```shell
```bash
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.
```shell
```bash
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
`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
```
See its logs with:
```shell
```bash
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
its Controller is:
```shell
```bash
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
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
```
View its logs with:
```shell
```bash
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
those into the `Channel`'s `spec.subscribable`.
```shell
```bash
kubectl --namespace knative-eventing get pod -l app=eventing-controller
```
View its logs with:
```shell
```bash
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:
```shell
```bash
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:
```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.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"}
@ -363,7 +363,7 @@ However if we see something like:
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'
-->
```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: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"}

View File

@ -79,7 +79,7 @@ spec:
```
```shell
```bash
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
the resources to be created.
```shell
```bash
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
your resources to be created.
```shell
```bash
kubectl -n default create -f ./event-display.yaml
```
@ -167,7 +167,7 @@ spec:
name: sequence
```
```shell
```bash
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
pods.
```shell
```bash
kubectl -n default get pods
```
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
☁️ cloudevents.Event
Validation: valid

View File

@ -120,7 +120,7 @@ spec:
```
```shell
```bash
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
your resources created.
```shell
```bash
kubectl -n default create -f ./sequence1.yaml
```
@ -201,7 +201,7 @@ spec:
name: event-display
```
```shell
```bash
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
your resources created.
```shell
```bash
kubectl -n default create -f ./event-display.yaml
```
@ -247,7 +247,7 @@ spec:
name: first-sequence
```
```shell
```bash
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
pods.
```shell
```bash
kubectl -n default get pods
```
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
☁️ cloudevents.Event
Validation: valid

View File

@ -79,7 +79,7 @@ spec:
```
```shell
```bash
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
spec.channelTemplate to point to your desired Channel.
```shell
```bash
kubectl -n default create -f ./sequence.yaml
```
@ -144,7 +144,7 @@ spec:
name: sequence
```
```shell
```bash
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
take some time for the events to show up in the logs.
```shell
```bash
kubectl -n default get pods
```
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
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`:
```shell
```bash
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
@ -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`:
```shell
```bash
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

View File

@ -36,7 +36,7 @@ The functions used in these examples live in
To create the cluster default Broker type:
```shell
```bash
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
kind: Broker
@ -96,7 +96,7 @@ spec:
Change the `default` namespace below to create the services in the namespace where you have
configured your broker.
```shell
```bash
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
configured your broker.
```shell
```bash
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
configured your broker and sequence.
```shell
```bash
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
configured your broker and sequence.
```shell
```bash
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
where you have configured your broker.
```shell
```bash
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
pods.
```shell
```bash
kubectl -n default get pods
```
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
☁️ cloudevents.Event
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:
```
```bash
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:
```
```yaml
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
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:
```
```bash
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`:
```
```{ .bash .no-copy }
NAME READY REASON URL AGE
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
command:
```
```yaml
kubectl -n event-example apply -f - << EOF
apiVersion: apps/v1
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
command:
```
```yaml
kubectl -n event-example apply -f - << EOF
apiVersion: apps/v1
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:
```
```bash
kubectl -n event-example get deployments hello-display goodbye-display
```
This lists the `hello-display` and `goodbye-display` consumers that you
deployed:
```
```{ .bash .no-copy }
NAME READY UP-TO-DATE AVAILABLE AGE
hello-display 1/1 1 1 26s
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.
1. Create a trigger by entering the following command:
```
```yaml
kubectl -n event-example apply -f - << EOF
apiVersion: eventing.knative.dev/v1
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`.
1. To add a second trigger, enter the following command:
```
```yaml
kubectl -n event-example apply -f - << EOF
apiVersion: eventing.knative.dev/v1
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
command:
```
```bash
kubectl -n event-example get triggers
```
This returns the `hello-display` and `goodbye-display` triggers that you
created:
```
```{ .bash .no-copy }
NAME READY REASON BROKER SUBSCRIBER_URI AGE
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
@ -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.
To create a pod, enter the following command:
```
```yaml
kubectl -n event-example apply -f - << EOF
apiVersion: v1
kind: Pod
@ -252,12 +252,12 @@ EOF
## Sending events to the broker
1. SSH into the pod by running the following command:
```
```bash
kubectl -n event-example attach curl -it
```
You will see a prompt similar to the following:
```
```{ .bash .no-copy }
Defaulting container name to curl.
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.
@ -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:
- To make the first request, which creates an event that has the `type`
`greeting`, run the following in the SSH terminal:
```
```bash
curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \
-X POST \
-H "Ce-Id: say-hello" \
@ -282,7 +282,7 @@ EOF
If the event has been received, you will receive a `202 Accepted` response
similar to the one below:
```
```{ .bash .no-copy }
< HTTP/1.1 202 Accepted
< Content-Length: 0
< 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`
`sendoff`, run the following in the SSH terminal:
```
```bash
curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \
-X POST \
-H "Ce-Id: say-goodbye" \
@ -311,7 +311,7 @@ EOF
```
- 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:
```
```bash
curl -v "http://broker-ingress.knative-eventing.svc.cluster.local/event-example/default" \
-X POST \
-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.
If the event has been received, you will receive a `202 Accepted` response
similar to the one below:
```
```{ .bash .no-copy }
< HTTP/1.1 202 Accepted
< Content-Length: 0
< 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
following command:
```
```bash
kubectl -n event-example logs -l app=hello-display --tail=100
```
This returns the `Attributes` and `Data` of the events you sent to
`hello-display`:
```
```{ .bash .no-copy }
☁️ cloudevents.Event
Validation: valid
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
following command:
```
```bash
kubectl -n event-example logs -l app=goodbye-display --tail=100
```
This returns the `Attributes` and `Data` of the events you sent to
`goodbye-display`:
```
```{ .bash .no-copy }
☁️ cloudevents.Event
Validation: valid
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.
Delete the `event-example` namespace and all of its resources from your cluster by entering the following command:
```
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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
[`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
```
@ -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
username:
```shell
```bash
# Build the container on your local machine
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
the previous step. Apply the configuration using `kubectl`:
```shell
```bash
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:
```shell
```bash
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
service names helloworld-go. Verify using the following command.
```shell
```bash
kubectl --namespace knative-samples get deployments 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
helloworld-go application. Make sure that Ready=true
```shell
```bash
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.
1. Display helloworld-python app logs
```shell
```bash
kubectl --namespace knative-samples logs -l app=helloworld-python --tail=50
```
You should see something similar to:
```shell
```bash
Event received. Context: Context Attributes,
specversion: 0.3
type: dev.knative.samples.helloworld

View File

@ -26,13 +26,13 @@ here and use them later.
#### Variables you must Change
```shell
```bash
export IOTCORE_PROJECT="s9-demo"
```
#### Variables you may Change
```shell
```bash
export IOTCORE_REGISTRY="iot-demo"
export IOTCORE_DEVICE="iot-demo-client"
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.
```shell
```bash
gcloud services enable pubsub.googleapis.com
```
1. Create the two GCP PubSub `topic`s.
```shell
```bash
gcloud pubsub topics create $IOTCORE_TOPIC_DATA
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
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 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
controller.
```shell
```bash
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`.
```shell
```bash
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
kind: Broker
@ -111,7 +111,7 @@ export IOTCORE_TOPIC_DEVICE="iot-demo-device-pubsub-topic"
1. Deploy `gcp-pubsub-source.yaml`.
```shell
```bash
sed -e "s/PROJECT_ID/$IOTCORE_PROJECT/" \
-e "s/TOPIC_NAME/$IOTCORE_TOPIC_DATA/" \
docs/eventing/samples/iot-core/gcp-pubsub-source.yaml |
@ -125,7 +125,7 @@ for all events coming out of it.
1. Deploy `trigger.yaml`.
```shell
```bash
kubectl apply --filename docs/eventing/samples/iot-core/trigger.yaml
```
@ -139,7 +139,7 @@ Core.
1. Create a device registry:
```shell
```bash
gcloud iot registries create $IOTCORE_REGISTRY \
--project=$IOTCORE_PROJECT \
--region=$IOTCORE_REGION \
@ -149,7 +149,7 @@ Core.
1. Create the certificates.
```shell
```bash
openssl req -x509 -nodes -newkey rsa:2048 \
-keyout device.key.pem \
-out device.crt.pem \
@ -160,7 +160,7 @@ Core.
1. Register a device using the generated certificates.
```shell
```bash
gcloud iot devices create $IOTCORE_DEVICE \
--project=$IOTCORE_PROJECT \
--region=$IOTCORE_REGION \
@ -175,7 +175,7 @@ see them in the subscriber.
1. Run the following program to generate events:
```shell
```bash
go run github.com/knative/docs/docs/eventing/samples/iot-core/generator \
-project $IOTCORE_PROJECT \
-region $IOTCORE_REGION \
@ -189,13 +189,13 @@ see them in the subscriber.
1. Inspect the logs of the subscriber:
```shell
```bash
kubectl logs --selector serving.knative.dev/service=event-display -c user-container
```
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"}
```
@ -205,7 +205,7 @@ To cleanup the knative resources:
1. Remove the `GcpPubSubSource`:
```shell
```bash
sed -e "s/PROJECT_ID/$IOTCORE_PROJECT/" \
-e "s/TOPIC_NAME/$IOTCORE_TOPIC_DATA/" \
docs/eventing/samples/iot-core/gcp-pubsub-source.yaml |
@ -214,12 +214,12 @@ To cleanup the knative resources:
1. Remove the Trigger:
```shell
```bash
kubectl delete --filename docs/eventing/samples/iot-core/trigger.yaml
```
1. Remove the `GcpPubSubSource` controller:
```shell
```bash
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).
1. Create a namespace for your Apache Kafka installation, like `kafka`:
```shell
```bash
kubectl create namespace kafka
```
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" \
| sed 's/namespace: .*/namespace: kafka/' \
| 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`
namespace:
```shell
```bash
$ kubectl get pods -n kafka
NAME READY STATUS RESTARTS AGE
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
steps that are listed above:
```shell
```bash
$ ./kafka_setup.sh
```

View File

@ -20,7 +20,7 @@ default channel configuration in Knative Eventing.
## Creating a `KafkaChannel` channel CRD
1. Create a new object by configuring the YAML file as follows:
```shell
```bash
kubectl apply -f - <<EOF
---
apiVersion: messaging.knative.dev/v1beta1
@ -36,9 +36,9 @@ default channel configuration in Knative Eventing.
## Specifying the default channel configuration
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:
```shell
```bash
kubectl apply -f - <<EOF
---
apiVersion: v1
@ -63,7 +63,7 @@ default channel configuration in Knative Eventing.
1. Now that `KafkaChannel` is set as the default channel configuration,
use the `channels.messaging.knative.dev` CRD to create a new Apache Kafka
channel, using the generic `Channel`:
```shell
```bash
kubectl apply -f - <<EOF
---
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
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
```
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
create a new _default_ broker, using the command:
```shell
```bash
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
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`.
1. Install `ksvc`, using the command:
```shell
```bash
kubectl apply -f 000-ksvc.yaml
```
2. Install a source that publishes to the default broker
```shell
```bash
kubectl apply -f 020-k8s-events.yaml
```
3. Create a trigger that routes the events to the `ksvc`:
```shell
```bash
kubectl apply -f 030-trigger.yaml
```
@ -151,7 +151,7 @@ your configuration with the following options.
### Receive events via Knative
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
```
@ -170,7 +170,7 @@ Kafka cluster, with the two supported TLS and SASL authentication methods.
### TLS authentication
1. Edit your config-kafka ConfigMap:
```shell
```bash
kubectl -n knative-eventing edit configmap config-kafka
```
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.
1. Edit your config-kafka ConfigMap:
```shell
```bash
kubectl -n knative-eventing edit configmap config-kafka
```
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:
```shell
```bash
kubectl create secret --namespace <namespace> generic <kafka-auth-secret> \
--from-literal=password="SecretPassword" \
--from-literal=saslType="PLAIN" \

View File

@ -83,7 +83,7 @@ spec:
.
```
```shell
```bash
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
your resources to be created.
```shell
```bash
kubectl -n default create -f ./event-display.yaml
```
@ -149,7 +149,7 @@ spec:
name: event-display
```
```shell
```bash
kubectl create -f ./parallel.yaml
```
@ -174,7 +174,7 @@ spec:
name: odd-even-parallel
```
```shell
```bash
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:
```shell
```bash
kubectl logs -l serving.knative.dev/service=event-display --tail=30 -c user-container
☁️ cloudevents.Event

View File

@ -74,7 +74,7 @@ spec:
.
```
```shell
```bash
kubectl create -f ./switcher.yaml -f ./transformers.yaml
```
@ -92,7 +92,7 @@ spec:
- image: gcr.io/knative-releases/knative.dev/eventing/cmd/event_display
```
```shell
```bash
kubectl -n default create -f ./event-display.yaml
```
@ -132,7 +132,7 @@ spec:
name: me-event-display
```
```shell
```bash
kubectl create -f ./parallel.yaml
```
@ -157,7 +157,7 @@ spec:
name: me-odd-even-parallel
```
```shell
```bash
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:
```shell
```bash
kubectl logs -l serving.knative.dev/service=me-event-display --tail=50 -c user-container
☁️ 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.
=== "kn"
You can list existing event sources on your cluster by entering the kn command:
```bash
kn source list
```
=== "kubectl"
You can list existing event sources on your cluster by entering the command:
```shell
```bash
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
[Knative Eventing Camel release page](https://github.com/knative-sandbox/eventing-camel/releases):
```shell
```bash
kubectl apply --filename camel.yaml
```
@ -50,7 +50,7 @@ The following resources need to be created:
Deploy the [`display_resources.yaml`](./display_resources.yaml):
```shell
```bash
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:
```shell
```bash
kubectl apply -f source_timer.yaml
```
Verify that the published events were sent into the Knative eventing system by
looking at what is downstream of the `CamelSource`.
```shell
```bash
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
CamelSources from the namespace:
```shell
```bash
kubectl delete camelsource --all
```
Install the [mqtt CamelSource](source_mqtt.yaml):
```shell
```bash
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:
```shell
```bash
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
CamelSources from the namespace:
```shell
```bash
kubectl delete camelsource --all
```
Install the [telegram CamelSource](source_telegram.yaml):
```shell
```bash
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:
```shell
```bash
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
display, you can remove them all from the namespace:
```shell
```bash
kubectl delete camelsource --all
```
Install the [HTTP poller CamelSource](source_http_poller.yaml):
```shell
```bash
kubectl apply -f source_http_poller.yaml
```
The event display will show some JSON data periodically pulled from the external
REST API. To check the logs:
```shell
```bash
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:
```shell
```bash
kubectl create namespace <namespace>
```
where;
- `<namespace>` is the name of the namespace that you want to create.
Where `<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.
@ -90,7 +89,23 @@ Before you can create an API server source, you must install Knative Eventing an
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
@ -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.
=== "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:
```shell
```bash
kubectl run busybox --image=busybox --namespace=<namespace> --restart=Never -- ls
```
where;
@ -150,7 +149,7 @@ Before you can create an API server source, you must install Knative Eventing an
1. Delete the test pod:
```shell
```bash
kubectl --namespace=<namespace> delete pod busybox
```
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:
```shell
```bash
kubectl logs --namespace=<namespace> -l app=<sink> --tail=100
```
where;
@ -167,7 +166,7 @@ Before you can create an API server source, you must install Knative Eventing an
Example log output:
```shell
```bash
☁️ cloudevents.Event
Validation: valid
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:
```shell
```bash
kubectl delete namespace <namespace>
```
where;
- `<namespace>` is the name of the namespace that you created in step 1 above.
Where `<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`:
```shell
```bash
kubectl apply --filename service.yaml
```
The status of the created service can be seen using:
```shell
```bash
kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON
@ -111,7 +111,7 @@ spec:
Use the following command to create the event source from
`heartbeats-source.yaml`:
```shell
```bash
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
looking at event-display service logs.
```shell
```bash
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
command:
```shell
```bash
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
Service that dumps incoming messages to its log.
```shell
```bash
kubectl -n containersource-example apply -f - << EOF
apiVersion: apps/v1
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
to the container.
```shell
```bash
kubectl -n containersource-example apply -f - << EOF
apiVersion: sources.knative.dev/v1
kind: ContainerSource
@ -136,7 +136,7 @@ EOF
View the logs for the `event-display` event consumer by
entering the following command:
```shell
```bash
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
cluster by entering the following command:
```shell
```bash
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 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
name](../../../serving/using-a-custom-domain.md)
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.
### Create a Knative Service
@ -39,7 +32,7 @@ spec:
Enter the following command to create the service from `service.yaml`:
```shell
```bash
kubectl --namespace default apply --filename service.yaml
```
@ -78,13 +71,13 @@ stringData:
Hint: you can makeup a random _secretToken_ with:
```shell
```bash
head -c 8 /dev/urandom | base64
```
Then, apply the githubsecret using `kubectl`:
```shell
```bash
kubectl --namespace default apply --filename githubsecret.yaml
```
@ -125,7 +118,7 @@ spec:
Then, apply that yaml using `kubectl`:
```shell
```bash
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
by looking at our message dumper function logs.
```shell
```bash
kubectl --namespace default get pods
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:
```shell
```bash
kubectl --namespace default delete --filename github-source.yaml
```
Similarly, you can remove the Service and Secret via:
```shell
```bash
kubectl --namespace default delete --filename service.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 example shows how to wire GitLab events for consumption by a
@ -21,9 +14,8 @@ You will need:
need to create one.
1. Ensure Knative Serving is
[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.
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).
### 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`
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
```
Check that the manager is running:
```shell
```bash
kubectl -n knative-sources get pods --selector control-plane=gitlab-controller-manager
```
@ -78,7 +70,7 @@ spec:
Create the service:
```shell
```bash
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:
```shell
```bash
head -c 8 /dev/urandom | base64
```
@ -117,7 +109,7 @@ kubectl -n default apply -f event-display.yaml
1. Create the secret using `kubectl`.
```shell
```bash
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`:
```shell
```bash
kubectl -n default apply -f gitlabsource.yaml
```
@ -190,13 +182,13 @@ Data,
You can remove the GitLab webhook by deleting the GitLab source:
```shell
```bash
kubectl --namespace default delete --filename gitlabsource.yaml
```
Similarly, you can remove the Service and Secret via:
```shell
```bash
kubectl --namespace default delete --filename event-display.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`
```shell
```bash
$ kubectl apply -f strimzi-topic.yaml
kafkatopic.kafka.strimzi.io/knative-demo-topic created
```
3. Ensure the `KafkaTopic` is running.
```shell
```bash
$ kubectl -n kafka get kafkatopics.kafka.strimzi.io
NAME AGE
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:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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
```shell
```bash
$ kubectl delete -f kafka-topic.yaml
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:
```shell
```bash
kubectl create namespace pingsource-example
```
@ -37,7 +37,7 @@ The following example shows how you can configure a PingSource as an event sourc
=== "kubectl"
```shell
```bash
kubectl -n pingsource-example apply -f - << EOF
apiVersion: apps/v1
kind: Deployment
@ -81,7 +81,7 @@ The following example shows how you can configure a PingSource as an event sourc
=== "YAML"
```shell
```bash
kubectl create -n pingsource-example -f - <<EOF
apiVersion: sources.knative.dev/v1
kind: PingSource
@ -102,7 +102,7 @@ The following example shows how you can configure a PingSource as an event sourc
=== "kn"
```shell
```bash
kn source ping create test-ping-source \
--namespace pingsource-example \
--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:
```shell
```bash
kubectl -n pingsource-example apply -f - <<EOF
apiVersion: sources.knative.dev/v1
kind: PingSource
@ -145,14 +145,14 @@ entering the following command:
=== "kubectl"
```shell
```bash
kubectl -n pingsource-example logs -l app=event-display --tail=100
```
=== "kail"
```shell
```bash
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:
```shell
```bash
☁️ cloudevents.Event
Validation: valid
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:
```shell
```bash
☁️ cloudevents.Event
Validation: valid
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:
```shell
```bash
kubectl delete namespace pingsource-example
```
@ -207,28 +207,28 @@ entering the following command:
=== "kubectl"
```shell
```bash
kubectl delete pingsources.sources.knative.dev test-ping-source
```
=== "kn"
```shell
```bash
kn source ping delete test-ping-source
```
=== "kubectl: binary data PingSource"
```shell
```bash
kubectl delete pingsources.sources.knative.dev test-ping-source-binary
```
=== "kn: binary data PingSource"
```shell
```bash
kn source ping delete test-ping-source-binary
```
@ -243,14 +243,14 @@ entering the following command:
=== "kubectl"
```shell
```bash
kubectl delete service.serving.knative.dev event-display
```
=== "kn"
```shell
```bash
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,
delete the namespace by running:
```shell
```bash
kubectl delete namespace <namespace>
```
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
the default settings:
```shell
```bash
kubectl create -f - <<EOF
apiVersion: eventing.knative.dev/v1
kind: Broker
@ -55,7 +55,7 @@ Sugar Controller will automatically recreate a default Broker.
Creating a "default" Broker when creating a Namespace:
```shell
```bash
kubectl apply -f - <<EOF
apiVersion: v1
kind: Namespace
@ -68,7 +68,7 @@ EOF
To automatically create a Broker after a namespace exists, label the Namespace:
```shell
```bash
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:
```shell
```bash
kubectl apply -f - << EOF
apiVersion: eventing.knative.dev/v1
kind: Trigger

View File

@ -4,5 +4,5 @@
- [Knative MkDocs Conributor Guide](./mkdocs-contributor-guide.md)
- [Knative Style Guide](./style-guide/README.md)
- [Content Re-Use](../../snippets/README.md)
- [Content Re-Use](../snippets/README.md)
- [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
- [Configuring cluster local routes](docs/developer/serving/services/private-services.md)
- [Using a custom domain](./using-a-custom-domain)
- [Using subroutes](./using-subroutes)
- [Configuring cluster local routes](../developer/serving/services/private-services.md)
- [Using a custom domain](../developer/serving/services/using-a-custom-domain)
- [Using subroutes](../developer/serving/services/using-subroutes)
## 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).
You can quickly explore and update the ConfigMap object with the following command:
```shell
```bash
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:
```shell
```bash
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:
```shell
```bash
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. Clone this repository, and move into the sample directory:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs 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.
```shell
```bash
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.
```shell
```bash
hey -z 30s -c 50 \
"http://autoscale-go.default.1.2.3.4.sslip.io?sleep=100&prime=10000&bloat=5" \
&& kubectl get pods
```
```shell
```bash
Summary:
Total: 30.3379 secs
Slowest: 0.7433 secs
@ -105,7 +105,7 @@ A demonstration of the autoscaling capabilities of a Knative Serving Revision.
[200] 5424 responses
```
```shell
```bash
NAME READY STATUS RESTARTS AGE
autoscale-go-00001-deployment-78cdc67bf4-2w4sk 3/3 Running 0 26s
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.
```shell
```bash
hey -z 60s -c 100 \
"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).
```shell
```bash
hey -z 60s -q 100 \
"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).
```shell
```bash
hey -z 60s -q 100 \
"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
100 cpus).
```shell
```bash
hey -z 60s -q 100 \
"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
gb).
```shell
```bash
hey -z 60s -c 5 \
"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
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)
* 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:
```shell
```bash
kubectl create secret docker-registry [REGISTRY-CRED-SECRETS] \
--docker-server=[PRIVATE_REGISTRY_SERVER_URL] \
--docker-email=[PRIVATE_REGISTRY_EMAIL] \
@ -51,7 +51,7 @@ You need:
Example:
```shell
```bash
kubectl create secret `container-registry` \
--docker-server=https://gcr.io/ \
--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:
```shell
```bash
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
you named your secrets `container-registry`:
```shell
```bash
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:
```shell
```bash
# 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"
```
@ -123,7 +123,7 @@ To see if your app has been deployed successfully, you need the URL created by K
=== "kn"
```shell
```bash
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"
```shell
```bash
kubectl get ksvc helloworld-go
```
The command will return the following:
```shell
```bash
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
```
@ -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
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
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:
```shell
```bash
kn service delete helloworld-go
```
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:
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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
and push this to your registry of choice via:
```shell
```bash
docker build -t <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
into the `image:` field.
```shell
```bash
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:
```shell
```bash
$ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON
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:
```shell
```bash
$ curl -X POST \
-H "content-type: application/json" \
-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:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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
and push this to your registry of choice via:
```shell
```bash
docker build -t <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:
```shell
```bash
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
into the `image:` field, then run:
```shell
```bash
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:
```shell
```bash
ko apply -f service.yaml
```
@ -111,7 +111,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-go
If using `kn` to deploy:
```shell
```bash
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:
```shell
```bash
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:
```shell
```bash
$ kubectl get ksvc
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
@ -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:
```shell
```bash
$ curl -X POST \
-H "content-type: application/json" \
-H "ce-specversion: 1.0" \
@ -154,7 +154,7 @@ $ curl -X POST \
You will get back:
```shell
```bash
{"message":"Hello, Dave"}
```
@ -162,6 +162,6 @@ You will get back:
To remove the sample app from your cluster, delete the service record:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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.
You can build and push this to your registry of choice via:
```shell
```bash
docker build -t <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
`<registry/repository/image:tag>` with the image you have just created.
```shell
```bash
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:
```shell
```bash
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:
```shell
```bash
$ kubectl get ksvc
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
@ -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:
```shell
```bash
$ curl -X POST \
-H "content-type: application/json" \
-H "ce-specversion: 1.0" \
@ -111,7 +111,7 @@ $ curl -X POST \
You will get back:
```shell
```bash
{"message":"Hello, Dave"}
```
@ -123,7 +123,7 @@ To remove the sample app from your cluster, delete the service.
Run:
```shell
```bash
kubectl delete --filename service.yaml
```
@ -131,7 +131,7 @@ To remove the sample app from your cluster, delete the service.
Run:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
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:
```shell
```bash
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:
```shell
```bash
kubectl apply -f service.yaml
```
@ -72,7 +72,7 @@ docker build -t <image> .
If using `kn` to deploy:
```shell
```bash
kn service create cloudevents-rust --image=<image>
```
@ -84,7 +84,7 @@ docker build -t <image> .
Get the URL for your Service with:
```shell
```bash
$ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON
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:
```shell
```bash
$ curl \
-X POST -v \
-H "content-type: application/json" \
@ -106,7 +106,7 @@ $ curl \
You can also send CloudEvents spawning a temporary curl pod in your cluster with:
```shell
```bash
$ kubectl run curl \
--image=curlimages/curl --rm=true --restart=Never -ti -- \
-X POST -v \
@ -121,7 +121,7 @@ $ kubectl run curl \
You'll get as result:
```shell
```bash
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.69.1
@ -154,7 +154,7 @@ To remove the sample app from your cluster, delete the service.
Run:
```shell
```bash
kubectl delete --filename service.yaml
```
@ -163,7 +163,7 @@ To remove the sample app from your cluster, delete the service.
Run:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
mvn compile jib:build -Dimage=<image_name>
```
To deploy the Knative Service, edit the `service.yaml` file and replace `<image>`
with the deployed image name. Then run:
```shell
```bash
kubectl apply -f service.yaml
```
@ -60,7 +60,7 @@ kubectl apply -f service.yaml
Get the URL for your Service with:
```shell
```bash
$ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON
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:
```shell
```bash
$ curl \
-X POST -v \
-H "content-type: application/json" \
@ -83,7 +83,7 @@ $ curl \
You can also send CloudEvents spawning a temporary curl pod in your cluster
with:
```shell
```bash
$ kubectl run curl \
--image=curlimages/curl --rm=true --restart=Never -ti -- \
-X POST -v \
@ -98,7 +98,7 @@ $ kubectl run curl \
You'll see on the console:
```shell
```bash
> POST / HTTP/1.1
> Host: localhost:8080
> 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:
```shell
```bash
kubectl delete --filename service.yaml
```
@ -138,7 +138,7 @@ To remove the sample app from your cluster, delete the service:
Run:
```shell
```bash
kubectl delete --filename service.yaml
```
@ -147,7 +147,7 @@ To remove the sample app from your cluster, delete the service:
Run:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
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:
```shell
```bash
kubectl apply -f service.yaml
```
@ -63,7 +63,7 @@ mvn compile jib:build -Dimage=<image_name>
If using `kn` to deploy:
```shell
```bash
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:
```shell
```bash
$ kubectl get ksvc
NAME URL LATESTCREATED LATESTREADY READY REASON
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:
```shell
```bash
$ curl \
-X POST -v \
-H "content-type: application/json" \
@ -98,7 +98,7 @@ $ curl \
You can also send CloudEvents spawning a temporary curl pod in your cluster
with:
```shell
```bash
$ kubectl run curl \
--image=curlimages/curl --rm=true --restart=Never -ti -- \
-X POST -v \
@ -113,7 +113,7 @@ $ kubectl run curl \
You'll see on the console:
```shell
```bash
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.69.1
@ -145,7 +145,7 @@ To remove the sample app from your cluster, delete the service:
Run:
```shell
```bash
kubectl delete --filename service.yaml
```
@ -154,6 +154,6 @@ To remove the sample app from your cluster, delete the service:
Run:
```shell
```bash
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/).
- Your Knative cluster must be
[configured to use your custom domain](../../using-a-custom-domain.md).
- You must ensure that your Knative cluster uses a static IP address:
- 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.
- You must ensure that your Knative cluster uses a static IP address refer to your provider's documentation.
- An installed version of [Docker](https://www.docker.com).
- A [Docker Hub account](https://hub.docker.com/) to which you are able to
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:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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
commands.
```shell
```bash
export DOCKER_HUB_USERNAME=username
# 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:
```shell
```bash
$ echo -n "45d382d4a9a93c453fb7c8adc109121e7c29fa3ca" | base64
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
copy it into `github-secret.yaml` next to `webhookSecret:`:
```shell
```bash
$ echo -n "mygithubwebhooksecret" | base64
bXlnaXRodWJ3ZWJob29rc2VjcmV0
```
1. Apply the secret to your cluster:
```shell
```bash
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.
```shell
```bash
$ kubectl apply --filename service.yaml
```
Response:
```shell
```bash
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:
```shell
```bash
$ kubectl get ksvc gitwebhook \
--output=custom-columns=NAME:.metadata.name,DOMAIN:.status.domain
```
Example response:
```shell
```bash
NAME DOMAIN
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:
```shell
```bash
# This will show the Knative service that we created:
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:
```shell
```bash
kubectl delete --filename service.yaml
```

View File

@ -28,7 +28,7 @@ for production containers.
1. Download a copy of the code:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
# Build the container on your local machine.
docker build --tag "{username}/grpc-ping-go" .
@ -68,13 +68,13 @@ for production containers.
4. Use `kubectl` to deploy the service.
```shell
```bash
kubectl apply --filename service.yaml
```
Response:
```shell
```bash
service "grpc-ping" created
```
@ -82,7 +82,7 @@ for production containers.
Once deployed, you can inspect the created resources with `kubectl` commands:
```shell
```bash
# This will show the Knative service that we created:
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:
```shell
```bash
docker run --rm {username}/grpc-ping-go \
/client \
-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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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
[.NET Core SDK 3.1](https://www.microsoft.com/net/core) installed:
```shell
```bash
dotnet --version
3.1.100
```
1. From the console, create a new empty web project using the dotnet command:
```shell
```bash
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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-csharp.default.1.2.3.4.sslip.io
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:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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
[`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
```
@ -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:
```shell
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-go .
@ -151,7 +151,7 @@ You will need:
1. Apply the configuration using `kubectl`:
```shell
```bash
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:
```shell
```bash
kubectl get ksvc helloworld-go --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
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:
```shell
```bash
kn service create helloworld-go --image=docker.io/{username}/helloworld-go --env TARGET="Go Sample v1"
```
You should see output like this:
```shell
```bash
Creating service 'helloworld-go' in namespace 'default':
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-go.default.1.2.3.4.sslip.io
Hello Go Sample v1!
```
@ -226,11 +226,11 @@ To remove the sample app from your cluster, delete the service record:
=== "kubectl"
```shell
```bash
kubectl delete --filename service.yaml
```
=== "kn"
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs/docs/serving/samples/hello-world/helloworld-java
```
1. Run the application locally:
```shell
```bash
./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:
```shell
```bash
# Build the container on your local machine
docker build -t {username}/helloworld-java .
# 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:
```shell
```bash
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`:
```shell
```bash
kubectl apply --filename service.yaml
```
@ -138,24 +138,24 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-java
=== "kn"
```shell
```bash
kn service describe helloworld-java -o url
```
Example:
```shell
```bash
http://helloworld-java.default.1.2.3.4.xip.io
```
=== "kubectl"
```shell
```bash
kubectl get ksvc helloworld-java --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
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:
```shell
```bash
curl http://helloworld-java.default.1.2.3.4.sslip.io
Hello SparkJava Sample v1!
# Even easier with kn:
@ -184,11 +184,11 @@ To remove the sample app from your cluster, delete the service record.
=== "kn"
```shell
```bash
kn service delete helloworld-java
```
=== "kubectl"
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
mkdir 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
the code block below into it:
```shell
```bash
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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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
```shell
```bash
kubectl get ksvc helloworld-kotlin --output=custom-columns=NAME:.metadata.name,URL:.status.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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-kotlin.default.1.2.3.4.sslip.io
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:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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`:
```shell
```bash
npm init
package name: (helloworld-nodejs)
@ -49,7 +49,7 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-nodejs
1. Install the `express` package:
```shell
```bash
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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-nodejs.default.1.2.3.4.sslip.io
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:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
mkdir 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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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
```shell
```bash
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"
```shell
```bash
kn service describe helloworld-php -o url
```
Example:
```shell
```bash
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://helloworld-php.default.1.2.3.4.sslip.io
Hello PHP Sample v1!
```
@ -203,12 +203,12 @@ To remove the sample app from your cluster, delete the service record.
=== "kubectl"
```shell
```bash
kubectl delete --filename service.yaml
```
=== "kn"
```shell
```bash
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
commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
mkdir 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
to the Docker registry:
```shell
```bash
# Build the container on your local machine
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
you built in the previous step. Apply the configuration using `kubectl`:
```shell
```bash
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
```shell
```bash
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"
```shell
```bash
kubectl get ksvc helloworld-python --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
helloworld-python http://helloworld-python.default.1.2.3.4.sslip.io
```
=== "kn"
```shell
```bash
kn service describe helloworld-python -o url
```
Example:
```shell
```bash
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:
```shell
```bash
curl http://helloworld-python.default.1.2.3.4.sslip.io
Hello Python Sample v1!
@ -226,12 +226,12 @@ To remove the sample app from your cluster, delete the service record.
=== "kubectl"
```shell
```bash
kubectl delete --filename service.yaml
```
=== "kn"
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
mkdir 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
[Gemfile.lock](./Gemfile.lock) to your working directory.
```shell
```bash
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
the configuration using `kubectl`:
```shell
```bash
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
```shell
```bash
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"
```shell
```bash
kubectl get ksvc helloworld-ruby --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
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"
```shell
```bash
kn service describe helloworld-ruby -o url
```
Example:
```shell
```bash
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:
```shell
```bash
curl http://helloworld-ruby.default.1.2.3.4.sslip.io
Hello Ruby Sample v1!
@ -238,12 +238,12 @@ To remove the sample app from your cluster, delete the service record.
=== "kubectl"
```shell
```bash
kubectl delete --filename service.yaml
```
=== "kn"
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
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
the following command after `docker:publishLocal`:
```shell
```bash
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:
```shell
```bash
sbt docker:publishLocal
```
or
```shell
```bash
sbt docker:publish
```
@ -166,19 +166,19 @@ local Docker Repository.
=== "kn"
```shell
```bash
kn service describe helloworld-scala -o url
```
Example:
```shell
```bash
http://helloworld-scala.default.1.2.3.4.sslip.io
```
Finally, to try your service, use the obtained URL:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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:
```shell
```bash
#!/bin/sh
# 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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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
```shell
```bash
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"
```shell
```bash
kubectl get ksvc helloworld-shell --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
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"
```shell
```bash
kn service describe helloworld-shell -o url
```
Example:
```shell
```bash
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:
```shell
```bash
curl http://helloworld-shell.default.1.2.3.4.sslip.io
Hello Shell Sample v1!
@ -214,11 +214,11 @@ To remove the sample app from your cluster, delete the service record.
=== "kubectl"
```shell
```bash
kubectl delete --filename service.yaml
```
=== "kn"
```shell
```bash
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:
```shell
```bash
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)
in your GCP project.
```shell
```bash
export REPO="gcr.io/<YOUR_PROJECT_ID>"
```
If you use Docker Hub as your docker image registry, replace <username> with
your dockerhub username and run the following command:
```shell
```bash
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:
```shell
```bash
INGRESSGATEWAY=istio-ingressgateway
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:
```shell
```bash
# kubectl get route search-service --output=custom-columns=NAME:.metadata.name,URL:.status.url
NAME URL
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:
```shell
```bash
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:
```shell
```bash
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
these services. Get the ingress IP:
```shell
```bash
INGRESSGATEWAY=istio-ingressgateway
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:
```shell
```bash
curl http://${GATEWAY_IP}/search --header "Host: example.com"
```
or
```shell
```bash
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:
```shell
```bash
curl http://${GATEWAY_IP}/login --header "Host: example.com"
```
or
```shell
```bash
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:
```shell
```bash
kubectl delete --filename docs/serving/samples/knative-routing-go/sample.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
following command:
```shell
```bash
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:
servingcontainer
```shell
```bash
cd -
cd knative-docs/docs/serving/samples/multi-container/servingcontainer
go mod init github.com/knative/docs/docs/serving/samples/multi-container/servingcontainer
```
sidecarcontainer
```shell
```bash
cd -
cd 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
username:
```shell
```bash
# Build the container on your local machine
cd -
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
the configuration using `kubectl`:
```shell
```bash
cd -
cd knative-docs/docs/serving/samples/multi-container
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:
```shell
```bash
kubectl get ksvc multi-container --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
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
the URL below with the URL returned in the previous command.
```shell
```bash
curl http://multi-container.default.1.2.3.4.sslip.io
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:
```shell
```bash
kubectl delete --filename service.yaml
```

View File

@ -23,7 +23,7 @@ like `AAPL`,`AMZN`, `GOOG`, `MSFT`, etc.
[Homebrew](https://brew.sh/) on OS X.
1. Download a copy of the code:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
cd knative-docs
```
@ -43,7 +43,7 @@ To build and push to a container registry using Docker:
This sample uses
[Google Container Registry (GCR)](https://cloud.google.com/container-registry/):
```shell
```bash
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:
```shell
```bash
docker build \
--tag "${REPO}/rest-api-go" \
--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:
```shell
```bash
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
file called `docs/serving/samples/rest-api-go/sample.yaml`.
```shell
```bash
envsubst < docs/serving/samples/rest-api-go/sample-template.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
Knative Serving sample:
```shell
```bash
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:
```shell
```bash
kubectl get ksvc stock-service-example --output yaml
```
- View the created Route resource:
```shell
```bash
kubectl get route -l \
"serving.knative.dev/service=stock-service-example" --output yaml
```
- View the Kubernetes Service created by the Route
```shell
```bash
kubectl get service -l \
"serving.knative.dev/service=stock-service-example" --output yaml
```
- View the created Configuration resource:
```shell
```bash
kubectl get configuration -l \
"serving.knative.dev/service=stock-service-example" --output yaml
```
- View the Revision that was created by our Configuration:
```shell
```bash
kubectl get revision -l \
"serving.knative.dev/service=stock-service-example" --output yaml
```
- View the Deployment created by our Revision
```shell
```bash
kubectl get deployment -l \
"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:
```shell
```bash
kubectl get ksvc stock-service-example --output=custom-columns=NAME:.metadata.name,URL:.status.url
NAME URL
stock-service-example http://stock-service-example.default.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:
```shell
```bash
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:
```shell
```bash
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
"[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>
```
@ -196,7 +196,7 @@ and then you run `curl` commands to send request with your stock symbol.
Request:
```shell
```bash
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:
```shell
```bash
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
following commands:
```shell
```bash
git clone -b "{{ branch }}" https://github.com/knative/docs knative-docs
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
configured so that any authenticated identity may read it.
```shell
```bash
gcloud iam service-accounts create knative-secrets
```
1. Create a new JSON key for this account
```shell
```bash
gcloud iam service-accounts keys create robot.json \
--iam-account=knative-secrets@$PROJECT_ID.iam.gserviceaccount.com
```
1. Create a new Kubernetes secret from this JSON key:
```shell
```bash
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
username:
```shell
```bash
# Build the container on your local machine
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
the configuration using `kubectl`:
```shell
```bash
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:
```shell
```bash
kubectl get ksvc secrets-go --output=custom-columns=NAME:.metadata.name,URL:.status.url
```
Example:
```shell
```bash
NAME URL
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
the URL below with the URL returned in the previous command.
```shell
```bash
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
```
@ -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:
```shell
```bash
kubectl delete --filename service.yaml
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:
```shell
```bash
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
`Welcome to the stock app!`.
```shell
```bash
curl --header "Host:${SERVICE_HOSTNAME}" http://${INGRESS_IP}
```

View File

@ -52,7 +52,7 @@ spec:
Update gateway instance `knative-ingress-gateway` under `knative-serving`
namespace:
```shell
```bash
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`
namespace:
```shell
```bash
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
own domain, for example `mydomain.com`:
```shell
```bash
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:
```shell
```bash
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"
with the following command:
```shell
```bash
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:
```shell
```bash
export INGRESSGATEWAY=istio-ingressgateway
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
machine with:
```shell
```bash
INGRESSGATEWAY=istio-ingressgateway
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
challenge during authorization:
```shell
```bash
./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
private key, `key.pem`, by entering the following command:
```shell
```bash
kubectl create --namespace contour-external secret tls default-cert \
--key key.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
when auto-TLS is disabled. This can be done with the following patch:
```shell
```bash
kubectl patch cm config-contour -n knative-serving \
-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
private key, `key.pem`, by entering the following command:
```shell
```bash
kubectl create --namespace istio-system secret tls tls-cert \
--key key.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
mode:
```shell
```bash
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
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
Cloud DNS provider info defined. For the complete Google Cloud DNS
example, see
[Configuring HTTPS with cert-manager and Google Cloud DNS](./using-cert-manager-on-gcp).
Cloud DNS provider info defined.
```shell
```bash
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
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
following command:
```shell
```bash
kubectl get deployment networking-certmanager -n knative-serving
```
1. If `networking-certmanager` is not found, run the following command:
```shell
```bash
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
running the following command:
```shell
```bash
kubectl get deployment networking-ns-cert -n knative-serving
```
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") }}
```
@ -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:
```shell
```bash
kubectl edit configmap config-certmanager --namespace knative-serving
```
1. Add the `issuerRef` within the `data` section:
```shell
```bash
data:
issuerRef: |
kind: ClusterIssuer
@ -194,7 +192,7 @@ in the `knative-serving` namespace to reference your new `ClusterIssuer`.
Example:
```shell
```bash
apiVersion: v1
kind: ConfigMap
metadata:
@ -213,7 +211,7 @@ in the `knative-serving` namespace to reference your new `ClusterIssuer`.
1. Ensure that the file was updated successfully:
```shell
```bash
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:
```shell
```bash
kubectl edit configmap config-network --namespace knative-serving
```
1. Add the `autoTLS: Enabled` attribute under the `data` section:
```shell
```bash
data:
autoTLS: Enabled
```
Example:
```shell
```bash
apiVersion: v1
kind: ConfigMap
metadata:
@ -267,14 +265,14 @@ requests are handled:
- `Redirected`: Responds to HTTP request with a `302` redirect to ask the
clients to use HTTPS.
```shell
```bash
data:
httpProtocol: Redirected
```
Example:
```shell
```bash
apiVersion: v1
kind: ConfigMap
metadata:
@ -292,7 +290,7 @@ requests are handled:
1. Ensure that the file was updated successfully:
```shell
```bash
kubectl get configmap config-network --namespace knative-serving --output yaml
```
@ -303,7 +301,7 @@ be able to handle HTTPS traffic.
### Verify Auto TLS
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
```

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
`knative/docs` repository:
```shell
```bash
mkdir -p ${GOPATH}/src/knative.dev
cd ${GOPATH}/src/knative.dev
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:
```shell
```bash
git clone --recurse-submodules https://github.com/knative/website.git
```
If you accidentally cloned this repo without `--recurse-submodules`, you'll
need to do the following inside the repo:
```shell
```bash
git submodule init
git submodule update
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
to test docs changes alongside the website:
```shell
```bash
git clone https://github.com/knative/docs.git
```
You may also want to clone the community repo:
```shell
```bash
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
[Homebrew](https://brew.sh/):
```shell
```bash
brew install gnu-sed
# You need to put it in your PATH before the built-in Mac sed
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):
```shell
```bash
sudo launchctl limit maxfiles 65535 200000
# Probably only need around 4k FDs, but 64k is defensive...
ulimit -n 65535

View File

@ -92,7 +92,7 @@ nav:
- Configuring the requests per second (RPS) target: serving/autoscaling/rps-target.md
- Configuring scale bounds: serving/autoscaling/scale-bounds.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
- Administrator Topics:
- Kubernetes services: serving/knative-kubernetes-services.md
@ -148,7 +148,7 @@ nav:
- Overview: eventing/sources/apiserversource/README.md
- Getting started: eventing/sources/apiserversource/getting-started/README.md
- ContainerSource: eventing/sources/containersource.md
- PingSource: eventing/sources/ping-source/index.md
- PingSource: eventing/sources/ping-source/README.md
- SinkBinding:
- Overview: eventing/sources/sinkbinding/README.md
- Create a SinkBinding object: eventing/sources/sinkbinding/getting-started.md
@ -173,10 +173,10 @@ nav:
- Parallel: eventing/flows/parallel.md
- Sequence:
- Overview: eventing/flows/sequence/README.md
- Displaying sequence output: eventing/flows/sequence/sequence-reply-to-event-display/index.md
- Using Sequences in series: eventing/flows/sequence/sequence-reply-to-sequence/index.md
- Create additional events: eventing/flows/sequence/sequence-terminal/index.md
- Using with Broker and Trigger: eventing/flows/sequence/sequence-with-broker-trigger/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/README.md
- Create additional events: eventing/flows/sequence/sequence-terminal/README.md
- Using with Broker and Trigger: eventing/flows/sequence/sequence-with-broker-trigger/README.md
- Channels:
- Overview: eventing/channels/README.md
- Channel types and defaults: eventing/channels/channel-types-defaults.md
@ -198,7 +198,7 @@ nav:
- Sink:
- Overview: eventing/sink/README.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
- Experimental Features: eventing/experimental-features.md
- Code samples:
@ -210,7 +210,7 @@ nav:
- Python: eventing/samples/helloworld/helloworld-python/README.md
- Apache Kafka:
- 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
- Parallel:
- Overview: eventing/samples/parallel/README.md
@ -222,8 +222,7 @@ nav:
- CloudStorageSource: eventing/sources/cloud-storage-source/README.md
- GitHub source: eventing/sources/github-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:
- Serving: reference/api/serving.md
@ -293,9 +292,10 @@ plugins:
# Redirects
- redirects:
redirect_maps:
'help/README.md': 'docs/help/contributor/README.md'
'serving/metrics.md': 'admin/collecting-metrics/serving-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'
'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'
@ -306,6 +306,7 @@ plugins:
'install/README.md': 'admin/install/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'
# This doesn't exist anymore, we should probably replace it
'install/install-extensions.md': 'admin/install/install-extensions.md'
'install/install-serving-with-yaml.md': 'admin/install/serving/install-serving-with-yaml.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
locally:
```shell
```bash
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
variable that directly matches the envconfig tag in your struct definition:
```shell
```bash
export SERVICE_HOST=127.0.0.1
export MYAPP_DEBUG=true
```

View File

@ -4,7 +4,7 @@ Simple wrappers for primitive types to enforce atomic access.
## Installation
```shell
```bash
$ 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.
```shell
```bash
$ 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.
```shell
```bash
go get -u gopkg.in/go-playground/webhooks.v3
```