18.5. 네트워크 로드 밸런서를 사용하여 AWS에서 수신 클러스터 트래픽 구성

OpenShift Container Platform에서는 클러스터에서 실행되는 서비스와 클러스터 외부에서 통신할 수 있습니다. 이 방법에서는 클라이언트의 IP 주소를 노드로 전달하는 NLB(Network Load Balancer)를 사용합니다. 신규 또는 기존 AWS 클러스터에서 NLB를 구성할 수 있습니다.

18.5.1. Ingress 컨트롤러 Classic 로드 밸런서를 네트워크 로드 밸런서로 교체

Classic Load Balancer(CLB)를 사용하는 Ingress 컨트롤러를 AWS의 NLB(Network Load Balancer)를 사용하는 컨트롤러로 교체할 수 있습니다.

주의

이 절차에서는 새 DNS 레코드 전파, 새 로드 밸런서 프로비저닝 및 기타 요인으로 인해 몇 분 정도 지속될 수 있는 예상 중단이 발생합니다. 이 절차를 적용한 후 Ingress 컨트롤러 로드 밸런서의 IP 주소 및 정식 이름이 변경될 수 있습니다.

프로세스

  1. 새 기본 Ingress 컨트롤러로 파일을 생성합니다. 다음 예제에서는 default Ingress 컨트롤러에 외부 범위가 있고 다른 사용자 지정이 없는 것으로 가정합니다.

    ingresscontroller.yml 파일 예

    apiVersion: operator.openshift.io/v1
    kind: IngressController
    metadata:
      creationTimestamp: null
      name: default
      namespace: openshift-ingress-operator
    spec:
      endpointPublishingStrategy:
        loadBalancer:
          scope: External
          providerParameters:
            type: AWS
            aws:
              type: NLB
        type: LoadBalancerService

    default Ingress 컨트롤러에 다른 사용자 지정이 있는 경우 그에 따라 파일을 수정해야 합니다.

  2. Ingress 컨트롤러 YAML 파일을 강제 교체합니다.

    $ oc replace --force --wait -f ingresscontroller.yml

    Ingress 컨트롤러가 교체될 때까지 기다립니다. 서버 운영 중단 시간 예상.

18.5.2. 기존 AWS 클러스터에서 Ingress 컨트롤러 네트워크 로드 밸런서 생성

기존 클러스터에서 AWS NLB(Network Load Balancer)가 지원하는 Ingress 컨트롤러를 생성할 수 있습니다.

사전 요구 사항

  • AWS 클러스터가 설치되어 있어야 합니다.
  • 인프라 리소스의 PlatformStatus는 AWS여야 합니다.

    • PlatformStatus가 AWS인지 확인하려면 다음을 실행하십시오.

      $ oc get infrastructure/cluster -o jsonpath='{.status.platformStatus.type}'
      AWS

프로세스

기존 클러스터에서 AWS NLB가 지원하는 Ingress 컨트롤러를 생성합니다.

  1. Ingress 컨트롤러 매니페스트를 생성합니다.

     $ cat ingresscontroller-aws-nlb.yaml

    출력 예

    apiVersion: operator.openshift.io/v1
    kind: IngressController
    metadata:
      name: $my_ingress_controller1
      namespace: openshift-ingress-operator
    spec:
      domain: $my_unique_ingress_domain2
      endpointPublishingStrategy:
        type: LoadBalancerService
        loadBalancer:
          scope: External3
          providerParameters:
            type: AWS
            aws:
              type: NLB

    1
    $my_ingress_controller를 Ingress 컨트롤러에 대해 고유한 이름으로 교체합니다.
    2
    $my_unique_ingress_domain을 클러스터의 모든 Ingress 컨트롤러 간에 고유한 도메인 이름으로 교체합니다.
    3
    내부 NLB를 사용하려면 ExternalInternal로 교체할 수 있습니다.
  2. 클러스터에서 리소스를 생성합니다.

    $ oc create -f ingresscontroller-aws-nlb.yaml
중요

새 AWS 클러스터에서 Ingress 컨트롤러 NLB를 구성하려면 먼저 설치 구성 파일 생성 절차를 완료해야 합니다.

18.5.3. 새 AWS 클러스터에서 Ingress 컨트롤러 네트워크 로드 밸런서 생성

새 클러스터에서 AWS NLB(Network Load Balancer)가 지원하는 Ingress 컨트롤러를 생성할 수 있습니다.

사전 요구 사항

  • install-config.yaml 파일을 생성하고 수정합니다.

절차

새 클러스터에서 AWS NLB가 지원하는 Ingress 컨트롤러를 생성합니다.

  1. 설치 프로그램이 포함된 디렉터리로 변경하고 매니페스트를 생성합니다.

    $ ./openshift-install create manifests --dir <installation_directory> 1
    1
    <installation_directory>는 클러스터의 install-config.yaml 파일이 포함된 디렉터리의 이름을 지정합니다.
  2. <installation_directory>/manifests/ 디렉터리에 cluster-ingress-default-ingresscontroller.yaml이라는 이름으로 파일을 만듭니다.

    $ touch <installation_directory>/manifests/cluster-ingress-default-ingresscontroller.yaml 1
    1
    <installation_directory>는 클러스터의 manifests / 디렉터리가 포함된 디렉터리 이름을 지정합니다.

    파일이 생성되면 다음과 같이 여러 네트워크 구성 파일이 manifests/ 디렉토리에 나타납니다.

    $ ls <installation_directory>/manifests/cluster-ingress-default-ingresscontroller.yaml

    출력 예

    cluster-ingress-default-ingresscontroller.yaml

  3. 편집기에서 cluster-ingress-default-ingresscontroller.yaml 파일을 열고 원하는 운영자 구성을 설명하는 CR(사용자 정의 리소스)을 입력합니다.

    apiVersion: operator.openshift.io/v1
    kind: IngressController
    metadata:
      creationTimestamp: null
      name: default
      namespace: openshift-ingress-operator
    spec:
      endpointPublishingStrategy:
        loadBalancer:
          scope: External
          providerParameters:
            type: AWS
            aws:
              type: NLB
        type: LoadBalancerService
  4. cluster-ingress-default-ingresscontroller.yaml 파일을 저장하고 텍스트 편집기를 종료합니다.
  5. 선택 사항: manifests/cluster-ingress-default-ingresscontroller.yaml 파일을 백업합니다. 설치 프로그램은 클러스터를 생성할 때 manifests/ 디렉터리를 삭제합니다.

18.5.4. 추가 리소스