IBM Cloud Docs
Red Hat OpenShift NSX Edge の構成

Red Hat OpenShift NSX Edge の構成

Red Hat® OpenShift® 4.7 環境のサポートに使用される NSX コンポーネントを確認します。 この情報を使用するには、これらのコンポーネントを作成して構成を追加する方法を理解する必要があります。 レビュー Tier-0 ゲートウェイを追加する。 PowerNSX コマンドを使用することを望むユーザーのために、その方式が用意されています。

Red Hat OpenShift 4.7 networking
OpenShift 4.7 networking

NSX ESG

Red Hat OpenShift を使用する IBM Cloud® for VMware Solutions 内に構成される最初のコンポーネントは、NSX Edge アプライアンスのペアです。 NSX Edge アプライアンスは、X-Large NSX Edge デバイスのアクティブまたはパッシブのペアとして構成されます。

構成プロセスの一環として、Red Hat OpenShift クラスター用に注文された IBM Cloud のパブリック・サブネットとプライベート・サブネットに NSX Edge が接続されます。

NSX Edgeの展開
コンポーネント 構成
CPU 6 vCPU
RAM 8 GB
ディスク スワップ 4 GB を搭載した共有ストレージ上の 4.5 GB VMDK

NSX Edge は、内部デプロイメントまたは専用デプロイメントのいずれかでアクティブまたはパッシブとして構成されます。 そのため、NSX Edge がそれぞれのピア・アプライアンスと同じホストで実行されないように、ユーザーが vSphere Distributed Resource Scheduler (DRS) アンチアフィニティー・ルールを作成する必要があります。

NSX Edgeのアンチ・アフィニティ・ルール
フィールド
名前 OpenShift-ESG
タイプ 仮想マシンの分割
メンバー OpenShift-ESG-0
OpenShift-ESG-1

NSX ESG のインターフェース

Edge は、IBM Cloud パブリック・ネットワークへのインターフェース・アップリンクと、IBM Cloud プライベート・ネットワークへのインターフェース・アップリンクの両方が設定されてデプロイされます。 さらに、分散論理ルーター (DLR) への Transit ネットワーク接続用のインターフェースも利用できます。

NSX Edgeの設定 - インターフェース
インターフェース名 インターフェース・タイプ IP アドレス ポートグループまたは論理スイッチ
プライベート・アップリンク アップリンク 10.208.242.130/26
10.208.242.131/26
SDDC-DPortGroup-Mgmt
パブリック・アップリンク アップリンク 169.48.73.42/29
169.48.73.43/29
SDDC-DPortGroup-External
伝送 内部 192.168.100.1/24 OpenShift-Transit

NSX ESG ファイアウォール

インターネット、IBM Cloud ネットワーク、および VXLAN ネットワークへの通信を許可するルールを構成します。

NSX Edgeの設定 - NSXファイアウォール
ファイアウォール・ルール ソース 接続先 サービス アクション
プライベート・アウトバウンド 10.208.242.128/26 任意 任意 Accept
パブリック・アウトバウンド 169.48.73.40/29 任意 任意 Accept
OpenShift ネットワーク 192.168.133.0/24 任意 任意 Accept
Transit ネットワーク 192.168.100.0/24 任意 任意 Accept

NSX ESG DHCP

Red Hat OpenShift 4.7 環境の場合、ブートストラップ・ノード、コントロール・プレーン・ノード、およびコンピュート・ノードは、ネットワーク上の初期アドレスを取得するために DHCP サーバーにアクセスする必要があります。 このネットワークは、ブートストラップ ignition ファイルをダウンロードするためのアクセス経路となります。 初期セットアップの後、Terraform を使用してノードに静的 IP アドレスが構成されます。

NSX Edgeの設定 - DHCPプール
DCHP プール
開始 IP 192.168.133.50
終了 IP 192.168.133.100
ドメイン名 ocp.dallas.ibm.local
DNS の自動構成 いいえ
1 次ネーム・サーバー 10.187.214.66
2 次ネーム・サーバー
デフォルト・ゲートウェイ 192.168.133.1
サブネット・マスク 255.255.255.0
リース Off
リース時間 86400

NSX ESG NAT

パブリック・ネットワークおよびプライベート・ネットワークへの Red Hat OpenShift ネットワーク・アクセスを許可するメカニズムを提供する NAT を定義します。

NSX Edgeの設定 - NATの定義
プロパティー (Property) NSX NAT ルール 1 NSX NAT ルール 2 NSX NAT ルール 3
説明 OpenShift ネットワーク・パブリック・アウトバウンド OpenShift ネットワーク・プライベート・アウトバウンド 要塞ノードへの SSH
NAT タイプ SNAT SNAT DNAT
インターフェース パブリック プライベート プライベート
プロトコル 任意 任意 任意
元のソース IP/範囲 192.168.133.0/24 192.168.133.0/24 10.208.242.133
宛先 IP/範囲 任意 任意 192.168.133.8
変換済みソース IP/範囲 169.48.73.43 10.208.242.140 10.208.242.133
ステータス 有効 有効 有効
ロギング 無効化 無効 無効

NSX ESG ルート

Edge で、パブリック・インターネットに向かうようにデフォルト・ルートを構成してから、IBM Cloud Private ネットワークにアクセスするための静的ルートを追加します。

グローバル構成

NSX Edgeの設定 - デフォルトゲートウェイ
グローバル構成 vNIC ゲートウェイ IP
デフォルト・ゲートウェイ パブリック 169.48.73.41

静的ルート

NSX Edgeの設定 - スタティックルート
プロパティー (Property) ネットワーク ネクスト・ホップ インターフェース
静的ルート 1 10.0.0.0/8 10.208.242.129 プライベート
静的ルート 2 100.0.0.0/8 10.208.242.129 プライベート
静的ルート 3 161.26.0.0/16 10.208.242.129 プライベート
静的ルート 4 192.168.133.0/24 192.168.100.2 プライベート

NSX ロード・バランサー

Red Hat OpenShift 環境内では、2 つのロード・バランサーが必要です。1 つはコントロール・プレーン・ノードへのアクセス用、もう 1 つはコンピュート・ノードへのアクセス用です。 NSX Edge はロード・バランシングを使用できるようになり、また、ソースからのインバウンド接続に証明書を使用するアプリケーション・プロファイルで構成されます。 また、NSX Edge には、Red Hat OpenShift コントロール・プレーン・ノードおよび Red Hat OpenShift コンピュート・ノードをポイントするロード・バランシング・プールも構成されています。 さらに、プールと仮想 IP アドレス (VIP) を関連付けるルールとともに、プライベート・インターフェース上の VIP を使用して仮想サーバーが作成されます。

アプリケーション・プロファイル

NSX Edgeの構成 - アプリケーションプロファイル
名前 タイプ 永続性
TCP-Source-Profile TCP 送信元 IP

プール

NSX Edge の構成 - プール
フィールド API プール 6443 API プール 22623 アプリ・プール 80 アプリ・プール 443
名前 api-pool-6443 api-pool-22623 app-pool-80 app-pool-443
アルゴリズム ROUND-ROBIN ROUND-ROBIN ROUND-ROBIN ROUND-ROBIN
Monitor default_tcp_monitor default_tcp_monitor default_tcp_monitor default_tcp_monitor
メンバー control-plane-0
control-plane-1
control-plane-2
bootstrap-0
control-plane-0
control-plane-1
control-plane-2
bootstrap-0
compute-0
compute-1
compute-2
compute-0
compute-1
compute-2

仮想サーバー

NSX Edge の VIP 構成 - 仮想サーバー
フィールド LB 6443 LB 22623 LB 80 LB 443
名前 api-6443-lb api-22623-lb apps-80-lb apps-443-lb
説明 API/API-INT API/API-INT アプリケーション HTTP アプリケーション HTTPS
デフォルト・プール pool-1 pool-2 pool-3 pool-4
IP アドレス 10.208.242.132 10.208.242.132 10.208.242.131 10.208.242.131
プロトコル TCP TCP TCP TCP
ポート 6443 22623 80 443

