diff --git a/community/samples/serving/helloworld-clojure/index.md b/community/samples/serving/helloworld-clojure/index.md index c7d069d00..ddf7fe208 100644 --- a/community/samples/serving/helloworld-clojure/index.md +++ b/community/samples/serving/helloworld-clojure/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-dart/index.md b/community/samples/serving/helloworld-dart/index.md index 24c05dfe5..91af18523 100644 --- a/community/samples/serving/helloworld-dart/index.md +++ b/community/samples/serving/helloworld-dart/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-deno/index.md b/community/samples/serving/helloworld-deno/index.md index 9171d2254..51b34728c 100644 --- a/community/samples/serving/helloworld-deno/index.md +++ b/community/samples/serving/helloworld-deno/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-elixir/index.md b/community/samples/serving/helloworld-elixir/index.md index 6c7d6dd46..ffcf5fb79 100644 --- a/community/samples/serving/helloworld-elixir/index.md +++ b/community/samples/serving/helloworld-elixir/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-haskell/index.md b/community/samples/serving/helloworld-haskell/index.md index 671c637a0..3a20f5b0d 100644 --- a/community/samples/serving/helloworld-haskell/index.md +++ b/community/samples/serving/helloworld-haskell/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-java-micronaut/index.md b/community/samples/serving/helloworld-java-micronaut/index.md index a416eb722..1ffa74928 100644 --- a/community/samples/serving/helloworld-java-micronaut/index.md +++ b/community/samples/serving/helloworld-java-micronaut/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-java-quarkus/index.md b/community/samples/serving/helloworld-java-quarkus/index.md index b4ad8e9b7..6ff339dd3 100644 --- a/community/samples/serving/helloworld-java-quarkus/index.md +++ b/community/samples/serving/helloworld-java-quarkus/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-r/index.md b/community/samples/serving/helloworld-r/index.md index eddbf2548..214ef0d5e 100644 --- a/community/samples/serving/helloworld-r/index.md +++ b/community/samples/serving/helloworld-r/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-rserver/index.md b/community/samples/serving/helloworld-rserver/index.md index 911695767..591b40415 100644 --- a/community/samples/serving/helloworld-rserver/index.md +++ b/community/samples/serving/helloworld-rserver/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-rust/index.md b/community/samples/serving/helloworld-rust/index.md index f54a6aef9..30b34b938 100644 --- a/community/samples/serving/helloworld-rust/index.md +++ b/community/samples/serving/helloworld-rust/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-swift/index.md b/community/samples/serving/helloworld-swift/index.md index 52baa61cd..93a66b4d9 100644 --- a/community/samples/serving/helloworld-swift/index.md +++ b/community/samples/serving/helloworld-swift/index.md @@ -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 ``` diff --git a/community/samples/serving/helloworld-vertx/index.md b/community/samples/serving/helloworld-vertx/index.md index 06b34e979..8c4284fef 100644 --- a/community/samples/serving/helloworld-vertx/index.md +++ b/community/samples/serving/helloworld-vertx/index.md @@ -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 ``` diff --git a/community/samples/serving/machinelearning-python-bentoml/index.md b/community/samples/serving/machinelearning-python-bentoml/index.md index cc7f2a3b8..3138b6da5 100644 --- a/community/samples/serving/machinelearning-python-bentoml/index.md +++ b/community/samples/serving/machinelearning-python-bentoml/index.md @@ -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 ``` diff --git a/docs/admin/collecting-logs/README.md b/docs/admin/collecting-logs/README.md index 5be353107..b3adcc047 100644 --- a/docs/admin/collecting-logs/README.md +++ b/docs/admin/collecting-logs/README.md @@ -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 ``` diff --git a/docs/admin/collecting-metrics/README.md b/docs/admin/collecting-metrics/README.md index ae4fc7310..e227275f8 100644 --- a/docs/admin/collecting-metrics/README.md +++ b/docs/admin/collecting-metrics/README.md @@ -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 ``` 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 ``` @@ -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 ``` diff --git a/docs/admin/install/installing-istio.md b/docs/admin/install/installing-istio.md index 3084e83b7..b24d409e0 100644 --- a/docs/admin/install/installing-istio.md +++ b/docs/admin/install/installing-istio.md @@ -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 ``` diff --git a/docs/developer/serving/services/private-services.md b/docs/developer/serving/services/private-services.md index 189bd7d6e..3e971166f 100644 --- a/docs/developer/serving/services/private-services.md +++ b/docs/developer/serving/services/private-services.md @@ -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 diff --git a/docs/developer/serving/troubleshooting/debugging-application-issues.md b/docs/developer/serving/troubleshooting/debugging-application-issues.md index 3a4182119..288dfd04c 100644 --- a/docs/developer/serving/troubleshooting/debugging-application-issues.md +++ b/docs/developer/serving/troubleshooting/debugging-application-issues.md @@ -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 --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= -n --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 --output jsonpath="{.status.latestCreatedRevisionName}" ``` @@ -111,7 +111,7 @@ name in the `Route` yaml file. Then run the following command: -```shell +```bash kubectl get revision --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 --output yaml ``` diff --git a/docs/eventing/accessing-traces.md b/docs/eventing/accessing-traces.md index b41d1d581..13fa882e5 100644 --- a/docs/eventing/accessing-traces.md +++ b/docs/eventing/accessing-traces.md @@ -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 ``` diff --git a/docs/eventing/broker/configmaps/README.md b/docs/eventing/broker/configmaps/README.md index 07b2e18c7..bb0f02671 100644 --- a/docs/eventing/broker/configmaps/README.md +++ b/docs/eventing/broker/configmaps/README.md @@ -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 - < -n ``` @@ -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 ``` @@ -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 get broker ``` 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 ``` diff --git a/docs/eventing/broker/kafka-broker/kafka-configmap.md b/docs/eventing/broker/kafka-broker/kafka-configmap.md index 95e48f0dc..abff5deaa 100644 --- a/docs/eventing/broker/kafka-broker/kafka-configmap.md +++ b/docs/eventing/broker/kafka-broker/kafka-configmap.md @@ -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 - < diff --git a/docs/eventing/channels/generator/ReadmeTemplate.gomd b/docs/eventing/channels/generator/ReadmeTemplate.gomd index e63e0289f..be783c02b 100644 --- a/docs/eventing/channels/generator/ReadmeTemplate.gomd +++ b/docs/eventing/channels/generator/ReadmeTemplate.gomd @@ -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 ``` --> diff --git a/docs/eventing/debugging/index.md b/docs/eventing/debugging/README.md similarity index 98% rename from docs/eventing/debugging/index.md rename to docs/eventing/debugging/README.md index 35d333000..e4cf1c232 100644 --- a/docs/eventing/debugging/index.md +++ b/docs/eventing/debugging/README.md @@ -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"} diff --git a/docs/eventing/flows/sequence/sequence-reply-to-event-display/index.md b/docs/eventing/flows/sequence/sequence-reply-to-event-display/README.md similarity index 98% rename from docs/eventing/flows/sequence/sequence-reply-to-event-display/index.md rename to docs/eventing/flows/sequence/sequence-reply-to-event-display/README.md index d52907d80..c1b415a1a 100644 --- a/docs/eventing/flows/sequence/sequence-reply-to-event-display/index.md +++ b/docs/eventing/flows/sequence/sequence-reply-to-event-display/README.md @@ -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 diff --git a/docs/eventing/flows/sequence/sequence-reply-to-sequence/index.md b/docs/eventing/flows/sequence/sequence-reply-to-sequence/README.md similarity index 99% rename from docs/eventing/flows/sequence/sequence-reply-to-sequence/index.md rename to docs/eventing/flows/sequence/sequence-reply-to-sequence/README.md index e339ed799..dd4f959ed 100644 --- a/docs/eventing/flows/sequence/sequence-reply-to-sequence/index.md +++ b/docs/eventing/flows/sequence/sequence-reply-to-sequence/README.md @@ -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 diff --git a/docs/eventing/flows/sequence/sequence-terminal/index.md b/docs/eventing/flows/sequence/sequence-terminal/README.md similarity index 99% rename from docs/eventing/flows/sequence/sequence-terminal/index.md rename to docs/eventing/flows/sequence/sequence-terminal/README.md index e6d5b3d2c..1a08d04ed 100644 --- a/docs/eventing/flows/sequence/sequence-terminal/index.md +++ b/docs/eventing/flows/sequence/sequence-terminal/README.md @@ -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 diff --git a/docs/eventing/flows/sequence/sequence-with-broker-trigger/index.md b/docs/eventing/flows/sequence/sequence-with-broker-trigger/README.md similarity index 98% rename from docs/eventing/flows/sequence/sequence-with-broker-trigger/index.md rename to docs/eventing/flows/sequence/sequence-with-broker-trigger/README.md index 2f762cb7a..be8a1ef42 100644 --- a/docs/eventing/flows/sequence/sequence-with-broker-trigger/index.md +++ b/docs/eventing/flows/sequence/sequence-with-broker-trigger/README.md @@ -36,7 +36,7 @@ The functions used in these examples live in To create the cluster default Broker type: -```shell +```bash kubectl create -f - < generic \ --from-literal=password="SecretPassword" \ --from-literal=saslType="PLAIN" \ diff --git a/docs/eventing/samples/parallel/multiple-branches/README.md b/docs/eventing/samples/parallel/multiple-branches/README.md index 60df45b37..aa5ffd28a 100644 --- a/docs/eventing/samples/parallel/multiple-branches/README.md +++ b/docs/eventing/samples/parallel/multiple-branches/README.md @@ -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 diff --git a/docs/eventing/samples/parallel/mutual-exclusivity/README.md b/docs/eventing/samples/parallel/mutual-exclusivity/README.md index 947b85a2d..9238d85e6 100644 --- a/docs/eventing/samples/parallel/mutual-exclusivity/README.md +++ b/docs/eventing/samples/parallel/mutual-exclusivity/README.md @@ -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 diff --git a/docs/eventing/sources/README.md b/docs/eventing/sources/README.md index 0c3579053..7d286fcc1 100644 --- a/docs/eventing/sources/README.md +++ b/docs/eventing/sources/README.md @@ -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 - ``` - diff --git a/docs/eventing/sources/apache-camel-source/README.md b/docs/eventing/sources/apache-camel-source/README.md index 8ea28682d..5e36edca0 100644 --- a/docs/eventing/sources/apache-camel-source/README.md +++ b/docs/eventing/sources/apache-camel-source/README.md @@ -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 `` 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 ``` diff --git a/docs/eventing/sources/apiserversource/getting-started/README.md b/docs/eventing/sources/apiserversource/getting-started/README.md index 5dde37036..921185163 100644 --- a/docs/eventing/sources/apiserversource/getting-started/README.md +++ b/docs/eventing/sources/apiserversource/getting-started/README.md @@ -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 ``` - where; - - `` is the name of the namespace that you want to create. + Where `` 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 \ + --namespace \ + --mode "Resource" \ + --resource "Event:v1" \ + --service-account \ + --sink + ``` + where; + - `` is the name of the source that you want to create. + - `` is the name of the namespace that you created in step 1 above. + - `` is the name of the service account that you created in step 2 above. + - `` 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 - `` 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 \ - --namespace \ - --mode "Resource" \ - --resource "Event:v1" \ - --service-account \ - --sink - ``` - where; - - `` is the name of the source that you want to create. - - `` is the name of the namespace that you created in step 1 above. - - `` is the name of the service account that you created in step 2 above. - - `` 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= --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= 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= -l app= --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 ``` -where; -- `` is the name of the namespace that you created in step 1 above. +Where `` is the name of the namespace that you created in step 1 above. diff --git a/docs/eventing/sources/container-source/README.md b/docs/eventing/sources/container-source/README.md index 5ca33cdf7..f38c89a0f 100644 --- a/docs/eventing/sources/container-source/README.md +++ b/docs/eventing/sources/container-source/README.md @@ -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 ``` diff --git a/docs/eventing/sources/containersource.md b/docs/eventing/sources/containersource.md index 9784f1e44..d2dc5ddce 100644 --- a/docs/eventing/sources/containersource.md +++ b/docs/eventing/sources/containersource.md @@ -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 ``` diff --git a/docs/eventing/sources/github-source/README.md b/docs/eventing/sources/github-source/README.md index 329316876..60ab64f54 100644 --- a/docs/eventing/sources/github-source/README.md +++ b/docs/eventing/sources/github-source/README.md @@ -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 diff --git a/docs/eventing/sources/gitlab-source/README.md b/docs/eventing/sources/gitlab-source/README.md index 4fd88aab8..98006cf92 100644 --- a/docs/eventing/sources/gitlab-source/README.md +++ b/docs/eventing/sources/gitlab-source/README.md @@ -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 `` with version tag: -```shell +```bash kubectl apply -f https://github.com/knative-sandbox/eventing-gitlab/releases/download//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 diff --git a/docs/eventing/sources/kafka-source/README.md b/docs/eventing/sources/kafka-source/README.md index c5dff83e2..13d160637 100644 --- a/docs/eventing/sources/kafka-source/README.md +++ b/docs/eventing/sources/kafka-source/README.md @@ -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 ``` diff --git a/docs/eventing/sources/ping-source/index.md b/docs/eventing/sources/ping-source/README.md similarity index 96% rename from docs/eventing/sources/ping-source/index.md rename to docs/eventing/sources/ping-source/README.md index 1291dc935..572e931ae 100644 --- a/docs/eventing/sources/ping-source/index.md +++ b/docs/eventing/sources/ping-source/README.md @@ -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 - < ``` Where `` is the name of the namespace that contains the SinkBinding object. diff --git a/docs/eventing/sugar/README.md b/docs/eventing/sugar/README.md index 9c1228890..d7961c2a4 100644 --- a/docs/eventing/sugar/README.md +++ b/docs/eventing/sugar/README.md @@ -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 - < . docker push ``` @@ -68,7 +68,7 @@ cd knative-docs/docs/serving/samples/cloudevents/cloudevents-dotnet 1. If you look in `service.yaml`, take the `` 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 ``` diff --git a/docs/serving/samples/cloudevents/cloudevents-go/README.md b/docs/serving/samples/cloudevents/cloudevents-go/README.md index 121395518..fd7f93066 100644 --- a/docs/serving/samples/cloudevents/cloudevents-go/README.md +++ b/docs/serving/samples/cloudevents/cloudevents-go/README.md @@ -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 . docker push ``` @@ -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 `` 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= ``` @@ -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 ``` diff --git a/docs/serving/samples/cloudevents/cloudevents-nodejs/README.md b/docs/serving/samples/cloudevents/cloudevents-nodejs/README.md index cb3c034f9..d0b820135 100644 --- a/docs/serving/samples/cloudevents/cloudevents-nodejs/README.md +++ b/docs/serving/samples/cloudevents/cloudevents-nodejs/README.md @@ -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 . docker push ``` @@ -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 `` 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= ``` @@ -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 ``` diff --git a/docs/serving/samples/cloudevents/cloudevents-rust/README.md b/docs/serving/samples/cloudevents/cloudevents-rust/README.md index 978826945..5c61ba6d2 100644 --- a/docs/serving/samples/cloudevents/cloudevents-rust/README.md +++ b/docs/serving/samples/cloudevents/cloudevents-rust/README.md @@ -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 . ``` @@ -63,7 +63,7 @@ docker build -t . To deploy the Knative Service, look in the `service.yaml` and replace `` with the deployed image name. Then run: - ```shell + ```bash kubectl apply -f service.yaml ``` @@ -72,7 +72,7 @@ docker build -t . If using `kn` to deploy: - ```shell + ```bash kn service create cloudevents-rust --image= ``` @@ -84,7 +84,7 @@ docker build -t . 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 ``` diff --git a/docs/serving/samples/cloudevents/cloudevents-spring/README.md b/docs/serving/samples/cloudevents/cloudevents-spring/README.md index 8eced7ec6..b745349e3 100644 --- a/docs/serving/samples/cloudevents/cloudevents-spring/README.md +++ b/docs/serving/samples/cloudevents/cloudevents-spring/README.md @@ -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= ``` To deploy the Knative Service, edit the `service.yaml` file and replace `` 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 ``` diff --git a/docs/serving/samples/cloudevents/cloudevents-vertx/README.md b/docs/serving/samples/cloudevents/cloudevents-vertx/README.md index 92d906bcd..7c1256664 100644 --- a/docs/serving/samples/cloudevents/cloudevents-vertx/README.md +++ b/docs/serving/samples/cloudevents/cloudevents-vertx/README.md @@ -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= ``` @@ -54,7 +54,7 @@ mvn compile jib:build -Dimage= To deploy the Knative Service, look in the `service.yaml` and replace `` with the deployed image name. Then run: - ```shell + ```bash kubectl apply -f service.yaml ``` @@ -63,7 +63,7 @@ mvn compile jib:build -Dimage= If using `kn` to deploy: - ```shell + ```bash kn service create cloudevents-vertx --image= ``` @@ -75,7 +75,7 @@ mvn compile jib:build -Dimage= 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 ``` diff --git a/docs/serving/samples/gitwebhook-go/README.md b/docs/serving/samples/gitwebhook-go/README.md index d3ca8e41a..b21a0fa0e 100644 --- a/docs/serving/samples/gitwebhook-go/README.md +++ b/docs/serving/samples/gitwebhook-go/README.md @@ -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 ``` diff --git a/docs/serving/samples/grpc-ping-go/README.md b/docs/serving/samples/grpc-ping-go/README.md index 3ffbb0f6e..81ce36da0 100644 --- a/docs/serving/samples/grpc-ping-go/README.md +++ b/docs/serving/samples/grpc-ping-go/README.md @@ -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" \ diff --git a/docs/serving/samples/hello-world/helloworld-csharp/README.md b/docs/serving/samples/hello-world/helloworld-csharp/README.md index f689077ee..1fa7f7d52 100644 --- a/docs/serving/samples/hello-world/helloworld-csharp/README.md +++ b/docs/serving/samples/hello-world/helloworld-csharp/README.md @@ -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 ``` diff --git a/docs/serving/samples/hello-world/helloworld-go/README.md b/docs/serving/samples/hello-world/helloworld-go/README.md index 4402d5de2..790a00690 100644 --- a/docs/serving/samples/hello-world/helloworld-go/README.md +++ b/docs/serving/samples/hello-world/helloworld-go/README.md @@ -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 ``` diff --git a/docs/serving/samples/hello-world/helloworld-java-spark/README.md b/docs/serving/samples/hello-world/helloworld-java-spark/README.md index b822a4233..d77c55dee 100644 --- a/docs/serving/samples/hello-world/helloworld-java-spark/README.md +++ b/docs/serving/samples/hello-world/helloworld-java-spark/README.md @@ -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 ``` diff --git a/docs/serving/samples/hello-world/helloworld-kotlin/README.md b/docs/serving/samples/hello-world/helloworld-kotlin/README.md index 43be0d0d7..bd7dd8b28 100644 --- a/docs/serving/samples/hello-world/helloworld-kotlin/README.md +++ b/docs/serving/samples/hello-world/helloworld-kotlin/README.md @@ -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 ``` diff --git a/docs/serving/samples/hello-world/helloworld-nodejs/README.md b/docs/serving/samples/hello-world/helloworld-nodejs/README.md index 6af0a4f21..e38a7baf3 100644 --- a/docs/serving/samples/hello-world/helloworld-nodejs/README.md +++ b/docs/serving/samples/hello-world/helloworld-nodejs/README.md @@ -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 ``` diff --git a/docs/serving/samples/hello-world/helloworld-php/README.md b/docs/serving/samples/hello-world/helloworld-php/README.md index a85743a21..941c45db5 100644 --- a/docs/serving/samples/hello-world/helloworld-php/README.md +++ b/docs/serving/samples/hello-world/helloworld-php/README.md @@ -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 ``` diff --git a/docs/serving/samples/hello-world/helloworld-python/README.md b/docs/serving/samples/hello-world/helloworld-python/README.md index 73d00b358..5714a0e89 100644 --- a/docs/serving/samples/hello-world/helloworld-python/README.md +++ b/docs/serving/samples/hello-world/helloworld-python/README.md @@ -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 ``` diff --git a/docs/serving/samples/hello-world/helloworld-ruby/README.md b/docs/serving/samples/hello-world/helloworld-ruby/README.md index db211c0fb..8d6db9b95 100644 --- a/docs/serving/samples/hello-world/helloworld-ruby/README.md +++ b/docs/serving/samples/hello-world/helloworld-ruby/README.md @@ -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 ``` diff --git a/docs/serving/samples/hello-world/helloworld-scala/README.md b/docs/serving/samples/hello-world/helloworld-scala/README.md index 7849bdbd2..1078a0e56 100644 --- a/docs/serving/samples/hello-world/helloworld-scala/README.md +++ b/docs/serving/samples/hello-world/helloworld-scala/README.md @@ -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: dev.local/helloworld-scala: ``` @@ -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 ``` diff --git a/docs/serving/samples/hello-world/helloworld-shell/README.md b/docs/serving/samples/hello-world/helloworld-shell/README.md index 84d376a3b..dae32fdec 100644 --- a/docs/serving/samples/hello-world/helloworld-shell/README.md +++ b/docs/serving/samples/hello-world/helloworld-shell/README.md @@ -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 ``` diff --git a/docs/serving/samples/knative-routing-go/README.md b/docs/serving/samples/knative-routing-go/README.md index 0b09f7299..170623ae1 100644 --- a/docs/serving/samples/knative-routing-go/README.md +++ b/docs/serving/samples/knative-routing-go/README.md @@ -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/" ``` If you use Docker Hub as your docker image registry, replace with your dockerhub username and run the following command: -```shell +```bash export REPO="docker.io/" ``` @@ -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: " ``` @@ -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: " ``` @@ -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 ``` diff --git a/docs/serving/samples/multi-container/README.md b/docs/serving/samples/multi-container/README.md index 723400d87..8bb430f6d 100644 --- a/docs/serving/samples/multi-container/README.md +++ b/docs/serving/samples/multi-container/README.md @@ -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 ``` diff --git a/docs/serving/samples/rest-api-go/README.md b/docs/serving/samples/rest-api-go/README.md index 0daa54ff4..e3f416049 100644 --- a/docs/serving/samples/rest-api-go/README.md +++ b/docs/serving/samples/rest-api-go/README.md @@ -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/" ``` @@ -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/ ``` @@ -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 ``` diff --git a/docs/serving/samples/secrets-go/README.md b/docs/serving/samples/secrets-go/README.md index 77be424c3..9f188784a 100644 --- a/docs/serving/samples/secrets-go/README.md +++ b/docs/serving/samples/secrets-go/README.md @@ -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 ``` diff --git a/docs/serving/samples/tag-header-based-routing/README.md b/docs/serving/samples/tag-header-based-routing/README.md index 3b53d6dd1..1d5d6a01b 100644 --- a/docs/serving/samples/tag-header-based-routing/README.md +++ b/docs/serving/samples/tag-header-based-routing/README.md @@ -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 ``` diff --git a/docs/serving/samples/traffic-splitting/README.md b/docs/serving/samples/traffic-splitting/README.md index 6e2a832c7..bf72e3fc5 100644 --- a/docs/serving/samples/traffic-splitting/README.md +++ b/docs/serving/samples/traffic-splitting/README.md @@ -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} ``` diff --git a/docs/serving/setting-up-custom-ingress-gateway.md b/docs/serving/setting-up-custom-ingress-gateway.md index 8601cc1fc..ad30b3e58 100644 --- a/docs/serving/setting-up-custom-ingress-gateway.md +++ b/docs/serving/setting-up-custom-ingress-gateway.md @@ -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 ``` diff --git a/docs/serving/using-a-custom-domain.md b/docs/serving/using-a-custom-domain.md index 11dcfb761..c43df95b6 100644 --- a/docs/serving/using-a-custom-domain.md +++ b/docs/serving/using-a-custom-domain.md @@ -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']}"` diff --git a/docs/serving/using-a-tls-cert.md b/docs/serving/using-a-tls-cert.md index b412e6985..c483ed4ed 100644 --- a/docs/serving/using-a-tls-cert.md +++ b/docs/serving/using-a-tls-cert.md @@ -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 ``` diff --git a/docs/serving/using-auto-tls.md b/docs/serving/using-auto-tls.md index b8f0e82ba..c1364f088 100644 --- a/docs/serving/using-auto-tls.md +++ b/docs/serving/using-auto-tls.md @@ -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 ``` diff --git a/help/contributor/how-to/github.md b/help/contributor/how-to/github.md index d814bfa04..e3244a33b 100644 --- a/help/contributor/how-to/github.md +++ b/help/contributor/how-to/github.md @@ -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 diff --git a/help/contributor/publishing.md b/help/contributor/publishing.md index f803cf5b0..ec17d9855 100644 --- a/help/contributor/publishing.md +++ b/help/contributor/publishing.md @@ -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 diff --git a/mkdocs.yml b/mkdocs.yml index 9133247eb..6a6356f2a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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' diff --git a/test/README.md b/test/README.md index 30c501568..e9f7db5e4 100644 --- a/test/README.md +++ b/test/README.md @@ -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 ``` diff --git a/vendor/github.com/kelseyhightower/envconfig/README.md b/vendor/github.com/kelseyhightower/envconfig/README.md index 33408d645..6fe2bed32 100644 --- a/vendor/github.com/kelseyhightower/envconfig/README.md +++ b/vendor/github.com/kelseyhightower/envconfig/README.md @@ -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 ``` diff --git a/vendor/go.uber.org/atomic/README.md b/vendor/go.uber.org/atomic/README.md index ade0c20f1..2d893ad44 100644 --- a/vendor/go.uber.org/atomic/README.md +++ b/vendor/go.uber.org/atomic/README.md @@ -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 ``` diff --git a/vendor/gopkg.in/go-playground/webhooks.v3/README.md b/vendor/gopkg.in/go-playground/webhooks.v3/README.md index 53bac3771..0226c6674 100644 --- a/vendor/gopkg.in/go-playground/webhooks.v3/README.md +++ b/vendor/gopkg.in/go-playground/webhooks.v3/README.md @@ -23,7 +23,7 @@ Installation Use go get. -```shell +```bash go get -u gopkg.in/go-playground/webhooks.v3 ```