2.2. 挂载外部文件配置示例
以下配置示例演示了如何使用 extraMounts 属性挂载外部文件。extraMounts 属性在顶级自定义资源(spec)或服务定义中定义。
- Dashboard 服务(horizon)
- 此配置示例演示了使用外部文件为 Dashboard 服务提供配置。
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
spec:
horizon:
enabled: true
template:
customServiceConfig: '# add your customization here'
extraMounts:
- extraVol:
- extraVolType: HorizonSettings
mounts:
- mountPath: /etc/openstack-dashboard/local_settings.d/_66_help_link.py
name: horizon-config
readOnly: true
subPath: _66_help_link.py
volumes:
- name: horizon-config
configMap:
name: horizon-config
- Red Hat Ceph Storage
- 此配置示例定义了需要访问 Red Hat Ceph Storage secret 的服务。
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
spec:
extraMounts:
- name: v1
region: r1
extraVol:
- propagation:
- CinderVolume
- CinderBackup
- GlanceAPI
- ManilaShare
extraVolType: Ceph
volumes:
- name: ceph
secret:
secretName: ceph-conf-files
mounts:
- name: ceph
mountPath: "/etc/ceph"
readOnly: true
- 共享文件系统服务(manila)
- 此配置示例向共享文件系统服务提供外部配置文件,以便它能够连接到 Red Hat Ceph Storage 后端。
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
apiVersion: core.openstack.org/v1beta1
spec:
manila:
template:
ManilaShares:
share1:
...
extraMounts:
- name: v1
region: r1
extraVol:
- propagation:
- share1
extraVolType: Ceph
volumes:
- name: ceph
secret:
secretName: ceph-conf-files
mounts:
- name: ceph
mountPath: "/etc/ceph"
readOnly: true
- Image 服务 (glance)
-
此配置示例将三个
glanceAPI实例连接到不同的 Red Hat Ceph Storage 后端。实例(api0、api1和api2)连接到三个不同的 Red Hat Ceph Storage 集群,它们名为ceph0、ceph1和ceph2。
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
spec:
extraMounts:
- name: api0
region: r1
extraVol:
- propagation:
- api0
volumes:
- name: ceph0
secret:
secretName: <secret_name>
mounts:
- name: ceph0
mountPath: "/etc/ceph"
readOnly: true
- name: api1
region: r1
extraVol:
- propagation:
- api1
volumes:
- name: ceph1
secret:
secretName: <secret_name>
mounts:
- name: ceph1
mountPath: "/etc/ceph"
readOnly: true
- name: api2
region: r1
extraVol:
- propagation:
- api2
volumes:
- name: ceph2
secret:
secretName: <secret_name>
mounts:
- name: ceph2
mountPath: "/etc/ceph"
readOnly: true