It seems by default Kubernetes creates a hostPath volume with 755
permission on a directory.
Is it possible to set this value to something else by a volume
spec? As opposed to manually doing a chmod
on the relevent host directory.
A hostPath volume mounts a file or directory from the host node's file system into your pod. For more information about hostPath volume, see Types of Volumes . A hostPath PersistentVolume must be used only in a single-node cluster. Kubernetes does not support hostPath on a multi-node cluster currently.
A Kubernetes hostpath is one of the volumes supported by Kubernetes. It is used to mount a file or directory from the host node's file system into our pod. It does not require most pods. However, it is instrumental in testing or development scenarios and provides a powerful escape for some applications.
initContainers:
- name: volume-mount-hack
image: busybox
command: ["sh", "-c", "chmod -R 777 /tmp/docker"]
volumeMounts:
- name: redis-socket
mountPath: /tmp/docker
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With