1.3. OpenShift Serverless와 Service Mesh 3.x 통합


OpenShift Serverless Operator는 Kourier를 Knative의 기본 수신으로 제공합니다. 그러나 Kourier가 활성화되어 있는지 여부에 관계없이 OpenShift Serverless에서 Service Mesh를 사용할 수 있습니다. Kourier disabled와 통합하면 mTLS 기능과 같이 Kourier 인그레스가 지원하지 않는 추가 네트워킹 및 라우팅 옵션을 구성할 수 있습니다.

다음과 같은 가정 및 제한 사항에 유의하십시오.

  • 모든 Knative 내부 구성 요소와 Knative 서비스는 서비스 메시의 일부이며 사이드카 삽입이 활성화되어 있습니다. 즉, 엄격한 상호 전송 계층 보안 (mTLS)이 전체 메시 내에서 적용됩니다. Knative 서비스에 대한 모든 요청에는 OpenShift 라우팅에서 들어오는 호출을 제외하고 클라이언트가 인증서를 보내야 하는 mTLS 연결이 필요합니다.
  • Service Mesh를 사용한 OpenShift Serverless 통합은 하나의 서비스 메시만 대상으로 할 수 있습니다. 클러스터에 여러 메시가 존재할 수 있지만 OpenShift Serverless는 해당 중 하나에서만 사용할 수 있습니다.

1.3.1. 사전 요구 사항

  • 클러스터 관리자 액세스 권한이 있는 Red Hat OpenShift Serverless 계정에 액세스할 수 있습니다.
  • OpenShift CLI(oc)가 설치되어 있습니다.
  • Serverless Operator를 설치했습니다.
  • Red Hat OpenShift Service Mesh 3.x Operator가 설치되어 있습니다.
  • 다음 절차의 예제에서는 도메인 example.com을 사용합니다. 이 도메인에 사용되는 예제 인증서는 하위 도메인 인증서에 서명하는 CA(인증 기관)로 사용됩니다.

    배포에서 이러한 절차를 완료하고 확인하려면 널리 신뢰할 수 있는 공용 CA에서 서명한 인증서 또는 조직에서 제공하는 CA가 필요합니다. 도메인, 하위 도메인, CA에 따라 예제 명령을 조정해야 합니다.

  • OpenShift Container Platform 클러스터의 도메인과 일치하도록 와일드카드 인증서를 구성해야 합니다. 예를 들어 OpenShift Container Platform 콘솔 주소가 https://console-openshift-console.apps.openshift.example.com인 경우 도메인이 *.apps.openshift.example.com이 되도록 와일드카드 인증서를 구성해야 합니다. 자세한 내용은 수신되는 외부 트래픽을 암호화하기 위한 인증서 생성 을 참조하십시오.
  • 기본 OpenShift Container Platform 클러스터 도메인의 하위 도메인이 아닌 도메인 이름을 사용하려면 해당 도메인의 도메인 매핑을 설정해야 합니다. 자세한 내용은 OpenShift Serverless 설명서를 참조하십시오.

1.3.2. 수신 외부 트래픽을 암호화하기 위한 인증서 생성

기본적으로 Service Mesh mTLS 기능은 사이드카가 있는 수신 게이트웨이와 개별 Pod 간에 Service Mesh 자체의 트래픽만 보호합니다. OpenShift Container Platform 클러스터로 전달될 때 트래픽을 암호화하려면 OpenShift Serverless 및 Service Mesh 통합을 활성화하기 전에 인증서를 생성해야 합니다.

사전 요구 사항

  • OpenShift Container Platform에 대한 클러스터 관리자 권한이 있거나 AWS 또는 OpenShift Dedicated의 Red Hat OpenShift Service에 대한 클러스터 또는 전용 관리자 권한이 있습니다.
  • OpenShift Serverless Operator 및 Knative Serving이 설치되어 있습니다.
  • OpenShift CLI(oc)가 설치되어 있습니다.
  • 설치 중에 OpenShift Serverless Operator가 자동으로 생성하는 knative-serving-ingress 네임스페이스에 액세스할 수 있습니다.
  • 프로젝트를 생성하거나 애플리케이션 및 기타 워크로드를 생성할 수 있는 적절한 역할 및 권한이 있는 프로젝트에 액세스할 수 있습니다.

