I want to map a file at a certain path in container to a file at a different path in the mounted volume.
For example:
File in Container ---> /some/path/folder/file.config
File in Volume ----> /some/other/path/different/folder/another_file.config
The use case involves fetching config files from a git repo using init containers and adding them to an emptyDir volume.
apiVersion: v1
kind: Pod
metadata:
name: pod
spec:
initContainers:
- name: git-sync
...
volumeMounts:
- mountPath: some/path/folder
name: volume
containers:
- name: some-container
image: some-image
volumeMounts:
- mountPath: some/path/folder/file.config
subPath: /some/other/path/different/folder/another_file.config
name: volume
volumes:
- name: kibana-volume
emptyDir: {}
PS: This has to be done using a volume (not a configmap) as there is a need to continuously sync git repo.