14.3. 使用多个路由网络部署 overcloud
要使用多组路由网络部署 overcloud,请为 spine-leaf 网络创建 control plane 和 Compute 节点,然后呈现并应用 Ansible playbook。要创建 control plane,请指定 Controller 节点的资源。要从裸机机器为 leafs 创建 Compute 节点,请在 OpenStackBaremetalSet 自定义资源中包含资源规格。
流程
在工作站上创建一个名为
openstack-controller.yaml的文件。包含 Controller 节点的资源规格。以下示例显示了由三个 Controller 节点组成的 control plane 规格:apiVersion: osp-director.openstack.org/v1beta2 kind: OpenStackControlPlane metadata: name: overcloud namespace: openstack spec: gitSecret: git-secret openStackClientImageURL: registry.redhat.io/rhosp-rhel9/openstack-tripleoclient:17.1 openStackClientNetworks: - ctlplane - external - internal_api - internal_api_leaf1 # optionally the openstackclient can also be connected to subnets openStackClientStorageClass: host-nfs-storageclass passwordSecret: userpassword domainName: ostest.test.metalkube.org virtualMachineRoles: Controller: roleName: Controller roleCount: 1 networks: - ctlplane - internal_api - external - tenant - storage - storage_mgmt cores: 6 memory: 20 rootDisk: diskSize: 50 baseImageVolumeName: openstack-base-img storageClass: host-nfs-storageclass storageAccessMode: ReadWriteMany storageVolumeMode: Filesystem enableFencing: False创建 control plane:
$ oc create -f openstack-controller.yaml -n openstack-
等待 Red Hat OpenShift Container Platform (RHOCP)创建与
OpenStackControlPlane资源相关的资源。 在您的工作站上为每个 Compute leaf 创建一个文件,如
openstack-computeleaf1.yaml。包括 leaf 的 Compute 节点的资源规格。以下示例显示了一个 Compute leaf 的规格,它包含一个 Compute 节点:apiVersion: osp-director.openstack.org/v1beta1 kind: OpenStackBaremetalSet metadata: name: computeleaf1 namespace: openstack spec: # How many nodes to provision count: 1 # The image to install on the provisioned nodes baseImageUrl: http://<source_host>/rhel-9.2-x86_64-kvm.qcow2 # The secret containing the SSH pub key to place on the provisioned nodes deploymentSSHSecret: osp-controlplane-ssh-keys # The interface on the nodes that will be assigned an IP from the mgmtCidr ctlplaneInterface: enp7s0 # Networks to associate with this host networks: - ctlplane - internal_api_leaf1 - external - tenant_leaf1 - storage_leaf1 roleName: ComputeLeaf1 passwordSecret: userpassword为每个叶叶创建 Compute 节点:
$ oc create -f openstack-computeleaf1.yaml -n openstack-
使用
OpenStackConfigGenerator生成 Ansible playbook,并应用 overcloud 配置。如需更多信息,请参阅使用 director Operator 配置和部署 overcloud。
验证
查看 control plane 的资源:
$ oc get openstackcontrolplane/overcloud -n openstack查看
OpenStackVMSet资源,以验证 control plane 虚拟机(VM)集的创建:$ oc get openstackvmsets -n openstack查看 VM 资源以验证 OpenShift Virtualization 中创建 control plane 虚拟机:
$ oc get virtualmachines -n openstack测试对
openstackclientpod 远程 shell 的访问:$ oc rsh -n openstack openstackclient查看每个 Compute leaf 的资源:
$ oc get openstackbaremetalset/computeleaf1 -n openstack查看 RHOCP 管理的裸机机器,以验证 Compute 节点的创建:
$ oc get baremetalhosts -n openshift-machine-api