Mount external files for configuration data
Use the extraMounts parameter to mount external files for configuration or authentication data in your Red Hat OpenStack Services on OpenShift (RHOSO) deployment, such as Red Hat Ceph Storage configuration files, external NFS shares, or storage back-end driver filesystems.
Example scenarios include:
- Distributing Red Hat Ceph Storage cluster configuration and keyring files to Block Storage (cinder), Image (glance), and Compute (nova) services
- Accessing external NFS shares for temporary image storage when node disk space is consumed
- Configuring storage back-end drivers to run on persistent file systems to preserve data between reboots
The extraMounts parameter can be defined at the following levels:
- Service - A Red Hat OpenStack Services on OpenShift (RHOSO) service such as
Glance,Cinder, orManila. - Component - A component of a service such as
GlanceAPI,CinderAPI,CinderScheduler,ManilaShare,CinderBackup. - Instance - An individual instance of a particular component. For example, your deployment could have two instances of the component
ManilaSharecalledshare1andshare2. An Instance level propagation represents the Pod associated to an instance that is part of the same Component type.
The propagation field is used to describe how the definition is applied. If the propagation field is not used, definitions propagate to every level below the level at which it is defined:
- Service level definitions propagate to Component and Instance levels.
- Component level definitions propagate to the Instance level.
The following is the general structure of an extraMounts definition:
extraMounts:
- name: <extramount-name>
region: <openstack-region>
extraVol:
- propagation:
- <location>
extraVolType: <Ceph | Nfs | Undefined>
volumes:
- <pod-volume-structure>
mounts:
- <pod-mount-structure>
nameis a string that names theextraMountsdefinition. This is for organizational purposes and cannot be referenced from other parts of the manifest. This is an optional attribute.regionis a string that defines the RHOSO region of theextraMountsdefinition. This is an optional attribute.propagationdescribes how the definition is applied. If thepropagationfield is not used, definitions propagate to every level below the level at which it is defined. This is an optional attribute.extraVolTypeis a string that assists the administrator in categorizing or labeling the group of mounts that belong to theextraVolentry of the list. There are no defined values for this parameter but the valuesCeph,Nfs, andUndefinedare common. This is an optional attribute.volumesis a list that defines Red Hat OpenShift volume sources. This field has the same structure as thevolumessection in a Pod. The structure is dependent on the type of volume being defined. The name defined in this section is used as a reference in themountssection.mountsis a list of mountpoints that represent the path where thevolumeSourceshould be mounted in the Pod. The name of a volume from thevolumessection is used as a reference and the path where it should be mounted. This attribute has the same structure as thevolumeMountsattribute for a Pod.
Mount external files with extraMounts Copy linkLink copied!
Configure the OpenStackControlPlane custom resource (CR) to access external data for configuration or authentication purposes in your Red Hat OpenStack Services on OpenShift (RHOSO) deployment.
Procedure Copy linkLink copied!
extraMounts configuration examples Copy linkLink copied!
The following configuration examples demonstrate how the extraMounts attribute is used to mount external files. The extraMounts attribute is defined at either the top level custom resource (spec) or the service definition.
- Dashboard service (horizon)
- This configuration example demonstrates using an external file to provide configuration to the Dashboard service.
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
- This configuration example defines the services that require access to the 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
- Shared File Systems service (manila)
- This configuration example provides external configuration files to the Shared File Systems service so that it can connect to a Red Hat Ceph Storage back end.
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 service (glance)
- This configuration example connects three
glanceAPIinstances to a different Red Hat Ceph Storage back end. The instances;api0,api1, andapi2; are connected to three different Red Hat Ceph Storage clusters that are namedceph0,ceph1, andceph2.
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