12.4.18. 在 RHOSP 上创建网络资源

在您自己的基础架构的 Red Hat OpenStack Platform(RHOSP)安装上创建 OpenShift Container Platform 所需的网络资源。为节省时间,可以运行提供的 Ansible playbook 来生成安全组、网络、子网、路由器和端口。

先决条件

  • Python 3 已安装在您的机器上。
  • 您下载了"下载 playbook 依赖项"中的模块。
  • 下载了"下载安装 playbook"中的 playbook。

流程

  1. 可选:为 inventory.yaml playbook 添加一个外部网络值:

    inventory.yaml Ansible playbook 中的外部网络值示例

    ...
          # The public network providing connectivity to the cluster. If not
          # provided, the cluster external connectivity must be provided in another
          # way.
    
          # Required for os_api_fip, os_ingress_fip, os_bootstrap_fip.
          os_external_network: 'external'
    ...

    重要

    如果没有为 inventory.yaml 文件中的 os_external_network 提供值,则必须确保虚拟机可以自行访问 Glance 和外部连接。

  2. 可选:将外部网络和浮动 IP(FIP)地址值添加到 inventory.yaml playbook:

    inventory.yaml Ansible playbook 中的 FIP 值示例

    ...
          # OpenShift API floating IP address. If this value is non-empty, the
          # corresponding floating IP will be attached to the Control Plane to
          # serve the OpenShift API.
          os_api_fip: '203.0.113.23'
    
          # OpenShift Ingress floating IP address. If this value is non-empty, the
          # corresponding floating IP will be attached to the worker nodes to serve
          # the applications.
          os_ingress_fip: '203.0.113.19'
    
          # If this value is non-empty, the corresponding floating IP will be
          # attached to the bootstrap machine. This is needed for collecting logs
          # in case of install failure.
          os_bootstrap_fip: '203.0.113.20'

    重要

    如果您没有为 os_api_fipos_ingress_fip 定义值,则必须执行安装后的网络配置。

    如果您没有为 os_bootstrap_fip 定义值,安装程序将无法从失败的安装中下载调试信息。

    如需更多信息,请参阅"启用对环境的访问"。

  3. 在命令行中,通过运行 security-groups.yaml playbook 来创建安全组:

    $ ansible-playbook -i inventory.yaml security-groups.yaml
  4. 在命令行中,通过运行 network.yaml playbook 来创建一个网络、子网和路由器:

    $ ansible-playbook -i inventory.yaml network.yaml
  5. 可选:如果要控制 Nova 服务器使用的默认解析程序,请运行 RHOSP CLI 命令:

    $ openstack subnet set --dns-nameserver <server_1> --dns-nameserver <server_2> "$INFRA_ID-nodes"