4.17. 更新 RHOSP 上的网络资源


更新您自己的基础架构的 Red Hat OpenStack Platform (RHOSP) 安装的 OpenShift Container Platform 所需的网络资源。

先决条件

  • 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 文件中提供 for 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. 在命令行中,运行 update-network-resources.yaml playbook 更新网络资源:

    $ ansible-playbook -i inventory.yaml update-network-resources.yaml 1
    1
    此 playbook 将添加标签到网络、子网、端口和路由器。它还将浮动 IP 地址附加到 API 和 Ingress 端口,并为这些端口设置安全组。
  5. 可选:如果要控制 Nova 服务器使用的默认解析程序,请运行 RHOSP CLI 命令:

    $ openstack subnet set --dns-nameserver <server_1> --dns-nameserver <server_2> "$INFRA_ID-nodes"
  6. 可选: 您可以使用您创建的 inventory.yaml 文件来自定义安装。例如,您可以部署使用裸机的集群。

4.17.1. 使用裸机部署集群

如果您希望集群使用裸机,请修改 inventory.yaml 文件。集群可以同时在裸机上运行 control plane 和计算机器,或者只在计算机器上运行。

注意

确保 install-config.yaml 文件反映了您用于裸机 worker 的 RHOSP 网络是否支持浮动 IP 地址。

先决条件

  • RHOSP Bare Metal 服务(Ironic) 通过 RHOSP Compute API 启用并访问。
  • 裸机 可作为 RHOSP 类别 提供。
  • 如果您的集群在一个大于 16.1.6 且小于 16.2.4 的 RHOSP 版本上运行,则裸机 worker 无法正常工作,因为存在一个已知问题会导致元数据服务对 OpenShift Container Platform 节点上的服务不可用。
  • RHOSP 网络支持 VM 和裸机服务器附加。
  • 如果要将机器部署到预先存在的网络中,则会置备 RHOSP 子网。
  • 如果要在安装程序置备的网络中部署机器,RHOSP Bare Metal 服务(Ironic)可以侦听在租户网络上运行的 Preboot eXecution Environment(PXE)引导机器并与之交互。
  • 作为 OpenShift Container Platform 安装过程的一部分,创建了 inventory.yaml 文件。

流程

  1. inventory.yaml 文件中,编辑机器的类别:

    1. 如果要使用裸机 control plane 机器,请将 os_flavor_master 的值改为裸机类型。
    2. 将值 of os_flavor_worker 更改为裸机类型。

      裸机 inventory.yaml 文件示例

      all:
        hosts:
          localhost:
            ansible_connection: local
            ansible_python_interpreter: "{{ansible_playbook_python}}"
      
            # User-provided values
            os_subnet_range: '10.0.0.0/16'
            os_flavor_master: 'my-bare-metal-flavor' 1
            os_flavor_worker: 'my-bare-metal-flavor' 2
            os_image_rhcos: 'rhcos'
            os_external_network: 'external'
      ...

      1
      如果要使用裸机 control plane 机器,请将这个值改为一个裸机类型。
      2
      将此值更改为用于计算机器的裸机类别。

使用更新的 inventory.yaml 文件完成安装过程。部署期间创建的机器使用添加到该文件中的类别。

注意

在等待裸机引导时,安装程序可能会超时。

如果安装程序超时,重启并使用安装程序的 wait-for 命令完成部署。例如:

$ ./openshift-install wait-for install-complete --log-level debug
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.