Skip to content

Instantly share code, notes, and snippets.

@embano1
Last active April 16, 2021 20:08
Show Gist options
  • Select an option

  • Save embano1/3014b237b7b9c83c85e09c32539907db to your computer and use it in GitHub Desktop.

Select an option

Save embano1/3014b237b7b9c83c85e09c32539907db to your computer and use it in GitHub Desktop.
Knative Trigger to Sequence to Parallel
# Trigger which fires off to a sequence
apiVersion: eventing.knative.dev/v1
kind: Trigger
metadata:
name: alarmsequence-trigger
spec:
broker: default
subscriber:
ref:
apiVersion: flows.knative.dev/v1
kind: Sequence
name: alarminfo-enricher
namespace: default
---
# sequence which will send event to alarm server for pre-filtering
# and any enriched AlarmEvent returned will be sent to second step (parallel)
apiVersion: flows.knative.dev/v1
kind: Sequence
metadata:
name: alarminfo-enricher
spec:
channelTemplate:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
steps:
- ref:
apiVersion: v1
kind: Service
name: vsphere-alarm-server
- ref:
apiVersion: flows.knative.dev/v1
kind: Parallel
name: alarminfo-parallel
---
apiVersion: flows.knative.dev/v1
kind: Parallel
metadata:
name: alarminfo-parallel
spec:
channelTemplate:
apiVersion: messaging.knative.dev/v1
kind: InMemoryChannel
branches:
- subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: sockeye
- subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: kn-echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment