2.5. AWS Load Balancer Operator 구성


2.5.1. 클러스터 전체 프록시의 인증 기관 신뢰

AWS Load Balancer Operator에서 클러스터 전체 프록시를 구성할 수 있습니다. 클러스터 전체 프록시를 구성한 후 OLM(Operator Lifecycle Manager)은 HTTP_PROXY,HTTPS_PROXY, NO_PROXY 와 같은 환경 변수로 Operator의 모든 배포를 자동으로 업데이트합니다. 이러한 변수는 AWS Load Balancer Operator에 의해 관리되는 컨트롤러에 채워집니다.

  1. 다음 명령을 실행하여 aws-load-balancer-operator 네임스페이스에 CA(인증 기관) 번들을 포함할 구성 맵을 생성합니다.

    $ oc -n aws-load-balancer-operator create configmap trusted-ca
    Copy to Clipboard Toggle word wrap
  2. 신뢰할 수 있는 CA 번들을 구성 맵에 삽입하려면 다음 명령을 실행하여 config.openshift.io/inject-trusted-cabundle=true 레이블을 구성 맵에 추가합니다.

    $ oc -n aws-load-balancer-operator label cm trusted-ca config.openshift.io/inject-trusted-cabundle=true
    Copy to Clipboard Toggle word wrap
  3. 다음 명령을 실행하여 AWS Load Balancer Operator 서브스크립션을 업데이트하여 AWS Load Balancer Operator 배포의 구성 맵에 액세스합니다.

    $ oc -n aws-load-balancer-operator patch subscription aws-load-balancer-operator --type='merge' -p '{"spec":{"config":{"env":[{"name":"TRUSTED_CA_CONFIGMAP_NAME","value":"trusted-ca"}],"volumes":[{"name":"trusted-ca","configMap":{"name":"trusted-ca"}}],"volumeMounts":[{"name":"trusted-ca","mountPath":"/etc/pki/tls/certs/albo-tls-ca-bundle.crt","subPath":"ca-bundle.crt"}]}}}'
    Copy to Clipboard Toggle word wrap
  4. AWS Load Balancer Operator가 배포된 후 다음 명령을 실행하여 CA 번들이 aws-load-balancer-operator-controller-manager 배포에 추가되었는지 확인합니다.

    $ oc -n aws-load-balancer-operator exec deploy/aws-load-balancer-operator-controller-manager -c manager -- bash -c "ls -l /etc/pki/tls/certs/albo-tls-ca-bundle.crt; printenv TRUSTED_CA_CONFIGMAP_NAME"
    Copy to Clipboard Toggle word wrap

    출력 예

    -rw-r--r--. 1 root 1000690000 5875 Jan 11 12:25 /etc/pki/tls/certs/albo-tls-ca-bundle.crt
    trusted-ca
    Copy to Clipboard Toggle word wrap

  5. 선택 사항: 다음 명령을 실행하여 구성 맵이 변경될 때마다 AWS Load Balancer Operator 배포를 다시 시작합니다.

    $ oc -n aws-load-balancer-operator rollout restart deployment/aws-load-balancer-operator-controller-manager
    Copy to Clipboard Toggle word wrap

2.5.2. AWS Load Balancer에 TLS 종료 추가

도메인의 트래픽을 서비스의 Pod로 라우팅하고 AWS Load Balancer에서 TLS 종료를 추가할 수 있습니다.

사전 요구 사항

  • OpenShift CLI(oc)에 액세스할 수 있습니다.