PowerNSX コマンド

NSX ESG のプロビジョニングと構成を自動化するために使用できる PowerNSX コマンドの以下の例を確認してください。

以下の表を使用して、デプロイメントに必要なパラメーターを記録してください。 前述のデプロイメントに対応する例を示しています。

PowerNSX DLR のパラメーター
パラメーター デプロイメント
vCenter Server IP アドレス
vCenter Server のユーザー
vCenter Server のパスワード
AD DNS サーバーの IP アドレス 10.187.214.66
トランジット論理スイッチ OpenShift-Transit
OpenShift ネットワーク 192.168.133.0/24
Transit ネットワーク 192.168.100.0/24
ESG 伝送 192.168.100.1
DLR 伝送 192.168.100.2
ESG 名 OpenShift-ESG
vCenter Server インスタンス・クラスター cluster1
vCenter Server インスタンス・データ・ストア vsanDatastore
プライベート・ポータブル・サブネット 10.208.242.128/26
BCR IP アドレス 10.208.242.129
ESG プライベート 1 次 10.208.242.130
ESG プライベート 2 次 1 10.208.242.131
ESG プライベート 2 次 2 10.208.242.132
ESG プライベート 2 次 3 10.208.242.133
パブリック・ポータブル・サブネット 169.48.73.40/29
FCR IP アドレス 169.48.73.41
ESG パブリック 1 次 169.48.73.42
ESG パブリック 2 次 1 169.48.73.43
ESG パブリック 2 次 2 169.48.73.44
ESG ユーザー名 admin
ESG パスワード VMware12345!
# Connect to NSX Manager
Connect-NsxServer -vCenterServer <IP_Address> -User <UserName> -Password '<Password>'

# Create Edge interface specification and create Edge
$priUplink = New-NsxEdgeInterfaceSpec -index 0 -Name "Private Uplink" -Type Uplink -ConnectedTo (Get-VDPortgroup SDDC-DPortGroup-Mgmt) -PrimaryAddress 10.208.242.130 -SubnetPrefixLength 26 -SecondaryAddresses 10.208.242.131,10.208.242.132,10.208.242.133
$pubUplink = New-NsxEdgeInterfaceSpec -index 1 -Name "Public Uplink" -Type Uplink -ConnectedTo (Get-VDPortgroup SDDC-DPortGroup-External) -PrimaryAddress 169.48.73.42 -SubnetPrefixLength 29 -SecondaryAddresses 169.48.73.43,169.48.73.44
$transit = New-NsxEdgeInterfaceSpec -index 2 -Name "Transit" -Type internal -ConnectedTo (Get-NsxLogicalSwitch OpenShift-Transit) -PrimaryAddress 192.168.100.1 -SubnetPrefixLength 24
New-NsxEdge -Name OpenShift-ESG -Cluster (Get-Cluster cluster1) -EnableHA -Datastore (Get-Datastore vsanDatastore) -Username admin -Password VMware12345! -FormFactor xlarge -Interface $priUplink,$pubUplink,$transit

# Set default gateway and add static routes to the ESG
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeRouting | Set-NsxEdgeRouting -DefaultGatewayAddress 169.48.73.41 -DefaultGatewayVnic 1 -DefaultGatewayDescription "Public traffic"-confirm:$false
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeRouting | New-NsxEdgeStaticRoute -Network 10.0.0.0/8 -NextHop 10.208.242.129 -Vnic 0 -Description "Private traffic" -confirm:$false
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeRouting | New-NsxEdgeStaticRoute -Network 100.0.0.0/8 -NextHop 10.208.242.129 -Vnic 0 -Description "Private traffic" -confirm:$false
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeRouting | New-NsxEdgeStaticRoute -Network 161.26.0.0/16 -NextHop 10.208.242.129 -Vnic 0 -Description "Private traffic" -confirm:$false
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeRouting | New-NsxEdgeStaticRoute -Network 192.168.133.0/24 -NextHop 192.168.100.2 -Vnic 2 -Description "OpenShift Traffic" -confirm:$false

