4.4.2. BGP 用の分離されたネットワークインターフェイスを備えた RHOCP の準備
NodeNetworkConfigurationPolicy (nncp) カスタムリソース (CR) を作成し、Red Hat OpenShift Container Platform (RHOCP) クラスター内にある各ワーカーノードの各分離ネットワークのインターフェイスを設定します。
手順
-
ワークステーションに
NodeNetworkConfigurationPolicy(nncp) CR ファイル (例:openstack-nncp-bgp.yaml) を作成します。 RHOCP クラスター内のワーカーノードの名前を取得します。
$ oc get nodes -l node-role.kubernetes.io/worker -o jsonpath="{.items[*].metadata.name}"ネットワーク設定を確認します。
$ oc get nns/<worker_node> -o yaml | more-
<worker_node>は、手順 2 で取得したワーカーノードの名前 (例:worker-1) に置き換えます。各ワーカーノードに対してこの手順を繰り返します。
-
nncpCR ファイルで、RHOCP クラスター内の各ワーカーノードの分離ネットワークそれぞれのインターフェイスを設定します。次の例では、
nncpCR が Red Hat OpenStack Services on OpenShift (RHOSO) ネットワークをマッピングするために使用する複数の未接続ブリッジを設定します。BGP インターフェイスを使用してネットワークファブリックとピアリングし、接続を確立します。ループバックインターフェイスは、BGP ネットワークソースアドレス (99.99.0.x) で設定されます。必要に応じて、NIC をctlplaneネットワーク専用にできます。apiVersion: nmstate.io/v1 kind: NodeNetworkConfigurationPolicy metadata: labels: osp/nncm-config-type: standard name: worker-0 namespace: openstack spec: desiredState: dns-resolver: config: search: [] server: - 192.168.122.1 interfaces: - description: internalapi bridge mtu: 1500 name: internalapi state: up type: linux-bridge - description: storage bridge mtu: 1500 name: storage state: up type: linux-bridge - description: ctlplane bridge mtu: 1500 name: ospbr state: up type: linux-bridge - description: BGP interface 1 ipv4: address: - ip: 100.64.0.14 prefix-length: "30" dhcp: false enabled: true ipv6: enabled: false mtu: 1500 name: enp8s0 state: up type: ethernet - description: BGP interface 2 ipv4: address: - ip: 100.65.0.14 prefix-length: "30" dhcp: false enabled: true ipv6: enabled: false mtu: 1500 name: enp9s0 state: up type: ethernet - description: loopback interface ipv4: address: - ip: 99.99.0.3 prefix-length: "32" dhcp: false enabled: true mtu: 65536 name: lo state: up route-rules: config: [] routes: config: - destination: 99.99.0.0/16 next-hop-address: 100.64.0.13 next-hop-interface: enp8s0 weight: 200 - destination: 99.99.0.0/16 next-hop-address: 100.65.0.13 next-hop-interface: enp9s0 weight: 200 nodeSelector: kubernetes.io/hostname: worker-0 node-role.kubernetes.io/worker: ""クラスターに
nncpCR を作成します。$ oc apply -f openstack-nncp-bgp.yamlnncpCR が作成されたことを確認します。$ oc get nncp -w- 出力例
NAME STATUS REASON worker-0 Progressing ConfigurationProgressing worker-0 Progressing ConfigurationProgressing worker-0 Available SuccessfullyConfigured