4.2. RHOSO ネットワーク用の RHOCP の準備


Red Hat OpenStack Services on OpenShift (RHOSO) サービスは、Red Hat OpenShift Container Platform (RHOCP) のワークロードとして実行されます。NMState Operator を使用して、必要な分離ネットワークにワーカーノードを接続します。必要に応じて、各分離ネットワークに NetworkAttachmentDefinition (net-attach-def) カスタムリソース (CR) を作成し、分離ネットワークにサービス Pod を割り当てます。MetalLB Operator を使用して、分離ネットワーク上の内部サービスエンドポイントを公開します。デフォルトでは、パブリックサービスエンドポイントは RHOCP ルートとして公開されます。

手順

  1. ワークステーションに NodeNetworkConfigurationPolicy (nncp) CR ファイル (例: openstack-nncp.yaml) を作成します。
  2. RHOCP クラスター内のワーカーノードの名前を取得します。

    $ oc get nodes -l node-role.kubernetes.io/worker -o jsonpath="{.items[*].metadata.name}"
  3. ネットワーク設定を確認します。

    $ oc get nns/<worker_node> -o yaml | more
    • <worker_node> は、手順 2 で取得したワーカーノードの名前 (例: worker-1) に置き換えます。各ワーカーノードに対してこの手順を繰り返します。
  4. nncp CR ファイルで、RHOCP クラスター内の各ワーカーノードの分離ネットワークそれぞれのインターフェイスを設定します。ネットワーク分離を設定する必要があるデフォルトの物理データセンターネットワークの詳細は、デフォルトの Red Hat OpenStack Services on OpenShift ネットワーク を参照してください。

    次の例では、nncp CR は、ワーカーノード 1 (osp-enp6s0-worker-1) の enp6s0 インターフェイスを設定して、ネットワーク分離のために IPv4 アドレスを持つ VLAN インターフェイスを使用します。

    apiVersion: nmstate.io/v1
    kind: NodeNetworkConfigurationPolicy
    metadata:
      name: osp-enp6s0-worker-1
    spec:
      desiredState:
        interfaces:
        - description: internalapi vlan interface
          ipv4:
            address:
            - ip: 172.17.0.10
              prefix-length: 24
            enabled: true
            dhcp: false
          ipv6:
            enabled: false
          name: internalapi
          state: up
          type: vlan
          vlan:
            base-iface: enp6s0
            id: 20
            reorder-headers: true
        - description: storage vlan interface
          ipv4:
            address:
            - ip: 172.18.0.10
              prefix-length: 24
            enabled: true
            dhcp: false
          ipv6:
            enabled: false
          name: storage
          state: up
          type: vlan
          vlan:
            base-iface: enp6s0
            id: 21
            reorder-headers: true
        - description: tenant vlan interface
          ipv4:
            address:
            - ip: 172.19.0.10
              prefix-length: 24
            enabled: true
            dhcp: false
          ipv6:
            enabled: false
          name: tenant
          state: up
          type: vlan
          vlan:
            base-iface: enp6s0
            id: 22
            reorder-headers: true
        - description: Configuring enp6s0
          ipv4:
            address:
            - ip: 192.168.122.10
              prefix-length: 24
            enabled: true
            dhcp: false
          ipv6:
            enabled: false
          mtu: 1500
          name: enp6s0
          state: up
          type: ethernet
      nodeSelector:
        kubernetes.io/hostname: worker-1
        node-role.kubernetes.io/worker: ""
  5. nncp CR ファイルで、RHOCP クラスター内の各ワーカーノード上の分離されたネットワークごとにルーティング設定を追加します。

    apiVersion: nmstate.io/v1
    kind: NodeNetworkConfigurationPolicy
    metadata:
      name: osp-enp6s0-worker-1
      namespace: openstack
    spec:
      desiredState:
        interfaces:
          <....>
        routes:
          config:
          - destination: 192.168.123.0/24
            metric: 150
            next-hop-address: 192.168.122.1
            next-hop-interface: enp6s0
          - destination: 192.168.124.0/24
            metric: 150
            next-hop-address: 192.168.122.1
            next-hop-interface: enp6s0
          - destination: 172.17.1.0/24
            metric: 150
            next-hop-address: 172.17.0.1
            next-hop-interface: internalapi
          - destination: 172.17.2.0/24
            metric: 150
            next-hop-address: 172.17.0.1
            next-hop-interface: internalapi
          - destination: 172.18.1.0/24
            metric: 150
            next-hop-address: 172.18.0.1
            next-hop-interface: storage
          - destination: 172.18.2.0/24
            metric: 150
            next-hop-address: 172.18.0.1
            next-hop-interface: storage
          - destination: 172.19.1.0/24
            metric: 150
            next-hop-address: 172.19.0.1
            next-hop-interface: tenant
          - destination: 172.19.2.0/24
            metric: 150
            next-hop-address: 172.19.0.1
            next-hop-interface: tenant
  6. クラスターに nncp CR を作成します。

    $ oc apply -f openstack-nncp.yaml
  7. nncp CR が作成されたことを確認します。

    $ oc get nncp -w
    NAME                        STATUS        REASON
    osp-enp6s0-worker-1   Progressing   ConfigurationProgressing
    osp-enp6s0-worker-1   Progressing   ConfigurationProgressing
    osp-enp6s0-worker-1   Available     SuccessfullyConfigured
  8. ワークステーションに NetworkAttachmentDefinition (net-attach-def) CR ファイル (例: openstack-net-attach-def.yaml) を作成します。
  9. NetworkAttachmentDefinition CR ファイルで、分離されたネットワークごとに NetworkAttachmentDefinition リソースを設定して、各ネットワークのルーティング設定を含むサービスデプロイメント Pod をネットワークに接続します。次の例では、macvlan タイプの ctlplane ネットワークの NetworkAttachmentDefinition リソースを作成します。

    apiVersion: k8s.cni.cncf.io/v1
    kind: NetworkAttachmentDefinition
    metadata:
      name: ctlplane
      namespace: openstack 
    1
    
    spec:
      config: |
        {
          "cniVersion": "0.3.1",
          "name": "ctlplane",
          "type": "macvlan",
          "master": "enp6s0", 
    2
    
          "ipam": { 
    3
    
            "type": "whereabouts",
            "range": "192.168.122.0/24",
            "range_start": "192.168.122.30", 
    4
    
            "range_end": "192.168.122.70",
            "routes": [
              {
                "dst": "192.168.123.0/24", 
    5
    
                "gw": "192.168.122.1" 
    6
    
              },
              {
                "dst": "192.168.124.0/24",
                "gw": "192.168.122.1"
              }
            ]
          }
        }
    1
    サービスがデプロイされる namespace。
    2
    nncp CR で定義されている、ネットワークに関連付けられたノードインターフェイス名。
    3
    作成される Pod に .30 - .70 の範囲の IP を割り当てるための whereabouts CNI IPAM プラグイン。
    4
    IP アドレスプールの範囲が、MetalLB IPAddressPool の範囲および NetConfig allocationRange と重複しないようにしてください。
    5
    CIDR 表記の宛先ネットワーク。
    6
    ゲートウェイまたはルーターの IP アドレス。
  10. クラスターに NetworkAttachmentDefinition CR を作成します。

    $ oc apply -f openstack-net-attach-def.yaml
  11. NetworkAttachmentDefinition CR が作成されたことを確認します。

    $ oc get net-attach-def -n openstack
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る