프로세스

  1. Knative 서비스의 인증서에 서명할 root 인증서 및 개인 키를 생성합니다.

    $ openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 \
        -subj '/O=Example Inc./CN=example.com' \
        -keyout root.key \
        -out root.crt
    Copy to Clipboard Toggle word wrap
  2. 와일드카드 인증서를 만듭니다.

    $ openssl req -nodes -newkey rsa:2048 \
        -subj "/CN=*.apps.openshift.example.com/O=Example Inc." \
        -keyout wildcard.key \
        -out wildcard.csr
    Copy to Clipboard Toggle word wrap
  3. 와일드카드 인증서를 서명합니다.

    $ openssl x509 -req -days 365 -set_serial 0 \
        -CA root.crt \
        -CAkey root.key \
        -in wildcard.csr \
        -out wildcard.crt
    Copy to Clipboard Toggle word wrap
  4. Service Mesh 버전에 따라 다음 명령 중 하나를 입력하여 와일드카드 인증서가 포함된 보안을 생성합니다.

    • 옵션 A: Service Mesh 2.x의 경우 다음 명령을 입력하여 istio-system 네임스페이스에 보안을 생성합니다.

      $ oc create -n istio-system secret tls wildcard-certs \
          --key=wildcard.key \
          --cert=wildcard.crt
      Copy to Clipboard Toggle word wrap
    • 옵션 B: Service Mesh 3.x의 경우 다음 명령을 입력하여 knative-serving-ingress 네임스페이스에 보안을 생성합니다.

      $ oc create -n knative-serving-ingress secret tls wildcard-certs \
          --key=wildcard.key \
          --cert=wildcard.crt
      Copy to Clipboard Toggle word wrap

      시크릿에 사용되는 네임스페이스는 Service Mesh 버전에 따라 다릅니다. Service Mesh 2.x는 istio-system 네임스페이스에 인증서가 있어야 합니다. Service Mesh 3.x는 OpenShift Serverless 수신 게이트웨이가 실행되는 전용 knative-serving-ingress 네임스페이스를 사용합니다.

1.3.3. OpenShift Serverless와 Service Mesh 3.x 통합 구성 및 확인

Service Mesh 3.x를 OpenShift Serverless와 통합하여 서버리스 애플리케이션의 고급 트래픽 관리, 보안 및 관찰 기능을 활성화할 수 있습니다. 이 섹션에서는 사전 요구 사항을 확인하고, 구성 요소를 설치 및 구성하고, 통합이 예상대로 작동하는지 확인하는 단계를 제공합니다.

1.3.3.1. 설치 사전 요구 사항 확인

Serverless와 Service Mesh 통합을 설치하고 구성하기 전에 사전 요구 사항이 충족되었는지 확인합니다.

프로세스

  1. 충돌하는 게이트웨이를 확인합니다.

    명령 예

    $ oc get gateway -A -o jsonpath='{range .items[*]}{@.metadata.namespace}{"/"}{@.metadata.name}{" "}{@.spec.servers}{"\n"}{end}' | column -t
    Copy to Clipboard Toggle word wrap

    출력 예

    knative-serving/knative-ingress-gateway  [{"hosts":["*"],"port":{"name":"https","number":443,"protocol":"HTTPS"},"tls":{"credentialName":"wildcard-certs","mode":"SIMPLE"}}]
    knative-serving/knative-local-gateway    [{"hosts":["*"],"port":{"name":"http","number":8081,"protocol":"HTTP"}}]
    Copy to Clipboard Toggle word wrap

    이 명령은 다른 Service Mesh 인스턴스의 일부인 knative-servingGateway게이트웨이 를 제외하고 포트 443호스트: ["*"] 를 바인딩하는 게이트웨이 를 반환해서는 안 됩니다.

    참고

    Serverless에서 속하는 메시는 Serverless 워크로드에만 예약되어 있어야 합니다. 이는 게이트웨이와 같은 추가 구성이 Serverless 게이트웨이 knative-local-gatewayknative-ingress-gateway 를 방해할 수 있기 때문입니다. Red Hat OpenShift Service Mesh는 하나의 게이트웨이가 동일한 포트(포트:443)에서 와일드카드호스트 바인딩(호스트: ["*"])을 요청할 수 있도록 허용합니다. 다른 게이트웨이가 이미 이 구성을 바인딩하고 있는 경우 Serverless 워크로드에 대해 별도의 메시를 생성해야 합니다.

