Chapter 4. Customizing the overcloud with director Operator
You can customize your overcloud or enable certain features by creating heat templates and environment files that you include with your overcloud deployment. With a director Operator (OSPdO) overcloud deployment, you store these files in ConfigMap
objects before running the overcloud deployment.
4.1. Adding custom templates to the overcloud configuration
Director Operator (OSPdO) converts a core set of overcloud heat templates into Ansible playbooks that you apply to provisioned nodes when you are ready to configure the Red Hat OpenStack Platform (RHOSP) software on each node. To add your own custom heat templates and custom roles file into the overcloud deployment, you must archive the template files into a tarball file and include the binary contents of the tarball file in an OpenShift ConfigMap
object named tripleo-tarball-config
. This tarball file can contain complex directory structures to extend the core set of templates. OSPdO extracts the files and directories from the tarball file into the same directory as the core set of heat templates. If any of your custom templates have the same name as a template in the core collection, the custom template overrides the core template.
All references in the environment files must be relative to the TripleO heat templates where the tarball is extracted.
Prerequisites
- The custom overcloud templates that you want to apply to provisioned nodes.
Procedure
Navigate to the location of your custom templates:
$ cd ~/custom_templates
Archive the templates into a gzipped tarball:
$ tar -cvzf custom-config.tar.gz *.yaml
Create the
tripleo-tarball-config ConfigMap
CR and use the tarball as data:$ oc create configmap tripleo-tarball-config --from-file=custom-config.tar.gz -n openstack
Verify that the
ConfigMap
CR is created:$ oc get configmap/tripleo-tarball-config -n openstack
Additional resources
4.2. Adding custom environment files to the overcloud configuration
To enable features or set parameters in the overcloud, you must include environment files with your overcloud deployment. Director Operator (OSPdO) uses a ConfigMap
object named heat-env-config
to store and retrieve environment files. The ConfigMap
object stores the environment files in the following format:
... data: <environment_file_name>: |+ <environment_file_contents>
For example, the following ConfigMap
contains two environment files:
... data: network_environment.yaml: |+ parameter_defaults: ComputeNetworkConfigTemplate: 'multiple_nics_vlans_dvr.j2' cloud_name.yaml: |+ parameter_defaults: CloudDomain: ocp4.example.com CloudName: overcloud.ocp4.example.com CloudNameInternal: overcloud.internalapi.ocp4.example.com CloudNameStorage: overcloud.storage.ocp4.example.com CloudNameStorageManagement: overcloud.storagemgmt.ocp4.example.com CloudNameCtlplane: overcloud.ctlplane.ocp4.example.com
Upload a set of custom environment files from a directory to a ConfigMap
object that you can include as a part of your overcloud deployment.
Prerequisites
- The custom environment files for your overcloud deployment.
Procedure
Create the
heat-env-config ConfigMap
object:$ oc create configmap -n openstack heat-env-config \ --from-file=~/<dir_custom_environment_files>/ \ --dry-run=client -o yaml | oc apply -f -
-
Replace
<dir_custom_environment_files>
with the directory that contains the environment files you want to use in your overcloud deployment. TheConfigMap
object stores these as individualdata
entries.
-
Replace
Verify that the
heat-env-config ConfigMap
object contains all the required environment files:$ oc get configmap/heat-env-config -n openstack