-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding initial doc for func subscribe (#5754)
* Adding initial doc for func subscribe Signed-off-by: Matthias Wessendorf <[email protected]> * correction Signed-off-by: Matthias Wessendorf <[email protected]> * Adding hint for deploy Signed-off-by: Matthias Wessendorf <[email protected]> * Adding index Signed-off-by: Matthias Wessendorf <[email protected]> * Updates Signed-off-by: Matthias Wessendorf <[email protected]> --------- Signed-off-by: Matthias Wessendorf <[email protected]>
- Loading branch information
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Subscribe functions to CloudEvents | ||
|
||
### Prerequisites | ||
|
||
- Knative Eventing installed on the cluster | ||
|
||
### Procedure | ||
|
||
--8<-- "proc-subscribe-function.md" | ||
|
||
### Deployment with Triggers | ||
|
||
When invoking `func deploy` the CLI will create Knative Triggers for the function. | ||
|
||
=== "func" | ||
|
||
Deploy the function with Triggers by running the command inside the project directory: | ||
|
||
```bash | ||
func deploy | ||
``` | ||
|
||
=== "kn func" | ||
|
||
Deploy the function with Triggers by running the command inside the project directory: | ||
|
||
```bash | ||
kn func deploy | ||
``` | ||
|
||
!!! Success "Expected output" | ||
```{ .bash .no-copy } | ||
🙌 Function image built: <registry>/hello:latest | ||
🎯 Creating Triggers on the cluster | ||
✅ Function deployed in namespace "default" and exposed at URL: | ||
http://hello.default.127.0.0.1.sslip.io | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!-- Snippet used in the following topics: | ||
- /docs/functions/subscribing-functions.md | ||
--> | ||
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 --filter type=com.example --filter extension=my-extension-value --source my-broker | ||
``` | ||
|
||
To subscribe the function to events for the default broker, run the following command: | ||
|
||
```bash | ||
func subscribe --filter type=com.example --filter extension=my-extension-value | ||
``` | ||
|
||
=== "kn func" | ||
|
||
To subscribe the function to events for a given broker, run the following command: | ||
|
||
```bash | ||
kn func subscribe --filter type=com.example --filter extension=my-extension-value --source my-broker | ||
``` | ||
|
||
To subscribe the function to events for the default broker, run the following command: | ||
|
||
```bash | ||
kn func subscribe --filter type=com.example --filter extension=my-extension-value | ||
``` |