1.3.3.2. 서비스 메시 3.x 설치 및 구성

필요한 Istio 구성 요소, 게이트웨이 및 Knative Serving 리소스를 설치 및 구성하여 Service Mesh 3.x를 Serverless와 통합할 수 있습니다. 이러한 리소스가 구성되면 Istio를 사용하여 Knative Serving 인스턴스를 배포하여 서비스 메시 환경 내에서 서버리스 워크로드를 실행할 수 있습니다.

프로세스

  1. 다음 구성을 사용하여 istio-system 네임스페이스에 Istio 리소스를 생성합니다.

    apiVersion: sailoperator.io/v1
    kind: Istio
    metadata:
      name: default
    spec:
      values:
        meshConfig:
          defaultConfig:
            terminationDrainDuration: 35s
      updateStrategy:
        inactiveRevisionDeletionGracePeriodSeconds: 30
        type: InPlace
      namespace: istio-system
      version: v1.26-latest
    Copy to Clipboard Toggle word wrap
  2. 다음 명령을 실행하여 istio-system 이라는 프로젝트를 생성합니다.

    $ oc new-project istio-system
    Copy to Clipboard Toggle word wrap
  3. 다음 명령을 실행하여 Istio CR(사용자 정의 리소스)을 적용합니다.

    $ oc apply -f istio.yaml
    Copy to Clipboard Toggle word wrap
  4. 다음 구성을 사용하여 istio-cni 네임스페이스에 IstioCNI 리소스를 생성합니다.

    apiVersion: sailoperator.io/v1
    kind: IstioCNI
    metadata:
      name: default
    spec:
      namespace: istio-cni
      version: v1.26-latest
    Copy to Clipboard Toggle word wrap
  5. 다음 명령을 실행하여 istio-cni 라는 프로젝트를 생성합니다.

    $ oc new-project istio-cni
    Copy to Clipboard Toggle word wrap
  6. 다음 명령을 실행하여 IstioCNI CR을 적용합니다.

    $ oc apply -f istio-cni.yaml
    Copy to Clipboard Toggle word wrap
  7. 다음 구성을 사용하여 gateway-deploy.yaml 이라는 파일을 생성합니다.

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: knative-istio-ingressgateway
      namespace: knative-serving-ingress
    spec:
      selector:
        matchLabels:
          knative: ingressgateway
      template:
        metadata:
          annotations:
            inject.istio.io/templates: gateway
          labels:
            knative: ingressgateway
            sidecar.istio.io/inject: "true"
        spec:
          containers:
            - name: istio-proxy
              image: auto
    
    ---
    # Set up roles to allow reading credentials for TLS
    apiVersion: rbac.authorization.k8s.io/v1
    kind: Role
    metadata:
      name: istio-ingressgateway-sds
      namespace: knative-serving-ingress
    rules:
      - apiGroups: [""]
        resources: ["secrets"]
        verbs: ["get", "watch", "list"]
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: RoleBinding
    metadata:
      name: istio-ingressgateway-sds
      namespace: knative-serving-ingress
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: Role
      name: istio-ingressgateway-sds
    subjects:
      - kind: ServiceAccount
        name: default
    Copy to Clipboard Toggle word wrap
    • spec.template.metadata.annotations.inject.istio.io/templates 는 기본 사이드카 템플릿이 아닌 게이트웨이 삽입 템플릿을 지정합니다.
    • spec.template.metadata.labels.knative 는 게이트웨이의 고유한 레이블을 정의합니다. 이는 게이트웨이가 이 워크로드를 선택할 수 있도록 하는 데 필요합니다.
    • spec.template.metadata.labels.sidecar.istio.io/inject 를 사용하면 게이트웨이 삽입을 활성화합니다.
    • spec.template.spec.containers.image 는 Pod가 시작될 때마다 이미지가 자동으로 업데이트되도록 합니다.
  8. 다음 명령을 실행하여 리소스를 적용합니다.

    $ oc apply -f gateway-deploy.yaml
    Copy to Clipboard Toggle word wrap
  9. 다음 구성으로 serving-gateways.yaml 이라는 파일을 생성하여 Knative Serving 구성 요소에 대한 게이트웨이 리소스를 생성합니다.

    ###########################################################
    # cluster external
    ###########################################################
    apiVersion: v1
    kind: Service
    metadata:
      name: knative-istio-ingressgateway
      namespace: knative-serving-ingress
    spec:
      type: ClusterIP
      selector:
        knative: ingressgateway
      ports:
        - name: http2
          port: 80
          targetPort: 8080
        - name: https
          port: 443
          targetPort: 8443
    ---
    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
      name: knative-ingress-gateway
      namespace: knative-serving
    spec:
      selector:
        knative: ingressgateway
      servers:
        - hosts:
            - '*'
          port:
            name: https
            number: 443
            protocol: HTTPS
          tls:
            credentialName: wildcard-certs
            mode: SIMPLE
    ---
    ###########################################################
    # cluster local
    ###########################################################
    apiVersion: v1
    kind: Service
    metadata:
      labels:
        experimental.istio.io/disable-gateway-port-translation: "true"
      name: knative-local-gateway
      namespace: knative-serving-ingress
    spec:
      ports:
        - name: http2
          port: 80
          protocol: TCP
          targetPort: 8081
      selector:
        knative: ingressgateway
      type: ClusterIP
    ---
    apiVersion: networking.istio.io/v1beta1
    kind: Gateway
    metadata:
      name: knative-local-gateway
      namespace: knative-serving
    spec:
      selector:
        knative: ingressgateway
      servers:
        - hosts:
            - '*'
          port:
            name: http
            number: 8081
            protocol: HTTP
    Copy to Clipboard Toggle word wrap
  10. 다음 명령을 실행하여 리소스를 적용합니다.

    $ oc apply -f serving-gateways.yaml
    Copy to Clipboard Toggle word wrap
  11. istio-system 네임스페이스에 PeerAuthentication 리소스를 생성하여 다음 구성으로 메시에 mTLS를 적용합니다.

    apiVersion: security.istio.io/v1
    kind: PeerAuthentication
    metadata:
      name: mesh-mtls
      namespace: istio-system
    spec:
      mtls:
        mode: STRICT
    Copy to Clipboard Toggle word wrap
  12. 다음 명령을 실행하여 리소스를 적용합니다.

    $ oc apply -f peerauth.yaml
    Copy to Clipboard Toggle word wrap

