local-storage icon indicating copy to clipboard operation
local-storage copied to clipboard

Allow non-root users to have read and write access to directories mounted in containers

Open carlory opened this issue 2 years ago • 2 comments

What happened?

local volumes to mount into the non-root container's /data directory :

[root@ik8s01 clusters]# kubectl --kubeconfig dce.config -n operators exec -it rfr-anya-ls002-0 -- sh
Defaulted container "redis" out of: redis, redis-exporter, init (init)
/data $ ls -l /
total 4
drwxr-xr-x    2 root     root            42 May 20 08:25 data
...

/data $ id
uid=1001 gid=1001

What did you expect to happen?

Without setting the security Context, local storage allow non-root users to have read and write access to directories mounted in containers

Output of kubectl version:

Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.20", GitCommit:"7c28a83e67cb506f9df948d7b23698f8f9c279b8", GitTreeState:"clean", BuildDate:"2021-07-15T08:58:53Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.23) and server (1.18) exceeds the supported minor version skew of +/-1

Cloud Provider/Platform (AKS, GKE, Minikube etc.):

DCE 4.0.8

carlory avatar May 20 '22 11:05 carlory