Kubernetes - setting custom permissions/file ownership per volume (and not per pod)

后端 未结 2 813
遥遥无期
遥遥无期 2021-01-13 10:18

Is there any way to set per-volume permissions/ownership in Kubernetes declaratively?

Usecase:

  • a pod is composed of two containers, running as two dist
2条回答
  •  甜味超标
    2021-01-13 10:43

    It can be done with adding one init container with root access.

        initContainers:
        - name: changeowner
          image: busybox
          command: ["sh", "-c", "chown -R 200:200 /"]   
          volumeMounts:
          - name: 
            mountPath: /
    

提交回复
热议问题