1.3.3.3. Serverless 설치 및 구성

Service Mesh를 설치한 후 특정 구성으로 Serverless를 설치해야 합니다.

프로세스

  1. Istio 통합을 활성화하는 다음 KnativeServing 사용자 정의 리소스를 사용하여 Knative Serving을 설치합니다.

    knative-serving-config.yaml 구성 파일의 예

    apiVersion: operator.knative.dev/v1beta1
    kind: KnativeServing
    metadata:
      name: knative-serving
      namespace: knative-serving
      annotations:
        serverless.openshift.io/disable-istio-net-policies-generation: "true"
    spec:
      ingress:
        istio:
          enabled: true 
    1
    
      deployments: 
    2
    
      - name: activator
        labels:
          "sidecar.istio.io/inject": "true"
        annotations:
          "sidecar.istio.io/rewriteAppHTTPProbers": "true"
      - name: autoscaler
        labels:
          "sidecar.istio.io/inject": "true"
        annotations:
          "sidecar.istio.io/rewriteAppHTTPProbers": "true"
      config:
        istio: 
    3
    
          gateway.knative-serving.knative-ingress-gateway: istio-ingressgateway.<your-istio-namespace>.svc.cluster.local
          local-gateway.knative-serving.knative-local-gateway: knative-local-gateway.<your-istio-namespace>.svc.cluster.local
    Copy to Clipboard Toggle word wrap

    1
    Istio 통합을 활성화합니다.
    2
    Knative Serving 데이터 플레인 Pod에 사이드카 삽입을 활성화합니다.
    3
    istio-system 네임스페이스가 istio-system 네임스페이스에서 실행되지 않는 경우 이 두 플래그를 올바른 네임스페이스로 설정해야 합니다.
  2. KnativeServing 리소스를 적용합니다.

    $ oc apply -f knative-serving-config.yaml
    Copy to Clipboard Toggle word wrap
  3. Istio 통합을 활성화하는 다음 KnativeEventing 오브젝트를 사용하여 Knative Eventing을 설치합니다.

    knative-eventing-config.yaml 구성 파일의 예

    apiVersion: operator.knative.dev/v1beta1
    kind: KnativeEventing
    metadata:
      name: knative-eventing
      namespace: knative-eventing
      annotations:
        serverless.openshift.io/disable-istio-net-policies-generation: "true"
    spec:
      config:
        features:
          istio: enabled
      workloads:
        - name: pingsource-mt-adapter
          labels:
            sidecar.istio.io/inject: "true"
          annotations:
            sidecar.istio.io/rewriteAppHTTPProbers: "true"
    
        - name: imc-dispatcher
          labels:
            sidecar.istio.io/inject: "true"
          annotations:
            sidecar.istio.io/rewriteAppHTTPProbers: "true"
    
        - name: mt-broker-ingress
          labels:
            sidecar.istio.io/inject: "true"
          annotations:
            sidecar.istio.io/rewriteAppHTTPProbers: "true"
    
        - name: mt-broker-filter
          labels:
            sidecar.istio.io/inject: "true"
          annotations:
            sidecar.istio.io/rewriteAppHTTPProbers: "true"
    
        - name: job-sink
          labels:
            sidecar.istio.io/inject: "true"
          annotations:
            sidecar.istio.io/rewriteAppHTTPProbers: "true"
    Copy to Clipboard Toggle word wrap

    • spec.config.features.istio 를 사용하면 Eventing Istio 컨트롤러에서 각 InMemoryChannel 또는 KafkaChannel 서비스에 대한 DestinationRule 을 생성할 수 있습니다.
    • spec.workload 는 Knative Eventing Pod에 사이드카 삽입을 활성화합니다.
  4. KnativeEventing 리소스를 적용합니다.

    $ oc apply -f knative-eventing-config.yaml
    Copy to Clipboard Toggle word wrap
  5. Istio 통합을 활성화하는 다음 KnativeKafka 사용자 정의 리소스를 사용하여 Knative Kafka를 설치합니다.

    knative-kafka-config.yaml 구성 파일의 예

    apiVersion: operator.serverless.openshift.io/v1alpha1
    kind: KnativeKafka
    metadata:
      name: knative-kafka
      namespace: knative-eventing
    spec:
      channel:
        enabled: true
        bootstrapServers: <bootstrap_servers> 
    1
    
      source:
        enabled: true
      broker:
        enabled: true
        defaultConfig:
          bootstrapServers: <bootstrap_servers> 
    2
    
          numPartitions: <num_partitions>
          replicationFactor: <replication_factor>
        sink:
          enabled: true
      workloads: 
    3
    
      - name: kafka-controller
        labels:
          "sidecar.istio.io/inject": "true"
        annotations:
          "sidecar.istio.io/rewriteAppHTTPProbers": "true"
      - name: kafka-broker-receiver
        labels:
          "sidecar.istio.io/inject": "true"
        annotations:
          "sidecar.istio.io/rewriteAppHTTPProbers": "true"
      - name: kafka-broker-dispatcher
        labels:
          "sidecar.istio.io/inject": "true"
        annotations:
          "sidecar.istio.io/rewriteAppHTTPProbers": "true"
      - name: kafka-channel-receiver
        labels:
          "sidecar.istio.io/inject": "true"
        annotations:
          "sidecar.istio.io/rewriteAppHTTPProbers": "true"
      - name: kafka-channel-dispatcher
        labels:
          "sidecar.istio.io/inject": "true"
        annotations:
          "sidecar.istio.io/rewriteAppHTTPProbers": "true"
      - name: kafka-source-dispatcher
        labels:
          "sidecar.istio.io/inject": "true"
        annotations:
          "sidecar.istio.io/rewriteAppHTTPProbers": "true"
      - name: kafka-sink-receiver
        labels:
          "sidecar.istio.io/inject": "true"
        annotations:
          "sidecar.istio.io/rewriteAppHTTPProbers": "true"
    Copy to Clipboard Toggle word wrap

    1 2
    Apache Kafka 클러스터 URL(예: my-cluster-kafka-bootstrap.kafka:9092 ).
    3
    Knative Kafka Pod에 사이드카 삽입을 활성화합니다.
  6. KnativeEventing 오브젝트를 적용합니다.

    $ oc apply -f knative-kafka-config.yaml
    Copy to Clipboard Toggle word wrap
  7. ServiceEntry 를 설치하여 KnativeKafka 구성 요소와 Apache Kafka 클러스터 간의 통신에 대해 서비스 메시에 알립니다.

    kafka-cluster-serviceentry.yaml 구성 파일의 예

    apiVersion: networking.istio.io/v1alpha3
    kind: ServiceEntry
    metadata:
      name: kafka-cluster
      namespace: knative-eventing
    spec:
      hosts: 
    1
    
        - <bootstrap_servers_without_port>
      exportTo:
        - "."
      ports: 
    2
    
        - number: 9092
          name: tcp-plain
          protocol: TCP
        - number: 9093
          name: tcp-tls
          protocol: TCP
        - number: 9094
          name: tcp-sasl-tls
          protocol: TCP
        - number: 9095
          name: tcp-sasl-tls
          protocol: TCP
        - number: 9096
          name: tcp-tls
          protocol: TCP
      location: MESH_EXTERNAL
      resolution: NONE
    Copy to Clipboard Toggle word wrap

    1
    Apache Kafka 클러스터 호스트 목록(예: my-cluster-kafka-bootstrap.kafka ).
    2
    Apache Kafka 클러스터 리스너 포트.
    참고

    spec.ports 에서 나열된 포트는 예제 Cryostat 포트입니다. 실제 값은 Apache Kafka 클러스터 구성 방법에 따라 다릅니다.

  8. ServiceEntry 리소스를 적용합니다.

    $ oc apply -f kafka-cluster-serviceentry.yaml
    Copy to Clipboard Toggle word wrap

