第 3 章 在 OpenShift 部署中为 Red Hat OpenStack Services 配置 OVN 网关
OVN 网关将逻辑 OpenStack 租户网络连接到物理外部网络。许多 RHOSO 环境至少有一个 OVN 网关,并且可能有多个物理外部网络和多个 OVN 网关。
有些环境不包含 OVN 网关。例如,环境可能没有 OVN 网关,因为不需要连接,因为环境不使用直接连接到提供商网络的集中式浮动 IP 或路由器和工作负载,或者因为使用了其他连接方法。
您可以选择配置 OVN 网关的位置。OVN 网关位置选择包括:
- Control plane(控制平面)
- RHOCP worker 节点上的 OVN 网关,用于托管 OpenStack 控制器服务。将 OVN 网关放在专用 NIC 中,其只目的是为 OVN 网关提供接口。
- 数据平面
- 数据平面上专用网络节点上 OVN 网关。如需更多信息, 请参阅配置网络服务 中的 配置网络节点。
control plane OVN 网关可能会受到数据平面 OVN 网关的中断。
可选的负载均衡服务(octavia)需要至少使用一个 control plane OVN 网关。
使用 control plane OVN 网关的环境中不支持可选的 BGP 服务。
因此,不支持使用负载均衡服务和 BGP 服务的部署。如需更多信息,请参阅链接:https://issues.redhat.com/browse/OSPRH-10768。
3.1. 使用专用 NIC 配置 control plane OVN 网关 复制链接链接已复制到粘贴板!
您可以将 OVN 网关放在 control plane 节点上的专用 NIC 中。这可减少中断的可能性,但需要额外的 NIC。
先决条件
-
在工作站上安装了
oc命令行工具。 -
以具有
cluster-admin权限的用户身份登录到可访问 RHOSO 控制平面的工作站。 - 托管 RHOSO 控制平面的每个 RHOCP worker 节点都有一个专用于 OVN 网关的 NIC。在每个节点上为专用 NIC 使用相同的 NIC 名称。另外,每个 worker 节点至少具有 Red Hat OpenShift Container Platform 集群要求 中描述的两个 NIC。
- 您的 OpenStackControlPlane 自定义资源(CR)文件 openstack_control_plane.yaml 存在于工作站上。
流程
-
打开
OpenStackControlPlaneCR 定义文件openstack_control_plane.yaml。 将以下 ovnController 配置(包括
nicMappings)添加到ovn服务配置中:ovnController: spec: ... ovn: template: ovnController: networkAttachment: tenant nicMappings: <network_name: nic_name>-
将
<network_name> 替换为网关所在的物理供应商网络的名称。这应该将--provider-physical-network参数的值与用于创建网络的openstack network create命令匹配。例如,datacentre。 -
将
<nic_name> 替换为连接到网关网络的 NIC 名称,如enp6s0。 -
可选:根据需要在
;nic_name> 对。nicMappings下添加额外的 <network_name>:<
-
将
更新 control plane:
$ oc apply -f openstack_control_plane.yaml -n openstackovn-operator创建网络附加定义,将它们添加到 pod 中,创建一个外部网桥,并配置external-ids:ovn-bridge-mappings。默认情况下,设置external-ids:ovn-cms-options=enable-chassis-as-gw会被默认配置。等待 RHOCP 创建与
OpenStackControlPlaneCR 相关的资源。运行以下命令来检查状态:$ oc get openstackcontrolplane -n openstack NAME STATUS MESSAGE openstack-control-plane Unknown Setup started当状态为 "Setup complete" 时,会创建
OpenStackControlPlane资源。提示将
-w选项附加到 get 命令的末尾,以跟踪部署进度。通过查看
openstack命名空间中的 pod 确认 control plane 已部署:$ oc get pods -n openstack当所有 pod 都已完成或运行时,会部署 control plane。验证
ovn-controller和ovn-controller-ovspod 正在运行,并且运行的 pod 数量等于运行 OpenStack control plane 服务的 OCP control plane 节点数量。
验证
在
OpenStackClientpod 上运行远程 shell 命令,以确认 OVN Controller 网关代理在 control plane 节点上运行:$ oc rsh -n openstack openstackclient openstack network agent list输出示例
+--------------------------------------+------------------------------+---------+ | ID | agent_type | host | +--------------------------------------+----------------------------------------+ | 5335c34d-9233-47bd-92f1-fc7503270783 | OVN Controller Gateway agent | ctrl0 | | ff66288c-5a7c-41fb-ba54-6c781f95a81e | OVN Controller Gateway agent | ctrl1 | | 5335c34d-9233-47bd-92f1-fc7503270783 | OVN Controller Gateway agent | ctrl2 | +--------------------------------------+----------------------------------------+