6.4.6. Service Mesh에 대한 시크릿 필터링을 사용하여 메모리 사용량 개선

기본적으로 Kubernetes 클라이언트-go 라이브러리에 대한 정보자 구현에서는 특정 유형의 모든 리소스를 가져옵니다. 이로 인해 많은 리소스를 사용할 수 있을 때 상당한 오버헤드가 발생하여 메모리 누수로 인해 Knative net-istio Ingress 컨트롤러가 대규모 클러스터에서 실패할 수 있습니다. 그러나 컨트롤러가 Knative 관련 보안만 가져올 수 있도록 Knative net-istio 수신 컨트롤러에서 필터링 메커니즘을 사용할 수 있습니다. KnativeServing 사용자 정의 리소스(CR)에 주석을 추가하여 이 메커니즘을 활성화할 수 있습니다.

사전 요구 사항

  • 클러스터 관리자 액세스 권한이 있는 OpenShift Container Platform 계정에 액세스할 수 있습니다.
  • 프로젝트를 생성했거나 OpenShift Container Platform에서 애플리케이션 및 기타 워크로드를 생성하는 데 적절한 역할 및 권한이 있는 프로젝트에 액세스할 수 있습니다.
  • Red Hat OpenShift Service Mesh를 설치합니다. OpenShift Serverless with Service Mesh는 Red Hat OpenShift Service Mesh 버전 2.0.5 이상에서만 지원됩니다.
  • OpenShift Serverless Operator 및 Knative Serving을 설치합니다.
  • OpenShift CLI(oc)를 설치합니다.

프로세스

  • KnativeServing CR에 serverless.openshift.io/enable-secret-informer-filtering 주석을 추가합니다.

    KnativeServing CR의 예

    apiVersion: operator.knative.dev/v1alpha1
    kind: KnativeServing
    metadata:
      name: knative-serving
      namespace: knative-serving
      annotations:
        serverless.openshift.io/enable-secret-informer-filtering: "true" 1
    spec:
      ingress:
        istio:
          enabled: true
      deployments:
        - annotations:
            sidecar.istio.io/inject: "true"
            sidecar.istio.io/rewriteAppHTTPProbers: "true"
          name: activator
        - annotations:
            sidecar.istio.io/inject: "true"
            sidecar.istio.io/rewriteAppHTTPProbers: "true"
          name: autoscaler

    1
    이 주석을 추가하면 환경 변수 ENABLE_SECRET_INFORMER_FILTERING_BY_CERT_UID=true.