1.3.3.4. Service Mesh 3.x의 통합 설정 확인

Serverless를 사용하여 Service Mesh 3.x를 설치하고 구성한 후 통합이 올바르게 작동하는지 확인할 수 있습니다. 이 확인을 통해 Service Mesh 구성 요소, 게이트웨이 및 Knative Serving 구성이 올바르게 설정되고 서버리스 워크로드가 메시 내에서 안전하게 통신할 수 있습니다.

folloiwng 테스트는 간단한 Knative 서비스를 배포하고 사이드카 삽입, mTLS(mutual Transport Layer Security) 호환성, 수신 게이트웨이를 통해 통과를 확인합니다.

프로세스

  1. 다음 명령을 입력하여 Istio 구성 요소가 실행 중인지 확인합니다.

    $ oc get pods -n istio-system
    Copy to Clipboard Toggle word wrap
  2. 다음 명령을 입력하여 Istio CNI 구성 요소가 실행 중인지 확인합니다.

    $ oc get pods -n istio-cni
    Copy to Clipboard Toggle word wrap
  3. 다음 명령을 입력하여 Knative 구성 요소가 실행 중인지 확인합니다.

    $ oc get pods -n knative-serving
    Copy to Clipboard Toggle word wrap
  4. 다음 명령을 입력하여 게이트웨이 서비스가 있는지 확인합니다.

    $ oc get svc -n knative-serving-ingress
    Copy to Clipboard Toggle word wrap
  5. 다음 명령을 입력하여 테스트 네임스페이스를 생성합니다.

    $ oc new-project demo
    Copy to Clipboard Toggle word wrap
  6. 샘플 Knative 서비스 매니페스트를 생성하고 다음 구성을 사용하여 hello-service.yaml 로 저장합니다.

    apiVersion: serving.knative.dev/v1
    kind: Service
    metadata:
      annotations:
        serving.knative.openshift.io/enablePassthrough: "true"
      name: hello-service
      namespace: demo
    spec:
      template:
        metadata:
          labels:
            sidecar.istio.io/inject: "true"
          annotations:
            sidecar.istio.io/rewriteAppHTTPProbers: "true"
        spec:
          containers:
            - image: quay.io/openshift-knative/showcase
    Copy to Clipboard Toggle word wrap
    • serving.knative.openshift.io/enablePassthrough: "true" 는 Istio 게이트웨이를 통해 TLS 패스스루를 허용하도록 수신을 구성합니다.
    • sidecar.istio.io/inject: "true" 는 Istio 프록시가 삽입되었는지 확인합니다.
    • sidecar.istio.io/rewriteAppHTTPProbers: "true" 를 사용하면 Knative 상태 프로브가 mTLS와 함께 작동합니다.
  7. 다음 명령을 입력하여 Knative 서비스를 적용합니다.

    $ oc apply -f hello-service.yaml
    Copy to Clipboard Toggle word wrap
  8. 다음 명령을 입력하여 사이드카 삽입 및 Pod 준비 상태를 확인합니다.

    $ oc get pods -n demo
    Copy to Clipboard Toggle word wrap
    $ oc get pod -n demo -l serving.knative.dev/service=hello-service -o jsonpath='{.items[0].spec.containers[*].name}{"\n"}'
    Copy to Clipboard Toggle word wrap
  9. 다음 명령을 입력하여 서비스 URL을 검색합니다.

    $ oc get ksvc hello-service -n demo -o jsonpath='{.status.url}{"\n"}'
    Copy to Clipboard Toggle word wrap
  10. 다음 명령 중 하나를 입력하여 서비스를 호출합니다.

    • 옵션 A: Ingress 도메인에 신뢰할 수 있는 인증서가 설정된 경우 다음 명령을 입력합니다.

      $ curl https://$(oc get ksvc hello-service -n demo -o jsonpath='{.status.url}' | sed 's#https://##')
      Copy to Clipboard Toggle word wrap
    • 옵션 B: 사용자 정의 또는 자체 서명된 인증서를 사용하는 경우 다음 명령을 입력하여 -k를 사용하거나 CA 파일을 --cacert <path>에 제공합니다.

      $ curl  --cacert <path_to_your_CA_file> https://$(oc get ksvc hello-service -n demo -o jsonpath='{.status.url}' | sed 's#https://##')
      Copy to Clipboard Toggle word wrap

      다음 예와 유사한 출력이 표시되어야 합니다.

      {"artifact":"knative-showcase","greeting":"Welcome"}
      Copy to Clipboard Toggle word wrap

      정확한 JSON 값은 다를 수 있지만 응답은 knative-showcase 애플리케이션이 성공적으로 실행 중임을 나타냅니다.