프로세스

  1. AWSLoadBalancerController 리소스를 정의하는 YAML 파일을 생성합니다.

    add-tls-termination-albc.yaml 파일 예

    apiVersion: networking.olm.openshift.io/v1
    kind: AWSLoadBalancerController
    metadata:
      name: cluster
    spec:
      subnetTagging: Auto
      ingressClass: tls-termination 
    1
    Copy to Clipboard Toggle word wrap

    1
    수신 클래스 이름을 정의합니다. Ingress 클래스가 클러스터에 없으면 AWS Load Balancer 컨트롤러가 하나를 생성합니다. spec.controlleringress.k8s.aws/alb 로 설정된 경우 AWS Load Balancer 컨트롤러는 추가 ingress 클래스 값을 조정합니다.
  2. Ingress 리소스를 정의하는 YAML 파일을 생성합니다.

    add-tls-termination-ingress.yaml 파일의 예

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: <example> 
    1
    
      annotations:
        alb.ingress.kubernetes.io/scheme: internet-facing 
    2
    
        alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:xxxxx 
    3
    
    spec:
      ingressClassName: tls-termination 
    4
    
      rules:
      - host: example.com 
    5
    
        http:
            paths:
              - path: /
                pathType: Exact
                backend:
                  service:
                    name: <example_service> 
    6
    
                    port:
                      number: 80
    Copy to Clipboard Toggle word wrap

    1
    수신 이름을 지정합니다.
    2
    컨트롤러는 공용 서브넷에서 Ingress의 로드 밸런서를 프로비저닝하여 인터넷을 통해 로드 밸런서에 액세스합니다.
    3
    로드 밸런서에 연결하는 인증서의 ARM(Amazon Resource Name)입니다.
    4
    수신 클래스 이름을 정의합니다.
    5
    트래픽 라우팅의 도메인을 정의합니다.
    6
    트래픽 라우팅에 대한 서비스를 정의합니다.

2.5.3. 단일 AWS Load Balancer를 통해 여러 수신 리소스 생성

단일 AWS Load Balancer를 통해 단일 도메인에 속하는 여러 수신 리소스를 사용하여 트래픽을 다른 서비스로 라우팅할 수 있습니다. 각 Ingress 리소스는 도메인의 다른 끝점을 제공합니다.

사전 요구 사항

  • OpenShift CLI(oc)에 액세스할 수 있습니다.

