emqx-docker
emqx-docker copied to clipboard
Volumes in Kuberenetes
Hello,
Dockerfile define docker local volumes `` VOLUME ["/opt/emqx/log", "/opt/emqx/data", "/opt/emqx/lib", "/opt/emqx/etc"] ```
In K8s, those volumes are on host and pod might change to another host .. so it would be better to define K8s volumes ..
There are two issues :
- first make a custom image without docker local volumes
- manage user rights ..
Do you have any docker image for K8s and deployment yaml file with volumes ?
Hi @Philippe-Collignon Thanks for reporting this. We should perhaps remove those directories from docker volumes starting from 3.0.
Volumes can be mount+bind at run time.
If users really want it to be docker volume, they can add VOLUME
directive on top.
Otherwise there is no way to override existing volumes,
i.e. if users do not want them, they will have to re-build image
@turtleDeng @terry-xiaoyu what do you think
Thanks for your answer.
I made an image without docker volumes and create corresponding K8s volumes but then we face another issue because some files in the mounted paths are part of the image .. (i.e. files in /opt/emqx/etc) ... mounting a volume to that path just erase them ...
I finished by creating only one volume for mnesia .. for other files, we need to add them after container startup (in start.sh for example)