13.6. PTP 또는 베어 메탈 이벤트에 대해 HTTP 전송을 사용하도록 소비자 애플리케이션 마이그레이션

이전에 PTP 또는 베어 메탈 이벤트 소비자 애플리케이션을 배포한 경우 HTTP 메시지 전송을 사용하도록 애플리케이션을 업데이트해야 합니다.

사전 요구 사항

  • OpenShift CLI(oc)가 설치되어 있습니다.
  • cluster-admin 권한이 있는 사용자로 로그인했습니다.
  • 기본적으로 HTTP 전송을 사용하는 PTP Operator 또는 Bare Metal Event Relay를 버전 4.13 이상으로 업데이트했습니다.

절차

  1. HTTP 전송을 사용하도록 이벤트 소비자 애플리케이션을 업데이트합니다. 클라우드 이벤트 사이드카 배포에 http-event-publishers 변수를 설정합니다.

    예를 들어 PTP 이벤트가 구성된 클러스터에서 다음 YAML 스니펫은 클라우드 이벤트 사이드카 배포를 보여줍니다.

    containers:
      - name: cloud-event-sidecar
        image: cloud-event-sidecar
        args:
          - "--metrics-addr=127.0.0.1:9091"
          - "--store-path=/store"
          - "--transport-host=consumer-events-subscription-service.cloud-events.svc.cluster.local:9043"
          - "--http-event-publishers=ptp-event-publisher-service-NODE_NAME.openshift-ptp.svc.cluster.local:9043" 1
          - "--api-port=8089"
    1
    PTP Operator는 NODE_NAME 을 PTP 이벤트를 생성하는 호스트로 자동으로 확인합니다. 예: compute-1.example.com.

    베어 메탈 이벤트가 구성된 클러스터에서는 클라우드 이벤트 사이드카 배포 CR에서 http-event-publishers 필드를 hw-event-publisher-service.openshift-bare-metal-events.svc.cluster.local:9043 으로 설정합니다.

  2. 이벤트 소비자 애플리케이션과 함께 consumer-events-subscription-service 서비스를 배포합니다. 예를 들면 다음과 같습니다.

    apiVersion: v1
    kind: Service
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        service.alpha.openshift.io/serving-cert-secret-name: sidecar-consumer-secret
      name: consumer-events-subscription-service
      namespace: cloud-events
      labels:
        app: consumer-service
    spec:
      ports:
        - name: sub-port
          port: 9043
      selector:
        app: consumer
      clusterIP: None
      sessionAffinity: None
      type: ClusterIP