Add support securityContext:fsGroup
(some container writes to volume using custom user/group id)
#1604
Labels
kind/bug
Categorizes issue or PR as related to a bug.
Expected Behavior
Being able to convert a simple docker-compose with just one service -- pgadmin
and use the generated files directly
Actual Behavior
As the volume is mounted on the containers owned by root, the container cannot write into it. pgadmin gives out error message Permission denied: ‘/var/lib/pgadmin/sessions’
One way to solve it is to add securityContext: fsGroup
In this way the pod will run without error.
Steps To Reproduce
kompose convert -f docker-compose.yaml --provider openshift
Kompose Version
Docker-Compose file
Anything else?
I haven't figure out why the same error doesn't occur when using docker-compose. Apparently it does not always mount with root:root.
fsGroup
is just one way. Another way I know would be usinginitContainer
and chmod the path but I guess that would be more messy in terms of kompose conversion. If we can just add some kompose label to indicate the fsGroup, then I think it would help a lot. pgadmin is just one example. grafana, and probably other commom images as well, all have this problem.The text was updated successfully, but these errors were encountered: