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

后端 未结 2 792
遥遥无期
遥遥无期 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:30

    One solution is to use init-container to change permissions of mounted directories.

    The init-container would need to mount both volumes (from both containers), and do the needed chown/chmod operations.

    Drawbacks:

    • extra container that needs to be aware of other containers' specific (ie. uid/gid)
    • init container needs to run as root to perform chown

提交回复
热议问题