프로세스

  1. 다음과 같이 IngressClassParams 리소스 YAML 파일을 생성합니다(예: sample-single-lb-params.yaml ).

    apiVersion: elbv2.k8s.aws/v1beta1 
    1
    
    kind: IngressClassParams
    metadata:
      name: single-lb-params 
    2
    
    spec:
      group:
        name: single-lb 
    3
    Copy to Clipboard Toggle word wrap
    1
    IngressClassParams 리소스의 API 그룹 및 버전을 정의합니다.
    2
    IngressClassParams 리소스 이름을 지정합니다.
    3
    IngressGroup 리소스 이름을 지정합니다. 이 클래스의 모든 Ingress 리소스는 이 IngressGroup 에 속합니다.
  2. 다음 명령을 실행하여 IngressClassParams 리소스를 생성합니다.

    $ oc create -f sample-single-lb-params.yaml
    Copy to Clipboard Toggle word wrap
  3. 다음과 같이 IngressClass 리소스 YAML 파일을 생성합니다(예: sample-single-lb-class.yaml ).

    apiVersion: networking.k8s.io/v1 
    1
    
    kind: IngressClass
    metadata:
      name: single-lb 
    2
    
    spec:
      controller: ingress.k8s.aws/alb 
    3
    
      parameters:
        apiGroup: elbv2.k8s.aws 
    4
    
        kind: IngressClassParams 
    5
    
        name: single-lb-params 
    6
    Copy to Clipboard Toggle word wrap
    1
    IngressClass 리소스의 API 그룹 및 버전을 정의합니다.
    2
    Ingress 클래스 이름을 지정합니다.
    3
    컨트롤러 이름을 정의합니다. ingress.k8s.aws/alb 값은 이 클래스의 모든 수신 리소스가 AWS Load Balancer 컨트롤러에서 관리해야 함을 나타냅니다.
    4
    IngressClassParams 리소스의 API 그룹을 정의합니다.
    5
    IngressClassParams 리소스의 리소스 유형을 정의합니다.
    6
    IngressClassParams 리소스 이름을 정의합니다.
  4. 다음 명령을 실행하여 IngressClass 리소스를 생성합니다.

    $ oc create -f sample-single-lb-class.yaml
    Copy to Clipboard Toggle word wrap
  5. 다음과 같이 AWSLoadBalancerController 리소스 YAML 파일을 생성합니다(예: sample-single-lb.yaml ).

    apiVersion: networking.olm.openshift.io/v1
    kind: AWSLoadBalancerController
    metadata:
      name: cluster
    spec:
      subnetTagging: Auto
      ingressClass: single-lb 
    1
    Copy to Clipboard Toggle word wrap
    1
    IngressClass 리소스의 이름을 정의합니다.
  6. 다음 명령을 실행하여 AWSLoadBalancerController 리소스를 생성합니다.

    $ oc create -f sample-single-lb.yaml
    Copy to Clipboard Toggle word wrap
  7. 다음과 같이 Ingress 리소스 YAML 파일(예: sample-multiple-ingress.yaml )을 생성합니다.

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: example-1 
    1
    
      annotations:
        alb.ingress.kubernetes.io/scheme: internet-facing 
    2
    
        alb.ingress.kubernetes.io/group.order: "1" 
    3
    
        alb.ingress.kubernetes.io/target-type: instance 
    4
    
    spec:
      ingressClassName: single-lb 
    5
    
      rules:
      - host: example.com 
    6
    
        http:
            paths:
            - path: /blog 
    7
    
              pathType: Prefix
              backend:
                service:
                  name: example-1 
    8
    
                  port:
                    number: 80 
    9
    
    ---
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: example-2
      annotations:
        alb.ingress.kubernetes.io/scheme: internet-facing
        alb.ingress.kubernetes.io/group.order: "2"
        alb.ingress.kubernetes.io/target-type: instance
    spec:
      ingressClassName: single-lb
      rules:
      - host: example.com
        http:
            paths:
            - path: /store
              pathType: Prefix
              backend:
                service:
                  name: example-2
                  port:
                    number: 80
    ---
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: example-3
      annotations:
        alb.ingress.kubernetes.io/scheme: internet-facing
        alb.ingress.kubernetes.io/group.order: "3"
        alb.ingress.kubernetes.io/target-type: instance
    spec:
      ingressClassName: single-lb
      rules:
      - host: example.com
        http:
            paths:
            - path: /
              pathType: Prefix
              backend:
                service:
                  name: example-3
                  port:
                    number: 80
    Copy to Clipboard Toggle word wrap
    1
    수신 이름을 지정합니다.
    2
    인터넷에 액세스하기 위해 공용 서브넷에서 프로비저닝할 로드 밸런서를 나타냅니다.
    3
    로드 밸런서에서 요청을 수신할 때 여러 수신 리소스의 규칙과 일치하는 순서를 지정합니다.
    4
    로드 밸런서가 OpenShift Container Platform 노드를 대상으로 서비스에 도달하도록 지정합니다.
    5
    이 수신에 속하는 Ingress 클래스를 지정합니다.
    6
    요청 라우팅에 사용되는 도메인 이름을 정의합니다.
    7
    서비스로 라우팅해야 하는 경로를 정의합니다.
    8
    Ingress 리소스에 구성된 엔드포인트를 제공하는 서비스 이름을 정의합니다.
    9
    엔드포인트를 제공하는 서비스의 포트를 정의합니다.
  8. 다음 명령을 실행하여 Ingress 리소스를 생성합니다.

    $ oc create -f sample-multiple-ingress.yaml
    Copy to Clipboard Toggle word wrap

2.5.4. AWS Load Balancer Operator 로그

oc logs 명령을 사용하여 AWS Load Balancer Operator 로그를 볼 수 있습니다.

프로세스

  • 다음 명령을 실행하여 AWS Load Balancer Operator의 로그를 확인합니다.

    $ oc logs -n aws-load-balancer-operator deployment/aws-load-balancer-operator-controller-manager -c manager
    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