-
Notifications
You must be signed in to change notification settings - Fork 103
docs: Add procedure for configuring custom Heat resource plugins #1770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 1 commit into
openstack-k8s-operators:main
from
rabi:heat_custom_resource_plugin
Jan 27, 2026
+171
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
169 changes: 169 additions & 0 deletions
169
docs/assemblies/prc_configuring-custom-heat-resource-plugins.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| [id="prc_configuring-custom-heat-resource-plugins_{context}"] | ||
| = Configuring custom Heat resource plugins | ||
|
|
||
| [role="_abstract"] | ||
| You can deploy custom Heat resource plugins to extend the orchestration service with custom resource types. This procedure uses the `extraMounts` feature to mount plugin files into the heat-engine pods. For information about writing Heat plugins, refer to the upstream Heat documentation. | ||
|
|
||
| .Prerequisites | ||
|
|
||
| * A deployed OpenStack control plane with Heat enabled. | ||
| * Access to the OpenShift cluster with `oc` CLI. | ||
| * Your custom Heat plugin Python file(s). | ||
|
|
||
| == Procedure | ||
|
|
||
| Create a `ConfigMap` containing your plugin files and mount it into the heat-engine pods using `extraMounts`. | ||
|
|
||
| . Create a `ConfigMap` containing your custom Heat plugin: | ||
| + | ||
| ---- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: heat-custom-plugins | ||
| namespace: openstack | ||
| data: | ||
| my_custom_resource.py: | | ||
| <your_plugin_code> | ||
| ---- | ||
| + | ||
| * Replace `<your_plugin_code>` with your custom Heat plugin Python code. | ||
|
|
||
| . Apply the `ConfigMap`: | ||
| + | ||
| ---- | ||
| $ oc apply -f heat-custom-plugins-configmap.yaml | ||
| ---- | ||
|
|
||
| . Patch the `OpenStackControlPlane` CR to add `extraMounts` to the Heat section: | ||
| + | ||
| ---- | ||
| $ oc patch openstackcontrolplane <controlplane_name> -n openstack --type=merge -p ' | ||
| spec: | ||
| heat: | ||
| template: | ||
| extraMounts: | ||
| - name: custom-plugins | ||
| extraVol: | ||
| - extraVolType: heat-plugins | ||
| volumes: | ||
| - name: heat-custom-plugins | ||
| configMap: | ||
| name: heat-custom-plugins | ||
| mounts: | ||
| - name: heat-custom-plugins | ||
| mountPath: /usr/lib/heat | ||
| readOnly: true | ||
| propagation: | ||
| - HeatEngine | ||
| ' | ||
| ---- | ||
| + | ||
| * Replace `<controlplane_name>` with your `OpenStackControlPlane` CR name. | ||
|
|
||
| . Wait for the heat-engine pods to restart: | ||
| + | ||
| ---- | ||
| $ oc rollout status deployment/heat-engine -n openstack | ||
| ---- | ||
|
|
||
| . Verify the plugin files are mounted in the heat-engine pod: | ||
| + | ||
| ---- | ||
| $ oc exec deployment/heat-engine -n openstack -- ls -la /usr/lib/heat/ | ||
| ---- | ||
|
|
||
| . Verify the custom resource type is available: | ||
| + | ||
| ---- | ||
| $ oc rsh -n openstack openstackclient openstack orchestration resource type list | grep <resource_type> | ||
| ---- | ||
| + | ||
| * Replace `<resource_type>` with the resource type name defined in your plugin. | ||
|
|
||
| == Using a PersistentVolumeClaim for plugins larger than 1 MiB | ||
|
|
||
| If your plugin files exceed the 1 MiB `ConfigMap` size limit, use a `PersistentVolumeClaim` (PVC) instead. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Create a `PersistentVolumeClaim`: | ||
| + | ||
| ---- | ||
| apiVersion: v1 | ||
| kind: PersistentVolumeClaim | ||
| metadata: | ||
| name: heat-custom-plugins | ||
| namespace: openstack | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 1Gi | ||
| ---- | ||
|
|
||
| . Apply the PVC: | ||
| + | ||
| ---- | ||
| $ oc apply -f heat-custom-plugins-pvc.yaml | ||
| ---- | ||
|
|
||
| . Copy your plugin files to the PVC using a temporary pod: | ||
| + | ||
| ---- | ||
| $ oc run copy-plugins --image=registry.access.redhat.com/ubi9/ubi-minimal --restart=Never \ | ||
| --overrides='{"spec":{"containers":[{"name":"copy-plugins","image":"registry.access.redhat.com/ubi9/ubi-minimal","command":["sleep","3600"],"volumeMounts":[{"name":"plugins","mountPath":"/plugins"}]}],"volumes":[{"name":"plugins","persistentVolumeClaim":{"claimName":"heat-custom-plugins"}}]}}' \ | ||
| -n openstack | ||
| $ oc wait --for=condition=Ready pod/copy-plugins -n openstack | ||
| $ oc cp <local_plugin_path> openstack/copy-plugins:/plugins/ | ||
| $ oc delete pod copy-plugins -n openstack | ||
| ---- | ||
| + | ||
| * Replace `<local_plugin_path>` with the path to your plugin file or folder. | ||
|
|
||
| . Patch the `OpenStackControlPlane` CR to add `extraMounts` to the Heat section: | ||
| + | ||
| ---- | ||
| $ oc patch openstackcontrolplane <controlplane_name> -n openstack --type=merge -p ' | ||
| spec: | ||
| heat: | ||
| template: | ||
| extraMounts: | ||
| - name: custom-plugins | ||
| extraVol: | ||
| - extraVolType: heat-plugins | ||
| volumes: | ||
| - name: heat-custom-plugins | ||
| persistentVolumeClaim: | ||
| claimName: heat-custom-plugins | ||
| mounts: | ||
| - name: heat-custom-plugins | ||
| mountPath: /usr/lib/heat | ||
| readOnly: true | ||
| propagation: | ||
| - HeatEngine | ||
| ' | ||
| ---- | ||
| + | ||
| * Replace `<controlplane_name>` with your `OpenStackControlPlane` CR name. | ||
|
|
||
| . Wait for the heat-engine pods to restart: | ||
| + | ||
| ---- | ||
| $ oc rollout status deployment/heat-engine -n openstack | ||
| ---- | ||
|
|
||
| . Verify the plugin files are mounted in the heat-engine pod: | ||
| + | ||
| ---- | ||
| $ oc exec deployment/heat-engine -n openstack -- ls -la /usr/lib/heat/ | ||
| ---- | ||
|
|
||
| . Verify the custom resource type is available: | ||
| + | ||
| ---- | ||
| $ oc rsh -n openstack openstackclient openstack orchestration resource type list | grep <resource_type> | ||
| ---- | ||
| + | ||
| * Replace `<resource_type>` with the resource type name defined in your plugin. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a possibility that these are going to exceed 1MB? Do you also need a procedure to maybe build derived heat containers that have the custom modules built in?
I have a feeling I worked on a Jira related to this and I listed a couple of options that I explored and tested. I have insufficient access to find that Jira now though unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The largest plugin we've in repo (most complicated one, server.py) is 81,860 bytes, which is well under (7.8% of 1 MiB) etcd limit and they can use multiple configmaps for different plugins/files. I think we don't have to worry about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For larger files/folder (if can't use configmaps) there is the option of using a pvc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the option of using pvc for larger plugins in the docs now.