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 Copy linkLink copied to clipboard!
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
$ cd ~/custom_templatesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Archive the templates into a gzipped tarball:
tar -cvzf custom-config.tar.gz *.yaml
$ tar -cvzf custom-config.tar.gz *.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
tripleo-tarball-config ConfigMapCR and use the tarball as data:oc create configmap tripleo-tarball-config --from-file=custom-config.tar.gz -n openstack
$ oc create configmap tripleo-tarball-config --from-file=custom-config.tar.gz -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
ConfigMapCR is created:oc get configmap/tripleo-tarball-config -n openstack
$ oc get configmap/tripleo-tarball-config -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2. Adding custom environment files to the overcloud configuration Copy linkLink copied to clipboard!
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>
...
data:
<environment_file_name>: |+
<environment_file_contents>
For example, the following ConfigMap contains two environment files:
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 ConfigMapobject:oc create configmap -n openstack heat-env-config \ --from-file=~/<dir_custom_environment_files>/ \ --dry-run=client -o yaml | oc apply -f -
$ oc create configmap -n openstack heat-env-config \ --from-file=~/<dir_custom_environment_files>/ \ --dry-run=client -o yaml | oc apply -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<dir_custom_environment_files>with the directory that contains the environment files you want to use in your overcloud deployment. TheConfigMapobject stores these as individualdataentries.
-
Replace
Verify that the
heat-env-config ConfigMapobject contains all the required environment files:oc get configmap/heat-env-config -n openstack
$ oc get configmap/heat-env-config -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow