pingidentity / helm-charts

Apache License 2.0
22 stars 31 forks source link

volumeMount: mountPath value considered as a directory #273

Closed Cheenu007 closed 9 months ago

Cheenu007 commented 1 year ago

Hi Team,

We are deploying pingaccess application iin openshift using helm.

To change the logging level for PingAccess and PIng Federate applications, we thought of using configmap, from which we mounted the default log4j.xml from configmap.

In-case if we want to change the logging level from INFO to DEBUG, updating the configmaps which inturn updates the log4j2.xml file without restarting the pod.

Facing an issue, when trying to mount the path

Load log4j2.xml from configpath:

configMapVolumes: pa-log4j-config: items: pa-log4j-default-config: /opt/in/instance/conf/log4j2.xml

Mapping mount path to get the updated changes.

volumeMounts:

On deploying the file, the path mentioned in mounthpath considered as a directory.

Could you please share your thoughts on this. or is there any approach which can be used to externalize the logger level.

henryrecker-pingidentity commented 1 year ago

Rather than using configMapVolumes, You can directly define volumes and volumeMounts for workloads using the Helm chart. Something like this:

pingaccess-engine:
  enabled: true
  volumeMounts:
  - name: "pa-log4j-config"
    mountPath: "/opt/out/instance/conf/log4j2.xml"
    subPath: "pa-log4j-config"
  volumes:
  - name: "pa-log4j-config"
    configMap:
      name: "pa-log4j-config"

This will mount a single file from a configmap.

However the Kubernetes documentation indicates that configmap files mounted as subpaths (which is needed to mount single files from configmaps) do not update automatically when the configmap changes. https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically

So you would still need to restart the pod in this case, or manually update the file on the pod.