Created
February 2, 2016 10:42
-
-
Save itsprdp/2a2dff983720a8479207 to your computer and use it in GitHub Desktop.
Mount Persistent Disk to a container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Pod | |
apiVersion: v1 | |
metadata: | |
name: readonly-pod | |
spec: | |
containers: | |
- name: readonly-pod | |
image: nginx | |
volumeMounts: | |
- mountPath: /etc/secrets | |
name: secret-files | |
readOnly: true | |
volumes: | |
- name: secret-files | |
gcePersistentDisk: | |
pdName: secret-files | |
fsType: ext4 | |
readOnly: true # Disable this for the first time to write data to the volume |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a use case where the file(secret file) has to be shared between multiple containers across pods.
I was wondering if I can use the persistent volume and mount it on the containers as a ReadOnly accessMode. How do I transfer the file? Do I have to mount this volume on a dummy pod with ReadWriteMany accessMode, transfer the file and then destroy the pod? And I'll have to do this every time I have to update the file on the volume.