6.5. 이벤트 시스템에 워크플로우 연결


OpenShift Serverless Logic Operator는 Knative Eventing, SinkBindings 및 트리거를 사용하여 이벤트 시스템과 워크플로우를 연결합니다. 이러한 오브젝트는 OpenShift Serverless Logic Operator에 의해 자동으로 생성되고 워크플로우 이벤트의 프로덕션 및 사용을 단순화합니다.

다음 예제에서는 플랫폼 범위 이벤트 시스템으로 구성된 example-workflow 워크플로우에 대해 생성된 Knative Eventing 오브젝트를 보여줍니다.

apiVersion: sonataflow.org/v1alpha08
kind: SonataFlowPlatform
metadata:
  name: sonataflow-platform-example
  namespace: example-namespace
spec:
  eventing:
    broker:
      ref:
        name: example-broker 1
        apiVersion: eventing.knative.dev/v1
        kind: Broker
  services:
    dataIndex: 2
      enabled: true
    jobService: 3
      enabled: true
  ...
1
example-broker 오브젝트는 Data Index, Jobs Service 및 example-workflow 워크플로에서 사용됩니다.
2
데이터 인덱스는 임시 구성으로 배포됩니다.
3
작업 서비스는 임시 구성으로 배포됩니다.

example-broker 오브젝트는 Kafka 클래스 Broker이며 해당 구성은 kafka-broker-config 구성 맵에 정의되어 있습니다.

다음 예제는 SonataFlowPlatform과 함께 사용할 Kafka Knative 브로커를 구성하는 방법을 보여줍니다.

apiVersion: eventing.knative.dev/v1
kind: Broker
metadata:
  annotations:
    eventing.knative.dev/broker.class: Kafka 1
  name: example-broker
  namespace: example-namespace
spec:
  config:
    apiVersion: v1
    kind: ConfigMap
    name: kafka-broker-config
    namespace: knative-eventing
1
Kafka 클래스는 example-broker 오브젝트를 생성하는 데 사용됩니다.

다음 예제에서는 example-workflow 가 이벤트 프로덕션 및 소비를 위해 example-brokerexample- broker에 자동으로 연결되는 방법을 표시합니다.

apiVersion: sonataflow.org/v1alpha08
kind: SonataFlow
metadata:
  name: example-workflow
  namespace: example-namespace
  annotations:
    sonataflow.org/description: Example Workflow
    sonataflow.org/version: 0.0.1
    sonataflow.org/profile: preview
spec:
  flow:
    start: ExampleStartState
    events:
      - name: outEvent1
        source: ''
        kind: produced
        type: out-event-type1 1
      - name: inEvent1
        source: ''
        kind: consumed
        type: in-event-type1 2
      - name: inEvent2
        source: ''
        kind: consumed
        type: in-event-type2 3
    states:
      - name: ExampleStartState
    ...
1
example-workflow 발신 이벤트는 example-workflow-sb 라는 SinkBinding 을 사용하여 생성됩니다.
2
유형 in-event-type1 의 이벤트는 example-workflow-inevent1-b40c067c-595b-4913-81a4-c8efa980bc11 트리거를 사용하여 사용됩니다.
3
유형 in-event-type2 의 이벤트는 example-workflow-inevent2-b40c067c-595b-4913-81a4-c8efa980bc11 트리거를 사용하여 사용됩니다.

다음 명령을 사용하여 example-workflow-sb 라는 자동으로 생성된 SinkBinding 을 나열할 수 있습니다.

$ oc get sinkbindings -n example-namespace

출력 예

NAME                   TYPE          RESOURCE                           SINK                    READY
example-workflow-sb    SinkBinding   sinkbindings.sources.knative.dev   broker:example-broker   True

다음 명령을 사용하여 이벤트 사용을 위해 자동으로 생성된 트리거를 나열할 수 있습니다.

$ oc get triggers -n <example-namespace>

출력 예

NAME                                                              BROKER           SINK                                                     AGE   CONDITIONS   READY   REASON
example-workflow-inevent1-b40c067c-595b-4913-81a4-c8efa980bc11    example-broker   service:example-workflow                                 16m   7 OK / 7     True
example-workflow-inevent2-b40c067c-595b-4913-81a4-c8efa980bc11    example-broker   service:example-workflow                                 16m   7 OK / 7     True

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.