# Configure ESG firewall rules
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeFirewall | New-NsxEdgeFirewallRule -Name "Private Outbound" -Source 10.208.242.128/26 -Service any -Action accept
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeFirewall | New-NsxEdgeFirewallRule -Name "Public Outbound" -Source 169.48.73.40/29 -Service any -Action accept
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeFirewall | New-NsxEdgeFirewallRule -Name "OpenShift Network" -Source 192.168.133.0/24 -Service any -Action accept
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeFirewall | New-NsxEdgeFirewallRule -Name "Transit Network" -Source 192.168.100.0/24 -Service any -Action accept
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeFirewall | New-NsxEdgeFirewallRule -Name "Private inbound to OpenShift" -Source 10.0.0.0/8 -Destination 10.208.242.131 -Service tcp/80,tcp/443 -Action accept
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeFirewall | New-NsxEdgeFirewallRule -Name "SSH inbound to Bastion" -Source 10.0.0.0/8 -Destination 10.208.242.133 -Service tcp/22 -Action accept

# Configure ESG NAT rules
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeNat | Set-NsxEdgeNat -enabled -confirm:$false
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeNat | New-NsxEdgeNatRule -Vnic 1 -OriginalAddress 192.168.133.0/24 -TranslatedAddress 169.48.73.43 -Action snat -Protocol any -OriginalPort any -TranslatedPort any -Enabled -Description "OpenShift Network Public Outbound"
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeNat | New-NsxEdgeNatRule -Vnic 0 -OriginalAddress 192.168.133.0/24 -TranslatedAddress 10.208.242.131 -Action snat -Protocol any -OriginalPort any -TranslatedPort any -Enabled -Description "OpenShift Network Private Outbound"
Get-NsxEdge OpenShift-ESG | Get-NsxEdgeNat | New-NsxEdgeNatRule -Vnic 0 -OriginalAddress 10.208.242.133 -TranslatedAddress 192.168.133.8 -Action dnat -Protocol any -OriginalPort any -TranslatedPort any -Enabled -Description "SSH to bastion node"

# Configure Load-balancer pool members
get-nsxedge OpenShift-ESG | get-nsxloadbalancer | Set-NsxLoadBalancer -Enabled
$poolMember1 = New-NsxLoadBalancerMemberSpec -name bootstrap-0 -IpAddress 192.168.133.9 -Port 6443
$poolMember2 = New-NsxLoadBalancerMemberSpec -name control-plane-0 -IpAddress 192.168.133.10 -Port 6443
$poolMember3 = New-NsxLoadBalancerMemberSpec -name control-plane-1 -IpAddress 192.168.133.11 -Port 6443
$poolMember4 = New-NsxLoadBalancerMemberSpec -name control-plane-2 -IpAddress 192.168.133.12 -Port 6443
$poolMember5 = New-NsxLoadBalancerMemberSpec -name bootstrap-0 -IpAddress 192.168.133.9 -Port 22623
$poolMember6 = New-NsxLoadBalancerMemberSpec -name control-plane-0 -IpAddress 192.168.133.10 -Port 22623
$poolMember7 = New-NsxLoadBalancerMemberSpec -name control-plane-1 -IpAddress 192.168.133.11 -Port 22623
$poolMember8 = New-NsxLoadBalancerMemberSpec -name control-plane-2 -IpAddress 192.168.133.12 -Port 22623
$poolMember9 = New-NsxLoadBalancerMemberSpec -name compute-0 -IpAddress 192.168.133.13 -Port 80
$poolMember10 = New-NsxLoadBalancerMemberSpec -name compute-1 -IpAddress 192.168.133.14 -Port 80
$poolMember11 = New-NsxLoadBalancerMemberSpec -name compute-2 -IpAddress 192.168.133.15 -Port 80
$poolMember12 = New-NsxLoadBalancerMemberSpec -name compute-0 -IpAddress 192.168.133.13 -Port 443
$poolMember13 = New-NsxLoadBalancerMemberSpec -name compute-1 -IpAddress 192.168.133.14 -Port 443
$poolMember14 = New-NsxLoadBalancerMemberSpec -name compute-2 -IpAddress 192.168.133.15 -Port 443

