diff --git a/_topic_maps/_topic_map.yml b/_topic_maps/_topic_map.yml index 81dcf0725f..7e8daca5a2 100644 --- a/_topic_maps/_topic_map.yml +++ b/_topic_maps/_topic_map.yml @@ -3215,6 +3215,8 @@ Topics: File: serverless-event-sinks - Name: Event delivery File: serverless-event-delivery + - Name: Listing event sources and event source types + File: serverless-listing-event-sources - Name: Creating an API server source File: serverless-apiserversource - Name: Creating a ping source @@ -3322,7 +3324,7 @@ Topics: File: serverless-functions-eventing - Name: Function project configuration in func.yaml File: serverless-functions-yaml - - Name: Accessing secrets and config maps from Serverless functions + - Name: Accessing secrets and config maps from functions File: serverless-functions-accessing-secrets-configmaps - Name: Adding annotations to functions File: serverless-functions-annotations @@ -3345,15 +3347,13 @@ Topics: - Name: Reference Dir: reference Topics: - - Name: kn flags reference + - Name: Knative CLI flags File: kn-flags-reference - Name: Knative Serving CLI commands File: kn-serving-ref - Name: Knative Eventing CLI commands File: kn-eventing-ref - - Name: Listing event sources and event source types - File: serverless-listing-event-sources - - Name: kn func + - Name: Functions commands File: kn-func-ref - Name: kn event File: kn-event-ref diff --git a/modules/apiserversource-kn.adoc b/modules/apiserversource-kn.adoc index d9fc6cb268..ecca8f300f 100644 --- a/modules/apiserversource-kn.adoc +++ b/modules/apiserversource-kn.adoc @@ -1,6 +1,7 @@ // Module included in the following assemblies: // -// serverless/develop/serverless-apiserversource.adoc +// * serverless/develop/serverless-apiserversource.adoc +// * serverless/reference/kn-eventing-ref.adoc :_content-type: PROCEDURE [id="apiserversource-kn_{context}"] diff --git a/modules/creating-serverless-apps-kn.adoc b/modules/creating-serverless-apps-kn.adoc index 9109b6c8f4..587b1124f3 100644 --- a/modules/creating-serverless-apps-kn.adoc +++ b/modules/creating-serverless-apps-kn.adoc @@ -1,6 +1,7 @@ // Module included in the following assemblies: // // * serverless/develop/serverless-applications.adoc +// * serverless/reference/kn-serving-ref.adoc :_content-type: PROCEDURE [id="creating-serverless-apps-kn_{context}"] @@ -12,6 +13,7 @@ The following procedure describes how you can create a basic serverless applicat * {ServerlessOperatorName} and Knative Serving are installed on your cluster. * You have installed the `kn` CLI. +* You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in {product-title}. .Procedure diff --git a/modules/serverless-connect-sink-source-odc.adoc b/modules/serverless-connect-sink-source-odc.adoc index 8e6226d220..7848e270ea 100644 --- a/modules/serverless-connect-sink-source-odc.adoc +++ b/modules/serverless-connect-sink-source-odc.adoc @@ -1,6 +1,7 @@ // Module included in the following assemblies: // // * serverless/develop/serverless-event-sinks.adoc +// * serverless/functions/serverless-functions-eventing.adoc :_content-type: PROCEDURE [id="serverless-connect-sink-source-odc_{context}"] @@ -10,8 +11,6 @@ You can create multiple event source types in {product-title} that can be connec .Prerequisites -To connect an event source to a sink using the *Developer* perspective, ensure that: - * The {ServerlessOperatorName}, Knative Serving, and Knative Eventing are installed on your {product-title} cluster. * You have created a sink. * You have logged in to the web console and are in the *Developer* perspective. @@ -20,7 +19,9 @@ To connect an event source to a sink using the *Developer* perspective, ensure t .Procedure . Create an event source of any type, by navigating to *+Add* -> *Event Sources* and then selecting the event source type that you want to create. + . In the *Sink* section of the *Event Sources* form view, select *Resource*. Then use the drop-down list to select your sink. + . Click *Create*. .Verification @@ -28,4 +29,5 @@ To connect an event source to a sink using the *Developer* perspective, ensure t You can verify that the event source was created and is connected to the sink by viewing the *Topology* page. . In the *Developer* perspective, navigate to *Topology*. + . View the event source and click on the connected sink to see the sink details in the side panel. diff --git a/modules/serverless-create-domain-mapping-kn.adoc b/modules/serverless-create-domain-mapping-kn.adoc index c8feae65cc..1d91cbc323 100644 --- a/modules/serverless-create-domain-mapping-kn.adoc +++ b/modules/serverless-create-domain-mapping-kn.adoc @@ -1,6 +1,7 @@ // Module included in the following assemblies: // // * serverless/security/serverless-custom-domains.adoc +// * serverless/reference/kn-serving-ref.adoc :_content-type: PROCEDURE [id="serverless-create-domain-mapping-kn_{context}"] @@ -22,6 +23,7 @@ If a prefix is not provided when using the `--ref` flag, it is assumed that the Your custom domain must point to the DNS of the {product-title} cluster. ==== * You have installed the `kn` CLI tool. +* You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in {product-title}. .Procedure diff --git a/modules/serverless-create-func-kn.adoc b/modules/serverless-create-func-kn.adoc index 97b8149b26..d292487dd2 100644 --- a/modules/serverless-create-func-kn.adoc +++ b/modules/serverless-create-func-kn.adoc @@ -1,6 +1,7 @@ // Module included in the following assemblies: // // * serverless/functions/serverless-functions-getting-started.adoc +// * serverless/reference/kn-func-ref.adoc :_content-type: PROCEDURE [id="serverless-create-func-kn_{context}"] diff --git a/modules/serverless-functions-adding-annotations.adoc b/modules/serverless-functions-adding-annotations.adoc index 51027f0fec..9c79c38287 100644 --- a/modules/serverless-functions-adding-annotations.adoc +++ b/modules/serverless-functions-adding-annotations.adoc @@ -1,7 +1,19 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-annotations.adoc + :_content-type: PROCEDURE [id="serverless-functions-adding-annotations_{context}"] = Adding annotations to a function +You can use the following procedure to add annotations to a function. + +.Prerequisites + +* The {ServerlessOperatorName} and Knative Serving are installed on the cluster. +* You have installed the `kn` CLI. +* You have created a function. + .Procedure . Open the `func.yaml` file for your function. diff --git a/modules/serverless-functions-all-values-in-configmap-to-env-variables.adoc b/modules/serverless-functions-all-values-in-configmap-to-env-variables.adoc index b49f2a7700..d2f00cbc7e 100644 --- a/modules/serverless-functions-all-values-in-configmap-to-env-variables.adoc +++ b/modules/serverless-functions-all-values-in-configmap-to-env-variables.adoc @@ -1,6 +1,20 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc + [id="serverless-functions-all-values-in-configmap-to-env-variables_{context}"] = Setting environment variables from all values defined in a config map +You can use the following procedure to set an environment variable from all values defined in a config map. + +.Prerequisites + +* The {ServerlessOperatorName} and Knative Serving are installed on the cluster. +* You have installed the `kn` CLI. +* You have created a function. + +.Procedure + . Open the `func.yaml` file for your function. . For every config map for which you want to import all key-value pairs as environment variables, add the following YAML to the `envs` section: diff --git a/modules/serverless-functions-all-values-in-secret-to-env-variables.adoc b/modules/serverless-functions-all-values-in-secret-to-env-variables.adoc index a3222485b7..df650fad16 100644 --- a/modules/serverless-functions-all-values-in-secret-to-env-variables.adoc +++ b/modules/serverless-functions-all-values-in-secret-to-env-variables.adoc @@ -1,6 +1,21 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc + +:_content-type: PROCEDURE [id="serverless-functions-all-values-in-secret-to-env-variables_{context}"] = Setting environment variables from all values defined in a secret +You can use the following procedure to set an environment variable from all values defined in a secret. + +.Prerequisites + +* The {ServerlessOperatorName} and Knative Serving are installed on the cluster. +* You have installed the `kn` CLI. +* You have created a function. + +.Procedure + . Open the `func.yaml` file for your function. . For every secret for which you want to import all key-value pairs as environment variables, add the following YAML to the `envs` section: diff --git a/modules/serverless-functions-func-yaml-environment-variables.adoc b/modules/serverless-functions-func-yaml-environment-variables.adoc index 8f069654f6..fedf2ecb37 100644 --- a/modules/serverless-functions-func-yaml-environment-variables.adoc +++ b/modules/serverless-functions-func-yaml-environment-variables.adoc @@ -1,9 +1,15 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-yaml.adoc + :_content-type: PROCEDURE [id="serverless-functions-func-yaml-environment-variables_{context}"] = Referencing local environment variables from func.yaml fields In the `envs` field in the `func.yaml`, you can put a reference to an environment variable available in the local environment. This can be useful for avoiding storing sensitive information, such as an API key in the function configuration. +// no prereqs? + .Procedure * To refer to a local environment variable, use the following syntax: @@ -17,6 +23,7 @@ Substitute `ENV_VAR` with the name of the variable in the local environment that + For example, you might have the `API_KEY` variable available in the local environment. You can assign its value to the `MY_API_KEY` variable, which you can then directly use within your function: + +.Example function [source,yaml] ---- name: test @@ -26,4 +33,5 @@ runtime: go envs: - name: MY_API_KEY value: '{{ env:API_KEY }}' +... ---- diff --git a/modules/serverless-functions-func-yaml-fields.adoc b/modules/serverless-functions-func-yaml-fields.adoc index 1dc62a632c..1cebd2871c 100644 --- a/modules/serverless-functions-func-yaml-fields.adoc +++ b/modules/serverless-functions-func-yaml-fields.adoc @@ -1,16 +1,24 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-yaml.adoc + +:_content-type: REFERENCE [id="serverless-functions-func-yaml_{context}"] = Configurable fields in func.yaml Many of the fields in `func.yaml` are generated automatically when you create, build, and deploy your function. However, there are also fields that you modify manually to change things, such as the function name or the image name. +[id="serverless-functions-func-yaml-builder_{context}"] == builder The `builder` field specifies the Buildpack builder image to use when building the function. In most cases, this value should not be changed. When you do change it, use a value that is listed in the `builders` field. +[id="serverless-functions-func-yaml-builders_{context}"] == builders Some function runtimes can be built in multiple ways. For example, a Quarkus function can be built for the JVM or as a native binary. The `builders` field contains all of the builders available for a given runtime. +[id="serverless-functions-func-yaml-buildenvs_{context}"] == buildEnvs The `buildEnvs` field enables you to set environment variables to be available to the environment that builds your function. Unlike variables set using `envs`, a variable set using `buildEnv` is not available during function runtime. @@ -33,6 +41,7 @@ buildEnvs: value: '{{ env:LOCAL_ENV_VAR }}' ---- +[id="serverless-functions-func-yaml-envs_{context}"] == envs The `envs` field enables you to set environment variables to be available to your function at runtime. You can set an environment variable in several different ways: @@ -69,6 +78,7 @@ envs: <5> A set of environment variables imported from key-value pairs of a secret. <6> A set of environment variables imported from key-value pairs of a config map. +[id="serverless-functions-func-yaml-volumes_{context}"] == volumes The `volumes` field enables you to mount secrets and config maps as a volume accessible to the function at the specified path, as shown in the following example: @@ -88,6 +98,7 @@ volumes: <1> The `mysecret` secret is mounted as a volume residing at `/workspace/secret`. <2> The `myconfigmap` config map is mounted as a volume residing at `/workspace/configmap`. +[id="serverless-functions-func-yaml-options_{context}"] == options The `options` field enables you to modify Knative Service properties for the deployed function, such as autoscaling. If these options are not set, the default ones are used. @@ -134,14 +145,17 @@ options: concurrency: 100 ---- +[id="serverless-functions-func-yaml-image_{context}"] == image The `image` field sets the image name for your function after it has been built. You can modify this field. If you do, the next time you run `kn func build` or `kn func deploy`, the function image will be created with the new name. +[id="serverless-functions-func-yaml-imagedigest_{context}"] == imageDigest The `imageDigest` field contains the SHA256 hash of the image manifest when the function is deployed. Do not modify this value. +[id="serverless-functions-func-yaml-labels_{context}"] == labels The `labels` field enables you to set labels on a deployed function. @@ -164,14 +178,17 @@ labels: value: '{{ env:USER }}' ---- +[id="serverless-functions-func-yaml-name_{context}"] == name The `name` field defines the name of your function. This value is used as the name of your Knative service when it is deployed. You can change this field to rename the function on subsequent deployments. +[id="serverless-functions-func-yaml-namespace_{context}"] == namespace The `namespace` field specifies the namespace in which your function is deployed. +[id="serverless-functions-func-yaml-runtime_{context}"] == runtime The `runtime` field specifies the language runtime for your function, for example, `python`. diff --git a/modules/serverless-functions-key-value-in-configmap-to-env-variable.adoc b/modules/serverless-functions-key-value-in-configmap-to-env-variable.adoc index 9d005d5f79..f5b1cc5635 100644 --- a/modules/serverless-functions-key-value-in-configmap-to-env-variable.adoc +++ b/modules/serverless-functions-key-value-in-configmap-to-env-variable.adoc @@ -1,6 +1,21 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc + +:_content-type: PROCEDURE [id="serverless-functions-key-value-in-configmap-to-env-variable_{context}"] = Setting environment variable from a key value defined in a config map +You can use the following procedure to set an environment variable from a key value defined as a config map. + +.Prerequisites + +* The {ServerlessOperatorName} and Knative Serving are installed on the cluster. +* You have installed the `kn` CLI. +* You have created a function. + +.Procedure + . Open the `func.yaml` file for your function. . For each value from a config map key-value pair that you want to assign to an environment variable, add the following YAML to the `envs` section: diff --git a/modules/serverless-functions-key-value-in-secret-to-env-variable.adoc b/modules/serverless-functions-key-value-in-secret-to-env-variable.adoc index d970775f95..4c719c5ccc 100644 --- a/modules/serverless-functions-key-value-in-secret-to-env-variable.adoc +++ b/modules/serverless-functions-key-value-in-secret-to-env-variable.adoc @@ -1,6 +1,21 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc + +:_content-type: PROCEDURE [id="serverless-functions-key-value-in-secret-to-env-variable_{context}"] = Setting environment variable from a key value defined in a secret +You can use the following procedure to set an environment variable from a key value defined as a secret. + +.Prerequisites + +* The {ServerlessOperatorName} and Knative Serving are installed on the cluster. +* You have installed the `kn` CLI. +* You have created a function. + +.Procedure + . Open the `func.yaml` file for your function. . For each value from a secret key-value pair that you want to assign to an environment variable, add the following YAML to the `envs` section: diff --git a/modules/serverless-functions-mounting-configmap-as-volume.adoc b/modules/serverless-functions-mounting-configmap-as-volume.adoc index 109cc9bbbb..1644f1c32e 100644 --- a/modules/serverless-functions-mounting-configmap-as-volume.adoc +++ b/modules/serverless-functions-mounting-configmap-as-volume.adoc @@ -1,6 +1,21 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc + +:_content-type: PROCEDURE [id="serverless-functions-mounting-configmap-as-volume_{context}"] = Mounting a config map as a volume +You can use the following procedure to mount a config map as a volume. + +.Prerequisites + +* The {ServerlessOperatorName} and Knative Serving are installed on the cluster. +* You have installed the `kn` CLI. +* You have created a function. + +.Procedure + . Open the `func.yaml` file for your function. . For each config map you want to mount as a volume, add the following YAML to the `volumes` section: diff --git a/modules/serverless-functions-mounting-secret-as-volume.adoc b/modules/serverless-functions-mounting-secret-as-volume.adoc index 56834e92d8..6389918406 100644 --- a/modules/serverless-functions-mounting-secret-as-volume.adoc +++ b/modules/serverless-functions-mounting-secret-as-volume.adoc @@ -1,6 +1,21 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc + +:_content-type: PROCEDURE [id="serverless-functions-mounting-secret-as-volume_{context}"] = Mounting a secret as a volume +You can use the following procedure to mount a secret as a volume. + +.Prerequisites + +* The {ServerlessOperatorName} and Knative Serving are installed on the cluster. +* You have installed the `kn` CLI. +* You have created a function. + +.Procedure + . Open the `func.yaml` file for your function. . For each secret you want to mount as a volume, add the following YAML to the `volumes` section: diff --git a/modules/serverless-functions-secrets-configmaps-interactively-specialized.adoc b/modules/serverless-functions-secrets-configmaps-interactively-specialized.adoc index 497aa09ea0..7fbad7d70d 100644 --- a/modules/serverless-functions-secrets-configmaps-interactively-specialized.adoc +++ b/modules/serverless-functions-secrets-configmaps-interactively-specialized.adoc @@ -1,5 +1,10 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc + +:_content-type: REFERENCE [id="serverless-functions-secrets-configmaps-interactively-specialized_{context}"] -= Modifying function access to secrets and config maps interactively with specialized commands += Modifying function access to secrets and config maps interactively by using specialized commands Every time you run the `kn func config` utility, you need to navigate the entire dialogue to select the operation you need, as shown in the previous section. To save steps, you can directly execute a specific operation by running a more specific form of the `kn func config` command: diff --git a/modules/serverless-functions-secrets-configmaps-interactively.adoc b/modules/serverless-functions-secrets-configmaps-interactively.adoc index 7b27be2b78..cf2f08edb8 100644 --- a/modules/serverless-functions-secrets-configmaps-interactively.adoc +++ b/modules/serverless-functions-secrets-configmaps-interactively.adoc @@ -1,9 +1,19 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc + :_content-type: PROCEDURE [id="serverless-functions-secrets-configmaps-interactively_{context}"] = Modifying function access to secrets and config maps interactively You can manage the secrets and config maps accessed by your function by using the `kn func config` interactive utility. +.Prerequisites + +* The {ServerlessOperatorName} and Knative Serving are installed on the cluster. +* You have installed the `kn` CLI. +* You have created a function. + .Procedure . Run the following command in the function project directory: diff --git a/modules/serverless-gpu-resources-kn.adoc b/modules/serverless-gpu-resources-kn.adoc index 8fbf543ea7..5786278c1a 100644 --- a/modules/serverless-gpu-resources-kn.adoc +++ b/modules/serverless-gpu-resources-kn.adoc @@ -8,6 +8,13 @@ After GPU resources are enabled for your {product-title} cluster, you can specify GPU requirements for a Knative service using the `kn` CLI. +.Prerequisites + +* The {ServerlessOperatorName}, Knative Serving and Knative Eventing are installed on the cluster. +* You have installed the `kn` CLI. +* GPU resources are enabled for your {product-title} cluster. +* You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in {product-title}. + [NOTE] ==== Using NVIDIA GPU resources is not supported for IBM Z and IBM Power. diff --git a/modules/serverless-installing-cli-linux-ibm-power-rpm.adoc b/modules/serverless-installing-cli-linux-ibm-power-rpm.adoc index 8369663d10..08b28406e9 100644 --- a/modules/serverless-installing-cli-linux-ibm-power-rpm.adoc +++ b/modules/serverless-installing-cli-linux-ibm-power-rpm.adoc @@ -1,8 +1,14 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/installing-kn.adoc + :_content-type: PROCEDURE [id="installing-cli-linux-ibm-power-rpm_{context}"] = Installing the Knative CLI for Linux on IBM Power using an RPM -For {op-system-base-full}, you can install the Knative CLI (`kn`) as an RPM if you have an active {product-title} subscription on your Red Hat account. +For {op-system-base-full}, you can install the `kn` CLI as an RPM if you have an active {product-title} subscription on your Red Hat account. + +// no prereqs? .Procedure @@ -12,12 +18,14 @@ For {op-system-base-full}, you can install the Knative CLI (`kn`) as an RPM if y ---- # subscription-manager register ---- + . Refresh the RHSM: + [source,terminal] ---- # subscription-manager refresh ---- + . Attach the subscription to a system by specifying ID of the subscription pool, using the `--pool` option: + [source,terminal] @@ -26,12 +34,14 @@ For {op-system-base-full}, you can install the Knative CLI (`kn`) as an RPM if y ---- + <1> Pool ID for an active {product-title} subscription + . Enable the repository using Red Hat Subscription Manager: + [source,terminal] ---- # subscription-manager repos --enable="openshift-serverless-1-for-rhel-8-ppc64le-rpms" ---- + . Install the `openshift-serverless-clients` on the system: + [source,terminal] diff --git a/modules/serverless-installing-cli-linux-ibm-z-rpm.adoc b/modules/serverless-installing-cli-linux-ibm-z-rpm.adoc index b71f6a823b..7a9c5fe90f 100644 --- a/modules/serverless-installing-cli-linux-ibm-z-rpm.adoc +++ b/modules/serverless-installing-cli-linux-ibm-z-rpm.adoc @@ -1,8 +1,14 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/installing-kn.adoc + :_content-type: PROCEDURE [id="installing-cli-linux-ibm-z-rpm_{context}"] = Installing the Knative CLI for Linux on IBM Z and LinuxONE using an RPM -For {op-system-base-full}, you can install the Knative CLI (`kn`) as an RPM if you have an active {product-title} subscription on your Red Hat account. +For {op-system-base-full}, you can install the `kn` CLI as an RPM if you have an active {product-title} subscription on your Red Hat account. + +// no prereqs? .Procedure @@ -12,12 +18,14 @@ For {op-system-base-full}, you can install the Knative CLI (`kn`) as an RPM if y ---- # subscription-manager register ---- + . Refresh the RHSM: + [source,terminal] ---- # subscription-manager refresh ---- + . Attach the subscription to a system by specifying ID of the subscription pool, using the `--pool` option: + [source,terminal] @@ -26,12 +34,14 @@ For {op-system-base-full}, you can install the Knative CLI (`kn`) as an RPM if y ---- + <1> Pool ID for an active {product-title} subscription + . Enable the repository using Red Hat Subscription Manager: + [source,terminal] ---- # subscription-manager repos --enable="openshift-serverless-1-for-rhel-8-s390x-rpms" ---- + . Install the `openshift-serverless-clients` on the system: + [source,terminal] diff --git a/modules/serverless-installing-cli-linux-ibm-z-tarball.adoc b/modules/serverless-installing-cli-linux-ibm-z-tarball.adoc index 18fb242cf8..b968390d8e 100644 --- a/modules/serverless-installing-cli-linux-ibm-z-tarball.adoc +++ b/modules/serverless-installing-cli-linux-ibm-z-tarball.adoc @@ -1,19 +1,28 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/installing-kn.adoc + :_content-type: PROCEDURE [id="installing-cli-linux-ibm-z-tarball_{context}"] = Installing the Knative CLI for Linux on IBM Z and LinuxONE -For Linux distributions, you can download the Knative CLI (`kn`) directly as a `tar.gz` archive. +For Linux distributions, you can download the `kn` CLI directly as a `tar.gz` archive. + +// no prereqs? .Procedure . Download the link:https://mirror.openshift.com/pub/openshift-v4/clients/serverless/latest/kn-linux-s390x.tar.gz[`kn` CLI]. + . Unpack the archive: + [source,terminal] ---- $ tar -xf ---- + . Move the `kn` binary to a directory on your `PATH`. + . To check your `PATH`, run: + [source,terminal] diff --git a/modules/serverless-installing-cli-linux-rpm.adoc b/modules/serverless-installing-cli-linux-rpm.adoc index 88e55ce76c..1ee28a8627 100644 --- a/modules/serverless-installing-cli-linux-rpm.adoc +++ b/modules/serverless-installing-cli-linux-rpm.adoc @@ -1,10 +1,17 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/installing-kn.adoc + :_content-type: PROCEDURE [id="installing-cli-linux-rpm_{context}"] = Installing the Knative CLI for Linux using an RPM -For {op-system-base-full}, you can install the Knative CLI (`kn`) as an RPM if you have an active {product-title} subscription on your Red Hat account. +For {op-system-base-full}, you can install the `kn` CLI as an RPM if you have an active {product-title} subscription on your Red Hat account. + +// no prereqs? .Procedure +// better explanation of what each of these commands do? . Enter the command: + @@ -12,12 +19,14 @@ For {op-system-base-full}, you can install the Knative CLI (`kn`) as an RPM if y ---- # subscription-manager register ---- + . Enter the command: + [source,terminal] ---- # subscription-manager refresh ---- + . Enter the command: + [source,terminal] @@ -26,12 +35,14 @@ For {op-system-base-full}, you can install the Knative CLI (`kn`) as an RPM if y ---- + <1> Pool ID for an active {product-title} subscription + . Enter the command: + [source,terminal] ---- # subscription-manager repos --enable="openshift-serverless-1-for-rhel-8-x86_64-rpms" ---- + . Enter the command: + [source,terminal] diff --git a/modules/serverless-installing-cli-linux.adoc b/modules/serverless-installing-cli-linux.adoc index b8c7300167..becc409317 100644 --- a/modules/serverless-installing-cli-linux.adoc +++ b/modules/serverless-installing-cli-linux.adoc @@ -1,8 +1,14 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/installing-kn.adoc + :_content-type: PROCEDURE [id="installing-cli-linux_{context}"] = Installing the Knative CLI for Linux -For Linux distributions, you can download the Knative CLI (`kn`) directly as a `tar.gz` archive. +For Linux distributions, you can download the `kn` CLI directly as a `tar.gz` archive. + +// no prereqs? .Procedure @@ -14,7 +20,9 @@ For Linux distributions, you can download the Knative CLI (`kn`) directly as a ` ---- $ tar -xf ---- + . Move the `kn` binary to a directory on your `PATH`. + . To check your `PATH`, run: + [source,terminal] diff --git a/modules/serverless-installing-cli-macos.adoc b/modules/serverless-installing-cli-macos.adoc index f0981d9182..5f30bffddc 100644 --- a/modules/serverless-installing-cli-macos.adoc +++ b/modules/serverless-installing-cli-macos.adoc @@ -1,23 +1,26 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/installing-kn.adoc + :_content-type: PROCEDURE [id="installing-cli-macosx_{context}"] = Installing the Knative CLI for macOS -The Knative CLI (`kn`) for macOS is provided as a `tar.gz` archive. +The `kn` CLI for macOS is provided as a `tar.gz` archive. + +// no prereqs? .Procedure . Download the link:https://mirror.openshift.com/pub/openshift-v4/clients/serverless/latest/kn-macos-amd64.tar.gz[`kn` CLI]. + . Unpack and unzip the archive. + . Move the `kn` binary to a directory on your `PATH`. + . To check your `PATH`, open a terminal window and run: + [source,terminal] ---- $ echo $PATH ---- - -// For future release: -// Alternatively, Mac OS X users can install the CLI using link:http://brew.sh/[Homebrew] and run the command: -// ---- -// $ brew install TBD -// ---- diff --git a/modules/serverless-installing-cli-web-console.adoc b/modules/serverless-installing-cli-web-console.adoc index 1da789125d..dcf3fa4065 100644 --- a/modules/serverless-installing-cli-web-console.adoc +++ b/modules/serverless-installing-cli-web-console.adoc @@ -1,14 +1,22 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/installing-kn.adoc + :_content-type: PROCEDURE [id="installing-cli-web-console_{context}"] = Installing the Knative CLI using the {product-title} web console -Once the {ServerlessOperatorName} is installed, you will see a link to download the Knative CLI (`kn`) for Linux (x86_64, amd64, s390x, ppc64le), macOS, or Windows from the *Command Line Tools* page in the {product-title} web console. +You can use the following procedure to install the `kn` CLI by using the web console. -You can access the *Command Line Tools* page by clicking the image:../images/question-circle.png[title="Help"] icon in the top right corner of the web console and selecting *Command Line Tools* in the drop down menu. +.Prerequisites + +* You have logged in to the {product-title} web console. +* The {ServerlessOperatorName} is installed on your {product-title} cluster. After the {ServerlessOperatorName} is installed, you will see a link to download the Knative CLI (`kn`) for Linux (x86_64, amd64, s390x, ppc64le), macOS, or Windows from the *Command Line Tools* page in the {product-title} web console. .Procedure -. Download the `kn` CLI from the *Command Line Tools* page. +. Download the `kn` CLI from the *Command Line Tools* page. You can access the *Command Line Tools* page by clicking the image:../images/question-circle.png[title="Help"] icon in the top right corner of the web console and selecting *Command Line Tools* in the drop-down menu. + . Unpack the archive: + [source,terminal] diff --git a/modules/serverless-installing-cli-windows.adoc b/modules/serverless-installing-cli-windows.adoc index 8c2061db0f..7e49e184d7 100644 --- a/modules/serverless-installing-cli-windows.adoc +++ b/modules/serverless-installing-cli-windows.adoc @@ -1,14 +1,23 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/installing-kn.adoc + :_content-type: PROCEDURE [id="installing-cli-windows_{context}"] = Installing the Knative CLI for Windows -The Knative CLI (`kn`) for Windows is provided as a zip archive. +The `kn` CLI for Windows is provided as a zip archive. + +// no prereqs? .Procedure . Download the link:https://mirror.openshift.com/pub/openshift-v4/clients/serverless/latest/kn-windows-amd64.zip[`kn` CLI]. + . Extract the archive with a ZIP program. + . Move the `kn` binary to a directory on your `PATH`. + . To check your `PATH`, open the command prompt and run the command: + [source,terminal] diff --git a/modules/serverless-kafka-source-kn.adoc b/modules/serverless-kafka-source-kn.adoc index a6031abd48..3cda06095a 100644 --- a/modules/serverless-kafka-source-kn.adoc +++ b/modules/serverless-kafka-source-kn.adoc @@ -1,6 +1,7 @@ // Module included in the following assemblies: // // * serverless/develop/serverless-kafka-developer.adoc +// * serverless/reference/kn-eventing-ref.adoc :_content-type: PROCEDURE [id="serverless-kafka-source-kn_{context}"] diff --git a/modules/serverless-kn-cli-plugins.adoc b/modules/serverless-kn-cli-plugins.adoc index 641ca91f16..b24fc38ace 100644 --- a/modules/serverless-kn-cli-plugins.adoc +++ b/modules/serverless-kn-cli-plugins.adoc @@ -1,3 +1,8 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/advanced-kn-config.adoc + +:_content-type: CONCEPT [id="serverless-kn-plugins_{context}"] = Knative CLI plug-ins diff --git a/modules/serverless-kn-config.adoc b/modules/serverless-kn-config.adoc index e6dfe62441..ca5b0db944 100644 --- a/modules/serverless-kn-config.adoc +++ b/modules/serverless-kn-config.adoc @@ -1,3 +1,8 @@ +// Module included in the following assemblies: +// +// * serverless/cli_tools/advanced-kn-config.adoc + +:_content-type: CONCEPT [id="serverless-kn-config_{context}"] = Customizing the Knative CLI diff --git a/modules/serverless-kn-containersource.adoc b/modules/serverless-kn-containersource.adoc index 19203ef4af..f9b0593945 100644 --- a/modules/serverless-kn-containersource.adoc +++ b/modules/serverless-kn-containersource.adoc @@ -1,6 +1,7 @@ // Module included in the following assemblies: // -// * /serverless/develop/serverless-custom-event-sources.adoc +// * serverless/develop/serverless-custom-event-sources.adoc +// * serverless/reference/kn-eventing-ref.adoc :_content-type: REFERENCE [id="serverless-kn-containersource_{context}"] diff --git a/modules/serverless-list-source-types-kn.adoc b/modules/serverless-list-source-types-kn.adoc index 4ed98dc1ba..c101298c0f 100644 --- a/modules/serverless-list-source-types-kn.adoc +++ b/modules/serverless-list-source-types-kn.adoc @@ -1,7 +1,18 @@ +// Module included in the following assemblies: +// +// * serverless/develop/serverless-listing-event-sources.adoc + :_content-type: PROCEDURE [id="serverless-list-source-types-kn_{context}"] = Listing available event source types by using the Knative CLI +You can list event source types that can be created and used on your cluster by using the `kn source list-types` CLI command. + +.Prerequisites + +* The {ServerlessOperatorName} and Knative Eventing are installed on the cluster. +* You have installed the `kn` CLI. + .Procedure . List the available event source types in the terminal: diff --git a/modules/serverless-list-source-types-odc.adoc b/modules/serverless-list-source-types-odc.adoc index c82ffb5258..91c4c89fca 100644 --- a/modules/serverless-list-source-types-odc.adoc +++ b/modules/serverless-list-source-types-odc.adoc @@ -1,6 +1,6 @@ // Module included in the following assemblies: // -// * serverless/event_sources/serverless-listing-event-sources.adoc +// * serverless/develop/serverless-listing-event-sources.adoc :_content-type: PROCEDURE [id="serverless-list-source-types-odc_{context}"] @@ -8,12 +8,15 @@ You can use the web console to view available event source types. -[NOTE] -==== -Additional event source types can be added by cluster administrators by installing Operators on {product-title}. -==== +.Prerequisites + +* You have logged in to the {product-title} web console. +* The {ServerlessOperatorName} and Knative Eventing are installed on your {product-title} cluster. +* You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in {product-title}. .Procedure + . Access the *Developer* perspective. . Click *+Add*. . Click *Event source*. +. View the available event source types. diff --git a/modules/serverless-list-source.adoc b/modules/serverless-list-source.adoc index e3b60e5be0..5a4d1200df 100644 --- a/modules/serverless-list-source.adoc +++ b/modules/serverless-list-source.adoc @@ -1,13 +1,18 @@ +// Module included in the following assemblies: +// +// * serverless/develop/serverless-listing-event-sources.adoc + +:_content-type: REFERENCE [id="serverless-list-source_{context}"] = Listing available event sources by using the Knative CLI -* List the available event sources: -+ +You can list available event sources by using the `kn source list` command. + [source,terminal] ---- $ kn source list ---- -+ + .Example output [source,terminal] ---- @@ -17,17 +22,22 @@ b1 SinkBinding sinkbindings.sources.knative.dev ksvc:eshow3 Fa p1 PingSource pingsources.sources.knative.dev ksvc:eshow1 True ---- +[id="serverless-list-source-specific-type_{context}"] == Listing event sources of a specific type only You can list event sources of a specific type only, by using the `--type` flag. -* List the available ping sources: -+ +[source,terminal] +---- +$ kn source list --type +---- + +.Example command [source,terminal] ---- $ kn source list --type PingSource ---- -+ + .Example output [source,terminal] ---- diff --git a/modules/serverless-manage-domain-mapping-kn.adoc b/modules/serverless-manage-domain-mapping-kn.adoc index 6f79fca895..351f0f7e5c 100644 --- a/modules/serverless-manage-domain-mapping-kn.adoc +++ b/modules/serverless-manage-domain-mapping-kn.adoc @@ -1,3 +1,7 @@ +// Module included in the following assemblies: +// +// * serverless/reference/kn-serving-ref.adoc + :_content-type: PROCEDURE [id="serverless-manage-domain-mapping-kn_{context}"] = Managing custom domain mappings by using the Knative CLI @@ -9,6 +13,7 @@ After you have created a `DomainMapping` custom resource (CR), you can list exis * The {ServerlessOperatorName} and Knative Serving are installed on your cluster. * You have created at least one `DomainMapping` CR. * You have installed the `kn` CLI tool. +* You have created a project or have access to a project with the appropriate roles and permissions to create applications and other workloads in {product-title}. .Procedure diff --git a/modules/serverless-nodejs-context-object-reference.adoc b/modules/serverless-nodejs-context-object-reference.adoc index 897d680afd..c225d47d00 100644 --- a/modules/serverless-nodejs-context-object-reference.adoc +++ b/modules/serverless-nodejs-context-object-reference.adoc @@ -1,3 +1,8 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-reference-guide.adoc + +:_content-type: REFERENCE [id="serverless-nodejs-context-object-reference_{context}"] = Node.js context object reference diff --git a/modules/serverless-pingsource-kn.adoc b/modules/serverless-pingsource-kn.adoc index 306c600ed1..2ac3d4c162 100644 --- a/modules/serverless-pingsource-kn.adoc +++ b/modules/serverless-pingsource-kn.adoc @@ -1,6 +1,7 @@ // Module included in the following assemblies: // -// * /serverless/develop/serverless-pingsource.adoc +// * serverless/develop/serverless-pingsource.adoc +// * serverless/reference/kn-eventing-ref.adoc :_content-type: PROCEDURE [id="serverless-pingsource-kn_{context}"] diff --git a/modules/serverless-typescript-context-object-reference.adoc b/modules/serverless-typescript-context-object-reference.adoc index e63e31ca49..0dd615d051 100644 --- a/modules/serverless-typescript-context-object-reference.adoc +++ b/modules/serverless-typescript-context-object-reference.adoc @@ -1,3 +1,8 @@ +// Module included in the following assemblies: +// +// * serverless/functions/serverless-functions-reference-guide.adoc + +:_content-type: REFERENCE [id="serverless-typescript-context-object-reference_{context}"] = TypeScript context object reference @@ -17,10 +22,9 @@ export function handle(context: Context): string { context.log.info((context.body as Record).hello); } else { context.log.info('No data received'); - } + } return 'OK'; -} - +} ---- You can access the function by using the `kn func emit` command to invoke it: @@ -88,9 +92,9 @@ export function handle(context: Context): string { context.log.info((context.body as Record).hello); } else { context.log.info('No data received'); - } + } return 'OK'; -} +} ---- You can access the function by using the `kn func emit` command to invoke it: @@ -121,9 +125,9 @@ export function handle(context: Context): string { context.log.info((context.headers as Record)['custom-header']); } else { context.log.info('No data received'); - } + } return 'OK'; -} +} ---- You can access the function by using the `curl` command to invoke it: diff --git a/modules/specifying-sink-flag-kn.adoc b/modules/specifying-sink-flag-kn.adoc index fc3ad536ad..68c4924f20 100644 --- a/modules/specifying-sink-flag-kn.adoc +++ b/modules/specifying-sink-flag-kn.adoc @@ -1,9 +1,10 @@ // Module included in the following assemblies: // -// * /serverless/develop/serverless-event-sinks.adoc +// * serverless/develop/serverless-event-sinks.adoc // * serverless/develop/serverless-apiserversource.adoc -// * /serverless/develop/serverless-custom-event-sources.adoc +// * serverless/develop/serverless-custom-event-sources.adoc // * serverless/develop/serverless-kafka-developer.adoc +// * serverless/reference/kn-flags-reference.adoc :_content-type: REFERENCE [id="specifying-sink-flag-kn_{context}"] diff --git a/serverless/cli_tools/installing-kn.adoc b/serverless/cli_tools/installing-kn.adoc index 7bba4b929a..331b7ec3ff 100644 --- a/serverless/cli_tools/installing-kn.adoc +++ b/serverless/cli_tools/installing-kn.adoc @@ -33,6 +33,3 @@ include::modules/serverless-installing-cli-linux-ibm-z-rpm.adoc[leveloffset=+1] include::modules/serverless-installing-cli-linux-ibm-z-tarball.adoc[leveloffset=+1] include::modules/serverless-installing-cli-macos.adoc[leveloffset=+1] include::modules/serverless-installing-cli-windows.adoc[leveloffset=+1] -// Advanced kn config -include::modules/serverless-kn-config.adoc[leveloffset=+1] -include::modules/serverless-kn-cli-plugins.adoc[leveloffset=+1] diff --git a/serverless/reference/serverless-listing-event-sources.adoc b/serverless/develop/serverless-listing-event-sources.adoc similarity index 100% rename from serverless/reference/serverless-listing-event-sources.adoc rename to serverless/develop/serverless-listing-event-sources.adoc diff --git a/serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc b/serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc index 46523c93ab..f7191e11b8 100644 --- a/serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc +++ b/serverless/functions/serverless-functions-accessing-secrets-configmaps.adoc @@ -1,17 +1,17 @@ :_content-type: ASSEMBLY [id="serverless-functions-accessing-secrets-configmaps"] -= Accessing secrets and config maps from serverless functions += Accessing secrets and config maps from functions include::modules/common-attributes.adoc[] include::modules/serverless-document-attributes.adoc[] :context: serverless-functions-secrets toc::[] -Your functions, after deployed to the cluster, can access data stored in secrets and config maps. This data can be mounted as volumes, or assigned to environment variables. You can configure this access interactively by using the Knative CLI `kn func` commands or manually by editing the function configuration file. +After your functions have been deployed to the cluster, they can access data stored in secrets and config maps. This data can be mounted as volumes, or assigned to environment variables. You can configure this access interactively by using the Knative CLI, or by manually by editing the function configuration YAML file. [IMPORTANT] ==== -To access secrets and config maps, the function needs to be deployed on the cluster. This functionality is not available to a function running locally. +To access secrets and config maps, the function must be deployed on the cluster. This functionality is not available to a function running locally. If a secret or config map value cannot be accessed, the deployment fails with an error message specifying the inaccessible values. ==== diff --git a/serverless/functions/serverless-functions-annotations.adoc b/serverless/functions/serverless-functions-annotations.adoc index 87b69c7147..80df608612 100644 --- a/serverless/functions/serverless-functions-annotations.adoc +++ b/serverless/functions/serverless-functions-annotations.adoc @@ -9,12 +9,10 @@ toc::[] You can add Kubernetes annotations to a deployed Serverless function by adding them to the `annotations` section in the `func.yaml` configuration file. -[IMPORTANT] -==== There are two limitations of the function annotation feature: -* Once a function annotation propagates to the corresponding Knative service on the cluster, it cannot be removed from the service by deleting it from the `func.yaml` file. You can remove the annotation from the Knative service by modifying the YAML file of the service directly, or by using the Developer Console. +* After a function annotation propagates to the corresponding Knative service on the cluster, it cannot be removed from the service by deleting it from the `func.yaml` file. You must remove the annotation from the Knative service by modifying the YAML file of the service directly, or by using the {product-title} web console. + * You cannot set annotations that are set by Knative, for example, the `autoscaling` annotations. -==== include::modules/serverless-functions-adding-annotations.adoc[leveloffset=+1] diff --git a/serverless/functions/serverless-functions-yaml.adoc b/serverless/functions/serverless-functions-yaml.adoc index 76b75d3aaf..896e83c471 100644 --- a/serverless/functions/serverless-functions-yaml.adoc +++ b/serverless/functions/serverless-functions-yaml.adoc @@ -7,14 +7,7 @@ include::modules/serverless-document-attributes.adoc[] toc::[] -The `func.yaml` file contains the configuration for your function project. - -Generally, these values are used when you execute a `kn func` command. For example, when you run the `kn func build` command, the value in the `builder` field is used. - -[NOTE] -==== -In many cases, you can override these values with command line flags or environment variables. -==== +The `func.yaml` file contains the configuration for your function project. These values are used when you execute a `kn func` command. For example, when you run the `kn func build` command, the value in the `builder` field is used. In some cases, you can override these values with command line flags or environment variables. include::modules/serverless-functions-func-yaml-fields.adoc[leveloffset=+1] include::modules/serverless-functions-func-yaml-environment-variables.adoc[leveloffset=+1] diff --git a/serverless/reference/kn-flags-reference.adoc b/serverless/reference/kn-flags-reference.adoc index 0a4ad170c0..a683a7f12e 100644 --- a/serverless/reference/kn-flags-reference.adoc +++ b/serverless/reference/kn-flags-reference.adoc @@ -1,10 +1,12 @@ :_content-type: ASSEMBLY [id="kn-flags-reference"] -= kn flags reference += Knative CLI flags include::modules/common-attributes.adoc[] include::modules/serverless-document-attributes.adoc[] :context: kn-flags-reference toc::[] +This section provides information about additional, optional flags that you can use with `kn` commands. + include::modules/specifying-sink-flag-kn.adoc[leveloffset=+1] diff --git a/serverless/reference/kn-func-ref.adoc b/serverless/reference/kn-func-ref.adoc index 411c374ffe..59155476e2 100644 --- a/serverless/reference/kn-func-ref.adoc +++ b/serverless/reference/kn-func-ref.adoc @@ -1,6 +1,6 @@ :_content-type: ASSEMBLY [id="kn-func-ref"] -= kn func += Functions commands include::modules/common-attributes.adoc[] include::modules/serverless-document-attributes.adoc[] :context: kn-func-ref