6.6. 将切换配置添加到 control plane
要将交换机配置添加到 control plane,您可以通过 OpenStackControlPlane CR 中的 neutron 服务配置挂载交换机 03-ml2-genericswitch.conf 配置文件和 Secret 自定义资源(CR)。
流程
-
在工作站上打开
OpenStackControlPlaneCR 文件openstack_control_plane.yaml。 在
ironic服务中添加以下配置,将网络接口更改为neutron:spec: ... ironic: template: customServiceConfig: | [DEFAULT] default_network_interface=neutron将通用开关作为 ML2 机制驱动程序添加到
neutron服务规格:apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane metadata: name: openstack-control-plane namespace: openstack spec: secret: osp-secret ... neutron: ... template: ml2MechanismDrivers: - genericswitch - ovn在
neutron服务规格中添加extraMounts参数,以挂载物理网络交换机的配置:neutron: ... template: ... extraMounts: - name: switchConf extraVol: - volumes: - name: neutron-switch-config secret: secretName: neutron-switch-config mounts: - name: neutron-switch-config mountPath: /etc/neutron/neutron.conf.d/03-ml2-genericswitch.conf subPath: 03-ml2-genericswitch.conf readOnly: true如果需要为物理网络交换机分配身份验证密钥,请将私钥文件添加到挂载中:
mounts: - name: neutron-switch-config mountPath: /etc/neutron/neutron.conf.d/03-ml2-genericswitch.conf subPath: 03-ml2-genericswitch.conf readOnly: true - name: neutron-switch-config mountPath: /etc/neutron/<key_file_name> subPath: <key_file_name> readOnly: truemountPath应该与03-ml2-genericswitch.conf文件中为交换机设备定义的密钥文件的路径匹配。更新 control plane:
$ oc apply -f openstack_control_plane.yaml -n openstack