# Configure Load-balancer pools
$monitor = Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | Get-NsxLoadBalancerMonitor default_tcp_monitor
$pool1 = Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | New-NsxLoadBalancerPool -name api-pool-6443 -Description "OpenShift API TCP 6443" -Transparent:$false -Algorithm Round-Robin -Monitor $monitor -Memberspec $poolMember1,$poolMember2,$poolMember3,$poolMember4
$pool2 = Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | New-NsxLoadBalancerPool -name api-pool-22623 -Description "OpenShift API TCP 22623" -Transparent:$false -Algorithm Round-Robin -Monitor $monitor -Memberspec $poolMember5,$poolMember6,$poolMember7,$poolMember8
$pool3 = Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | New-NsxLoadBalancerPool -name app-pool-80 -Description "OpenShift Application HTTP" -Transparent:$false -Algorithm Round-Robin -Monitor $monitor -Memberspec $poolMember9,$poolMember10,$poolMember11
$pool4 = Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | New-NsxLoadBalancerPool -name app-pool-443 -Description "OpenShift Application HTTPS" -Transparent:$false -Algorithm Round-Robin -Monitor $monitor -Memberspec $poolMember12,$poolMember13,$poolMember14

# Configure Load-balancer application profile
$appProfile = Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | New-NsxLoadBalancerApplicationProfile -Name TCP-Source-Profile -Type TCP -PersistenceMethod sourceip

# Configure Load-balancer VIPs
Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | Add-NsxLoadBalancerVip -name api-6443-lb -Description "API / API-INT" -ipaddress 10.208.242.132 -Protocol tcp -Port 6443 -ApplicationProfile $appProfile -DefaultPool $pool1 -AccelerationEnabled
Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | Add-NsxLoadBalancerVip -name api-22623-lb -Description "API / API-INT" -ipaddress 10.208.242.132 -Protocol tcp -Port 22623 -ApplicationProfile $appProfile -DefaultPool $pool2 -AccelerationEnabled
Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | Add-NsxLoadBalancerVip -name app-80-lb -Description "Application HTTP" -ipaddress 10.208.242.131 -Protocol tcp -Port 80 -ApplicationProfile $appProfile -DefaultPool $pool3 -AccelerationEnabled
Get-NsxEdge OpenShift-ESG | Get-NsxLoadBalancer | Add-NsxLoadBalancerVip -name app-443-lb -Description "Application HTTPS" -ipaddress 10.208.242.131 -Protocol tcp -Port 443 -ApplicationProfile $appProfile -DefaultPool $pool4 -AccelerationEnabled

# Create DHCP pool
$xmlPayload = "
  <dhcp>
    <enabled>true</enabled>
    <ipPools>
      <ipPool>
        <ipRange>192.168.133.50-192.168.133.100</ipRange>
        <defaultGateway>192.168.133.1</defaultGateway>
        <subnetMask>255.255.255.0</subnetMask>
        <leaseTime>86400</leaseTime>
        <autoConfigureDNS>false</autoConfigureDNS>
        <primaryNameServer>10.187.214.66</primaryNameServer>
      </ipPool>
    </ipPools>
    <logging><enable>true</enable>
    <logLevel>info</logLevel></logging>
  </dhcp>"

$edgeID = (Get-NsxEdge -Name "OpenShift-ESG").Id
$uri = "/api/4.0/edges/$($edgeID)/dhcp/config"
$null = invoke-nsxwebrequest -method "put" `
      -uri $uri -body $xmlPayload -connection $nsxConnection

# Disconnect
Disconnect-NsxServer