I created a deploymentconfig.yml to deploy an app and a want to mount a file which contents are stored in a ConfigMap. When mounting, the files in the folder that is mounted are replaced. The goal though is to only add/remove/overwrite a specific file in that folder.
spec:
containers:
volumeMounts:
- mountPath: /path/toaSubPath/
name: somename
Is this possible in this deploymentconfig? If so, how can I do that?
Yes, i am using this to mount default configs. Just use subPath and the file name in subPath. Find below sample it works like a charm
spec:
selector:
matchLabels:
name: some_name
template:
spec:
containers:
- args:
- bash
- entrypoint.sh
image: xyz
imagePullPolicy: IfNotPresent
name: some_name
volumeMounts:
- mountPath: /full/path/to/be/mounted/default.json
name: config
subPath: default.json
volumes:
- configMap:
defaultMode: 420
name: config