21.5. ネットワークロードバランサーを使用した AWS での ingress クラスタートラフィックの設定

OpenShift Container Platform は、クラスター内で実行されるサービスを使用してクラスター外からの通信を可能にする方法を提供します。この方法では、クライアントの IP アドレスをノードに転送する Network Load Balancer (NLB) を使用します。NLB を新規または既存の AWS クラスターに設定することができます。

21.5.1. Ingress Controller Classic Load Balancer の Network Load Balancer への置き換え

Classic Load Balancer (CLB) を使用している Ingress Controller は、AWS の Network Load Balancer (NLB) を使用している Ingress Controller に置き換えることができます。

警告

この手順を実行すると、新しい DNS レコードの伝搬、新しいロードバランサーのプロビジョニングなどの要因により、数分間にわたる障害が発生することが予想されます。この手順を適用すると、Ingress Controller ロードバランサーの IP アドレスや正規名が変更になる場合があります。

手順

  1. 新しいデフォルトの Ingress Controller を含むファイルを作成します。以下の例では、デフォルトの Ingress Controller の範囲が External で、その他のカスタマイズをしていないことを想定しています。

    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

    デフォルトの Ingress Controller が他にカスタマイズされている場合には、それに応じてファイルを修正してください。

  2. Ingress Controller の YAML ファイルを強制的に置き換えます。

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

    Ingress Controller の置き換えが完了するまでお待ちください。数分ほど、サービスが停止します。

21.5.2. 既存 AWS クラスターでの Ingress コントローラーネットワークロードバランサーの設定

AWS Network Load Balancer (NLB) がサポートする Ingress Controller を既存のクラスターに作成できます。

前提条件

  • AWS クラスターがインストールされている。
  • インフラストラクチャーリソースの PlatformStatus は AWS である必要があります。

    • PlatformStatus が AWS であることを確認するには、以下を実行します。

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

手順

既存のクラスターの AWS NLB がサポートする Ingress Controller を作成します。

  1. Ingress Controller のマニフェストを作成します。

     $ 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 Controller の一意の名前に置き換えます。
    2
    $my_unique_ingress_domain を、クラスター内のすべての Ingress Controller 間で一意のドメイン名に置き換えます。この変数は、DNS 名 <clustername>.<domain> のサブドメインである必要があります。
    3
    External を内部 NLB を使用するために Internal に置き換えることができます。
  2. クラスターにリソースを作成します。

    $ oc create -f ingresscontroller-aws-nlb.yaml
重要

新規 AWS クラスターで Ingress Controller NLB を設定する前に、インストール設定ファイルの作成 手順を実行する必要があります。

21.5.3. 新規 AWS クラスターでの Ingress Controller ネットワークロードバランサーの設定

新規クラスターに AWS Network Load Balancer (NLB) がサポートする Ingress Controller を作成できます。

前提条件

  • install-config.yaml ファイルを作成し、これに対する変更を完了します。

手順

新規クラスターの AWS NLB がサポートする Ingress Controller を作成します。

  1. インストールプログラムが含まれるディレクトリーに切り替え、マニフェストを作成します。

    $ ./openshift-install create manifests --dir <installation_directory> 1
    1
    <installation_directory> については、クラスターの install-config.yaml ファイルが含まれるディレクトリーの名前を指定します。
  2. cluster-ingress-default-ingresscontroller.yaml という名前のファイルを <installation_directory>/manifests/ ディレクトリーに作成します。

    $ 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 ファイルを開き、必要な Operator 設定を記述するカスタムリソース (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/ ディレクトリーを削除します。

21.5.4. 関連情報