1.3.4. 기본 네트워크 정책 비활성화

OpenShift Serverless Operator는 기본적으로 네트워크 정책을 생성합니다. 기본 네트워크 정책 생성을 비활성화하려면 KnativeEventingKnativeServing CR(사용자 정의 리소스)에 서버리스.openshift.io/disable-istio-net-policies-generation 주석을 추가할 수 있습니다.

중요

OpenShift Serverless Operator는 기본적으로 필요한 네트워크 정책을 생성합니다. 그러나 Service Mesh 3.x에 대한 지원은 현재 기술 프리뷰에 있으며 이러한 기본 네트워크 정책은 아직 Service Mesh 3.x의 네트워킹 요구 사항을 고려하지 않습니다. 결과적으로 이러한 정책을 적용할 때 새로 생성된 Knative 서비스(ksvc)가 Ready 상태에 도달하지 못할 수 있습니다.

이 문제를 방지하려면 KnativeServingKnativeEventing 사용자 정의 리소스에서 서버리스.openshift.io/disable-istio-net-policies-generation 주석을 true 로 설정하여 Istio 관련 네트워크 정책의 자동 생성을 비활성화해야 합니다.

사전 요구 사항

  • 클러스터에 액세스할 수 있는 다음 권한 중 하나가 있습니다.

    • OpenShift Container Platform에 대한 클러스터 관리자 권한
    • AWS의 Red Hat OpenShift Service에 대한 클러스터 관리자 권한
    • OpenShift Dedicated에 대한 전용 관리자 권한
  • OpenShift CLI(oc)가 설치되어 있습니다.
  • 애플리케이션 및 기타 워크로드를 생성할 수 있는 적절한 역할 및 권한이 있는 프로젝트에 액세스할 수 있습니다.
  • 클러스터에 OpenShift Serverless Operator, Knative Serving 및 Knative Eventing을 설치했습니다.
  • mTLS 기능이 활성화된 Red Hat OpenShift Service Mesh를 설치했습니다.

