I have a usecase wherein I need to pass path to a file as an env variable to my java app running in k8s.
<code>env:
name: INPUT
value: /path/to/input.txt
</code>
<code>env:
name: INPUT
value: /path/to/input.txt
</code>
env:
name: INPUT
value: /path/to/input.txt
App would read the file from location specified.
So I need to ensure that when pod starts, this file is passed to container at location provided above.
I understand that using volumes and volumemounts, we can do this.
<code>spec:
containers:
- name: myapp
image: myapp:latest
volumeMounts:
- name: xyz
mountPath: /app/config
...
...
spec:
volumes:
- name: xyz
</code>
<code>spec:
containers:
- name: myapp
image: myapp:latest
volumeMounts:
- name: xyz
mountPath: /app/config
...
...
spec:
volumes:
- name: xyz
</code>
spec:
containers:
- name: myapp
image: myapp:latest
volumeMounts:
- name: xyz
mountPath: /app/config
...
...
spec:
volumes:
- name: xyz
I am not very clear how would this work.
What location mounthPath represents in this whole arrangement?
And how to I make input.txt available to all this setup in kubernetes?