Subscribe functions to CloudEventsΒΆ
PrerequisitesΒΆ
- Knative Eventing installed on the cluster
ProcedureΒΆ
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.
To subscribe the function to events for a given broker, run the following command:
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:
func subscribe --filter type=com.example --filter extension=my-extension-value
To subscribe the function to events for a given broker, run the following command:
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:
kn func subscribe --filter type=com.example --filter extension=my-extension-value
Deployment with TriggersΒΆ
When invoking func deploy
the CLI will create Knative Triggers for the function.
Deploy the function with Triggers by running the command inside the project directory:
func deploy
Deploy the function with Triggers by running the command inside the project directory:
kn func deploy
Expected output
π 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