chown: changing ownership of '' ": Input/output error
If I understand you correctly there are few things you can do:
Launch the db container as
root
and thanchown
the directory. In case of mysql if you still can't change it than try runningsudo chown -R mysql:mysql /var/lib/mysql
asmysql:mysql
is the default ownership there.Use
initContainer
in order to change the target folder to/var/lib/mysql/
Use
securityContext
forcontainers
. For example:
containers:- name: mysql image: <msql_image> securityContext: runAsUser: 0
It should all also work for postgresql
.
Please let me know if that helped.