This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.11.2. Using the Knative CLI to list event sources and event source types
You can use the kn
CLI to list and manage available event sources or event source types for use with Knative Eventing.
Currently, kn
supports management of the following event source types:
- API server source
-
Connects a sink to the Kubernetes API server by creating an
APIServerSource
object. - Ping source
-
Periodically sends ping events with a constant payload. A ping source can be used as a timer, and is created as a
PingSource
object.
You can list the available event source types in the terminal by using the following command:
kn source list-types
$ kn source list-types
The default output for this command will look like:
TYPE NAME DESCRIPTION ApiServerSource apiserversources.sources.knative.dev Watch and send Kubernetes API events to a sink PingSource pingsources.sources.knative.dev Periodically send ping events to a sink SinkBinding sinkbindings.sources.knative.dev Binding for connecting a PodSpecable to a sink
TYPE NAME DESCRIPTION
ApiServerSource apiserversources.sources.knative.dev Watch and send Kubernetes API events to a sink
PingSource pingsources.sources.knative.dev Periodically send ping events to a sink
SinkBinding sinkbindings.sources.knative.dev Binding for connecting a PodSpecable to a sink
It is also possible to list available event source types in YAML format:
kn source list-types -o yaml
$ kn source list-types -o yaml
You can list the available event sources in the terminal by entering the following command:
kn source list
$ kn source list
Example output
NAME TYPE RESOURCE SINK READY a1 ApiServerSource apiserversources.sources.knative.dev ksvc:eshow2 True b1 SinkBinding sinkbindings.sources.knative.dev ksvc:eshow3 False p1 PingSource pingsources.sources.knative.dev ksvc:eshow1 True
NAME TYPE RESOURCE SINK READY
a1 ApiServerSource apiserversources.sources.knative.dev ksvc:eshow2 True
b1 SinkBinding sinkbindings.sources.knative.dev ksvc:eshow3 False
p1 PingSource pingsources.sources.knative.dev ksvc:eshow1 True
You can list event sources of a specific type only, by using the --type
flag.
kn source list --type PingSource
$ kn source list --type PingSource
Example output
NAME TYPE RESOURCE SINK READY p1 PingSource pingsources.sources.knative.dev ksvc:eshow1 True
NAME TYPE RESOURCE SINK READY
p1 PingSource pingsources.sources.knative.dev ksvc:eshow1 True
11.2.3. Next steps 复制链接链接已复制到粘贴板!
- See the documentation on Using the API server source.
- See the documentation on Using a ping source.