프로세스

  • 서버리스.openshift.io/disable-istio-net-policies-generation: "true" 주석을 Knative 사용자 정의 리소스에 추가합니다.

    참고

    OpenShift Serverless Operator는 기본적으로 필요한 네트워크 정책을 생성합니다. manageNetworkPolicy: false 를 사용하여 ServiceMeshControlPlane 을 구성할 때 적절한 이벤트 전달을 보장하기 위해 기본 네트워크 정책 생성을 비활성화해야 합니다. 기본 네트워크 정책 생성을 비활성화하려면 KnativeEventingKnativeServing CR(사용자 정의 리소스)에 서버리스.openshift.io/disable-istio-net-policies-generation 주석을 추가할 수 있습니다.

    1. 다음 명령을 실행하여 KnativeEventing CR에 주석을 답니다.

      $ oc edit KnativeEventing -n knative-eventing
      Copy to Clipboard Toggle word wrap

      KnativeEventing CR의 예

      apiVersion: operator.knative.dev/v1beta1
      kind: KnativeEventing
      metadata:
        name: knative-eventing
        namespace: knative-eventing
        annotations:
          serverless.openshift.io/disable-istio-net-policies-generation: "true"
      Copy to Clipboard Toggle word wrap

    2. 다음 명령을 실행하여 KnativeServing CR에 주석을 답니다.

      $ oc edit KnativeServing -n knative-serving
      Copy to Clipboard Toggle word wrap

      KnativeServing CR의 예

      apiVersion: operator.knative.dev/v1beta1
      kind: KnativeServing
      metadata:
        name: knative-serving
        namespace: knative-serving
        annotations:
          serverless.openshift.io/disable-istio-net-policies-generation: "true"
      Copy to Clipboard Toggle word wrap

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

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

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

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

Red Hat 소개

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

Theme

© 2025 Red Hat