Customizing ODM Liberty Configuration Using libertyHookRef
In IBM ODM, the libertyHookRef
parameter appears in production configurations. This parameter is found here: ODM for production configuration parameters This parameter allows you to inject custom configurations into the Liberty server.xml
, which is especially valuable in advanced use cases.
π Use Case: Adding a Third Datasource
By default, ODM Helm charts support configuration of two datasources: ilogDatasource
and resDatasource
. But what if your JAVA SE or POJO session requires an additional (third) datasource?
This is where libertyHookRef
comes into play. It allows you to extend Liberty's configuration - including additional datasources - via custom XML injected at runtime.
π οΈ How It Works
-
Create a libertyHookEnd.xml
File
This XML file works similarly to datasource-dc.xml
. To base your custom config on existing templates, you can inspect the contents inside a running ODM pod:
-
Sample libertyHookEnd.xml
Here's an example you can adapt. Make sure to change id
and jndiName
to suit your requirements:
-
Create a Secret
Bundle your libertyHookEnd.xml
into a Kubernetes secret named customdatasource-secret
:
*Create a libertyHookStart.xml file to modify the start of the server.xml and/or a libertyHookEnd.xml file to modify the end of the server.xml file.*
kubectl create secret generic my-liberty-config --from-file=libertyHookStart.xml --from-file=libertyHookEnd.xml
Update value.yaml
To apply the customization to Decision Center and Decision Server Runtime, add the following:
Or if you're using a global customization:
β οΈ Important: Avoid setting libertyHookRef
in multiple places. If using the customization
section, remove it from individual components to prevent conflicts.
Once everything is set, apply the updated values with:
------------------------------
Aaron Chen
------------------------------