From 3e1a23b55a285a8c94d2ec38a421f727b935e85f Mon Sep 17 00:00:00 2001 From: Matthias Wessendorf Date: Thu, 9 Nov 2023 12:22:18 +0100 Subject: [PATCH] Adding initial doc for func subscribe Signed-off-by: Matthias Wessendorf --- docs/functions/subscribing-functions.md | 9 +++++++++ docs/snippets/proc-subscribe-function.md | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 docs/functions/subscribing-functions.md create mode 100644 docs/snippets/proc-subscribe-function.md diff --git a/docs/functions/subscribing-functions.md b/docs/functions/subscribing-functions.md new file mode 100644 index 00000000000..8d8c61ead19 --- /dev/null +++ b/docs/functions/subscribing-functions.md @@ -0,0 +1,9 @@ +# Subscribe functions to CloudEvents + +### Prerequisites + +- Knative Eventing installed on the cluster + +### Procedure + +--8<-- "proc-subscribe-function.md" diff --git a/docs/snippets/proc-subscribe-function.md b/docs/snippets/proc-subscribe-function.md new file mode 100644 index 00000000000..327407fdaf8 --- /dev/null +++ b/docs/snippets/proc-subscribe-function.md @@ -0,0 +1,24 @@ + +The `subscribe` command will connect the function to a set of events, matching a series of filters for Cloud Event metadata +and a Knative Broker as the source of events, from where they are consumed. + +=== "func" + + To subscribe the function to events for a given broker, run the following command: + + ```bash + func subscribe subscribe --filter type=com.example --filter extension=my-extension-value --source my-broker + ``` + +=== "kn func" + + To subscribe the function to events for the default broker, run the following command: + + ```bash + func subscribe subscribe --filter type=com.example --filter extension=my-extension-value + ``` + +!!! note + When invoking `func deploy` the CLI will create Knative Triggers for the function.