Question
Capgemini
IT
Last activity: 16 Apr 2025 9:00 EDT
Options for handling custom configuration files in client managed deployments
Hello,
According to Pega helm chart documentation (https://github.com/pegasystems/pega-helm-charts/blob/master/charts/pega/README.md#pega-configuration-files) if you want to overwrite default configuration files (prconfig.xml, prlog4j2.xml, ..), the custom files must be fully reported in your "values" file. This is working for us, but as result the values.yaml becomes a huge file, hardly to handle. So, our client is asking if there is any alternative way to handle this configurations, for example via configmap.
Let me explain the idea for prlog4j2.xml as example,, but if you have any other options, they are welcome.
step 1)
Adding the following section in values.yaml
- name: web
custom:
volumeMounts:
- name: prlog4j2-volume
mountPath: /path/pega/config
volumes:
- name: prlog4j2-volume
configMap:
name: prlog4j2-configmap
step 2) Creating a new file in pega/templates, let's suppose we can call it as prlog4j2-configmap.yaml, as below:
Hello,
According to Pega helm chart documentation (https://github.com/pegasystems/pega-helm-charts/blob/master/charts/pega/README.md#pega-configuration-files) if you want to overwrite default configuration files (prconfig.xml, prlog4j2.xml, ..), the custom files must be fully reported in your "values" file. This is working for us, but as result the values.yaml becomes a huge file, hardly to handle. So, our client is asking if there is any alternative way to handle this configurations, for example via configmap.
Let me explain the idea for prlog4j2.xml as example,, but if you have any other options, they are welcome.
step 1)
Adding the following section in values.yaml
- name: web
custom:
volumeMounts:
- name: prlog4j2-volume
mountPath: /path/pega/config
volumes:
- name: prlog4j2-volume
configMap:
name: prlog4j2-configmap
step 2) Creating a new file in pega/templates, let's suppose we can call it as prlog4j2-configmap.yaml, as below:
apiVersion: v1
kind: ConfigMap
metadata:
name: prlog4j2-configmap
namespace: {{{namespace}}
binaryData:
prlog4j2.xml:
{{ .Files.Get "config/prlog4j2.xml" | b64enc | indent 4}}
step 3) In values.yaml setting the parameter -Dpegarules.logging.configuration of JAVA_OPTS as follows:
-Dpegarules.logging.configuration=/path/config/prlog4j2.xml
Do you think it might work? Is there any other viable option to avoid full configuration files in values.yaml?
@AlessandroPic1 Yes, your approach using ConfigMaps to handle custom configuration files in Pega helm deployments is a good alternative to cluttering the
values.yamlfile. By creating separate ConfigMaps likeprlog4j2-configmap.yamland mounting them as volumes, you can manage each configuration file independently, which keeps yourvalues.yamlcleaner and easier to maintain. Setting theJAVA_OPTSparameter to point to the mounted configuration file ensures that your application uses the custom settings. Additionally, this method allows for better organization and reuse of configuration files across different deployments. Another option could be to use Helm'sincludeortemplatefunctions to modularize your configurations further, or leverage Helm's ability to import values from external files. You might also consider using Kubernetes Secrets for sensitive configurations to enhance security. Overall, using ConfigMaps is a viable and effective way to manage custom configurations without overwhelming yourvalues.yamlfile, and exploring Helm’s templating features can provide even more flexibility.