第 3 章 为 RHOSP 动态路由部署 undercloud
undercloud 是控制最终 Red Hat OpenStack Platform (RHOSP) 环境(称为 overcloud)的配置、安装和管理的节点。undercloud 使用 OpenStack Platform 组件服务,包括在容器中运行的 OVN BGP 代理。这些容器化服务包括一个称为 RHOSP director 的工具,用于创建和管理 overcloud。
本节中包含的主题为:
3.1. 为 RHOSP 动态路由安装和配置 undercloud 复制链接链接已复制到粘贴板!
您可以使用 Red Hat OpenStack Platform (RHOSP) director 在 RHOSP undercloud 中安装和配置动态路由。高级步骤有:
-
(可选)在
frr-parameters.yaml中为 undercloud 设置 BGP 配置值。 -
在
undercloud.conf中为 undercloud 设置 spine-leaf 网络拓扑配置值。 -
运行
openstack undercloud install命令。
流程
-
以
stack用户身份登录 undercloud 主机。 查找
stackrcundercloud 凭证文件:$ source ~/stackrc如果您计划使用 BGP 访问其他机架和 overcloud 节点,请通过将以下参数添加到自定义 heat 环境文件
/home/stack/templates/frr-parameters.yaml来配置 FRRouting (FRR)。注意请记住此路径。后续步骤中需要用到它。
示例
parameter_defaults: ContainerFrrImage: registry.redhat.io/rhosp-17.1/openstack-frr-rhel9:17.1.1 FrrBfdEnabled: true FrrBgpEnabled: true FrrBgpAsn: 64999 FrrBgpUplinks: ['nic2', 'nic3'] FrrBgpUplinksScope: internal FrrLogLevel: debugging FrrBgpRouterID: 172.30.4.1 FrrBgpIpv4SrcIp: 172.30.4.1 FrrBgpIpv6SrcIp: fe80::5054:ff:fe74:73ce提示有关更多信息,请参阅 Overcloud 参数指南中的 Networking (neutron) 参数。
FrrBfdEnabled-
为
true时,启用双向转发检测(BFD)。默认值为false。 FrrBgpEnabled-
为
true时,启用边框网关协议(BGP)。默认值是true。 FrrBgpAsn-
FRRouting 中使用的默认 ASN。默认值为
65000。FrrBgpAsn可以设置为使用的每个角色的不同值。 FrrBgpUplinks-
以逗号分隔的 uplink 网络接口列表。默认值为
['nic1', 'nic2']。 FrrBgpUplinksScope-
与内部(iBGP)或外部(eBGP)邻居的对等点。默认值为
internal。 FrrLogLevel-
使用以下值指定 FRR 日志级别:
emergencies,alerts,critical,errors,warnings,notifications,informational,debugging.默认为informational。 FrrBgpRouterID-
FRR 要使用的 BGP
router_id。 FrrBgpIpv4SrcIp- IPv4 网络流量的源 IP 地址。
FrrBgpIpv6SrcIp- IPv6 网络流量的源 IP 地址。
tripleo_frr_bgp_peers- 用于指定特定于角色的参数,用来为 Free Range Routing (FRR)指定要对等的 IP 地址或主机名。
tripleo_frr_ovn_bgp_agent_enable-
特定于角色的参数,用于在没有数据平面路由的 RHOSP 节点上启用或禁用 OVN BGP 代理。默认值为
true。
如果您还没有
undercloud.conf文件,请复制示例模板文件:$ cp /usr/share/python-tripleoclient/undercloud.conf.sample \ ~/templates/undercloud.conf在
[DEFAULT]部分中,设置以下常规参数值:示例
[DEFAULT] # General cleanup = false container_images_file=/home/stack/templates/ \containers-prepare-parameter.yaml overcloud_domain_name = {{ cloud_domain }} undercloud_timezone = UTC undercloud_hostname = undercloud-0.{{ cloud_domain }} # BGP on undercloud ... # TLS-e ... # Networking ... # Subnets ...提示如需更多信息,请参阅使用 director 安装和管理 Red Hat OpenStack Platform 指南中的 Undercloud 配置参数。
overcloud_domain_name-
指定部署 overcloud 时要使用的 DNS 域名。在后续步骤中,您必须确保这个值与 overcloud
CloudDomain参数的值匹配。 cleanup-
删除临时文件。把它设置为
false以保留部署期间使用的临时文件。如果出现错误,临时文件可帮助您调试部署。 container_images_file- 使用容器镜像信息指定 Heat 环境文件。
container_insecure_registries-
供
podman使用的不安全 registry 列表。如果您想从其他来源(如私有容器 registry)拉取镜像,则使用此参数。 custom_env_files- 要添加到 undercloud 安装中的其他环境文件。
undercloud_hostname- 定义 undercloud 的完全限定主机名。如果设置,undercloud 安装将配置所有系统主机名设置。如果保留未设置,undercloud 将使用当前的主机名,但您必须相应地配置所有主机名设置。
undercloud_timezone- undercloud 的主机时区。如果未指定时区,director 将使用现有时区配置。
如果要在 undercloud 上安装 BGP,在
[DEFAULT]部分中,在 undercloud 上启用 FRR,并指向您在前面步骤中设置 FRR 参数值的自定义环境文件。示例
[DEFAULT] # General ... # BGP on undercloud enable_frr=true custom_env_files=/home/stack/templates/frr-parameters.yaml # TLS-e ... # Networking ... # Subnets ...如果您使用 TLS-everywhere,然后在
[DEFAULT]部分中设置以下 TLS-everywhere 参数值:示例
[DEFAULT] # General ... # BGP on undercloud ... # TLS-e enable_novajoin = False undercloud_nameservers = {{ freeipa_ip }} generate_service_certificate = True ipa_otp = {{ undercloud_otp }} # Networking ... # Subnets ...提示如需更多信息,请参阅使用 director 安装和管理 Red Hat OpenStack Platform 指南中的 Undercloud 配置参数。
enable_novajoin-
为
true时,启用 novajoin 服务来部署 TLS。 undercloud_nameservers-
指定 undercloud 名称服务器的 DNS 服务器的当前 IP 地址。您可以在
/etc/resolv.conf中找到此信息。 generate_service_certificate-
定义 undercloud 安装期间是否生成 SSL/TLS 证书,此证书用于
undercloud_service_certificate参数。 ipa_otp- 设置 FreeIPA OTP 事实。
在
[DEFAULT]部分中,设置以下网络参数值:示例
[DEFAULT] # General ... # BGP on undercloud ... # TLS-e ... # Networking local_interface = eth0 local_ip = {{ undercloud_ctlplane }}/24 undercloud_public_host = {{ undercloud_public_host }} undercloud_admin_host = {{ undercloud_admin_host }} # Subnets ...提示如需更多信息,请参阅使用 director 安装和管理 Red Hat OpenStack Platform 指南中的 Undercloud 配置参数。
local_interface- 用于本地网络的桥接接口。
local_ip-
leaf0上的 undercloud 的 IP 地址。 undercloud_public_host- 用于外部的 undercloud 的 IP 地址。
undercloud_admin_host- undercloud 的管理 IP 地址。此 IP 地址通常位于 leaf0 上。
为您之前在
subnets参数中定义的每个子网创建一个新部分。重要director 在创建子网后无法更改子网的 IP 地址。
示例
[DEFAULT] # General ... # BGP on undercloud ... # TLS-e ... # Networking ... # Subnets [r1] # This subnet is used for overcloud nodes deployed on rack1. cidr = 192.168.1.0/24 dhcp_start = 192.168.1.150 dhcp_end = 192.168.1.170 inspection_iprange = 192.168.1.171,192.168.1.185 gateway = 192.168.1.1 masquerade = False [r2] # This subnet is used for overcloud nodes deployed on rack2. cidr = 192.168.2.0/24 dhcp_start = 192.168.2.150 dhcp_end = 192.168.2.170 inspection_iprange = 192.168.2.171,192.168.2.185 gateway = 192.168.2.1 masquerade = False [r3] # This subnet is used for overcloud nodes deployed on rack3. cidr = 192.168.3.0/24 dhcp_start = 192.168.3.150 dhcp_end = 192.168.3.170 inspection_iprange = 192.168.3.171,192.168.3.185 gateway = 192.168.3.1 masquerade = False [r4] # This subnet is used for the underloud node and potentially FreeIPA # that are deployed on rack4. cidr = 192.168.4.0/24 dhcp_start = {{ undercloud_dhcp_start }} dhcp_end = 192.168.4.170 inspection_iprange = 192.168.4.171,192.168.4.185 gateway = 192.168.4.1 masquerade = False提示有关更多信息,请参阅使用 director 安装和管理 Red Hat OpenStack Platform 指南中的 子网。
cidr-
director 用来管理 overcloud 实例的网络。这是 undercloud
neutron服务管理的 Provisioning 网络。保留其默认值192.168.24.0/24,除非您需要 Provisioning 网络使用其他子网。 masquerade定义是否伪装
cidr中定义的用于外部访问的网络。这为 Provisioning 网络提供了网络地址转换(NAT),使 Provisioning 网络能够通过 director 进行外部访问。注意director 配置还使用相关的 sysctl 内核参数自动启用 IP 转发。
dhcp_start和dhcp_end- overcloud 节点 DHCP 分配范围的开始值和终止值。请确保此范围可以为节点提供足够的 IP 地址。
dhcp_exclude- DHCP 分配范围中排除的 IP 地址。
dns_nameservers-
特定于子网的 DNS 名称服务器。如果没有为子网定义名称服务器,子网将使用
undercloud_nameservers参数中定义的名称服务器。 gateway-
overcloud 实例的网关。它是 undercloud 主机,会把网络流量转发到外部网络。保留其默认值
192.168.24.1,除非您需要 director 使用其他 IP 地址,或想直接使用外部网关。
运行 install 命令。
$ openstack undercloud install确保您的 undercloud 具有正确的网络配置,包括用于访问每个叶和机架的额外网络路由。
如需更多信息,请参阅 安装和管理 Red Hat OpenStack Platform 指南中的 Director 配置参数。
验证
director 配置脚本会自动启动所有服务。确认 RHOSP 服务容器正在运行:
$ sudo podman ps -a --format "{{.Names}} {{.Status}}"输出示例
您应该看到类似如下的输出,这表示 RHOSP 服务容器为
Up:memcached Up 3 hours (healthy) haproxy Up 3 hours rabbitmq Up 3 hours (healthy) mysql Up 3 hours (healthy) iscsid Up 3 hours (healthy) keystone Up 3 hours (healthy) keystone_cron Up 3 hours (healthy) neutron_api Up 3 hours (healthy) logrotate_crond Up 3 hours (healthy) neutron_dhcp Up 3 hours (healthy) neutron_l3_agent Up 3 hours (healthy) neutron_ovs_agent Up 3 hours (healthy) ironic_api Up 3 hours (healthy) ironic_conductor Up 3 hours (healthy) ironic_neutron_agent Up 3 hours (healthy) ironic_pxe_tftp Up 3 hours (healthy) ironic_pxe_http Up 3 hours (unhealthy) ironic_inspector Up 3 hours (healthy) ironic_inspector_dnsmasq Up 3 hours (healthy) neutron-dnsmasq-qdhcp-30d628e6-45e6-499d-8003-28c0bc066487 Up 3 hours ...确认您可以初始化
stack用户以使用命令行工具:$ source ~/stackrc如果提示符显示
(undercloud),这表示 OpenStack 命令对 undercloud 进行身份验证并执行:输出示例
(undercloud) [stack@director ~]$director 的安装已完成。您现在可以使用 director 命令行工具了。