I tried your steps with OpenShift v4.19 (Kubernetes 1.19) and it didn't work. The directory (which is a Tomcat 9 deployment) is still overwritten by the single file (logback.xml) in the volume
kind: ConfigMap apiVersion: v1 metadata: name: logback-configmap data: logback: | <?xml version="1.0" encoding="UTF-8"?> <configuration scan="true" scanPeriod="60 seconds"> [...]
and in the deployment config:
[...] spec: volumes: - name: logback-configmap-volume configMap: name: logback-configmap items: - key: logback path: logback.xml defaultMode: 420 [..] volumeMounts: - name: logback-configmap-volume mountPath: /deployments/zfaRouter/WEB-INF/classes/logback.xml subPath: logback.xml [..]
sh-4.4$ ls -la /deployments/zfaRouter/WEB-INF/classes/ total 4 drwxr-xr-x. 2 root root 25 May 4 16:35 . drwxr-xr-x. 3 root root 21 May 4 16:35 .. -rw-r--r--. 1 root 1015170000 1084 May 4 16:35 logback.xml
Do you have any idea why this is not working?
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I tried your steps with OpenShift v4.19 (Kubernetes 1.19) and it didn't work. The directory (which is a Tomcat 9 deployment) is still overwritten by the single file (logback.xml) in the volume
and in the deployment config:
Do you have any idea why this is not working?