chown: changing ownership of '' ": Input/output error chown: changing ownership of '' ": Input/output error kubernetes kubernetes

chown: changing ownership of '' ": Input/output error


If I understand you correctly there are few things you can do:

  1. Launch the db container as root and than chown the directory. In case of mysql if you still can't change it than try running sudo chown -R mysql:mysql /var/lib/mysql as mysql:mysql is the default ownership there.

  2. Use initContainer in order to change the target folder to /var/lib/mysql/

  3. Use securityContext for containers. 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.