why do i need a volumeclaim.yaml for wordpress other than the volumeclaim.yaml for the mysql database?

7/9/2019

I was doing this tutorial https://cloud.google.com/kubernetes-engine/docs/tutorials/persistent-disk where they created a PersistentVolumeClaims for wordpress other than that of the database. I don't understand why? Is there data in wordpress that doesn't get saved in the database?

-- marwa karaki
database
google-cloud-platform
kubernetes
mysql
wordpress

2 Answers

7/9/2019

It's not a great pattern, but yes, some Wordpress data is stored outside of the database in the server's filesystem, or in this case, in the container's filesystem.

If you want persistence between pods restarts, you'll need a PVC and backing PV.

-- switchboard.op
Source: StackOverflow

7/9/2019

Wordpress uses mysql to store a lot of information but not all the information that is needed, for example, some cache files, static files like images and the wp-config.php are files that need to be stored as files and persist in case you need them after a pod recreation to persist the status of your application.

On the other hand, mysql is an application/service by itself with the same storage requirement to work, the data folder of mysql is the most obvious information you need to persist.

With that said the persistent volumes (PVC) cannot be mounted twice, for example on mount point in the wordpress pod and another one in the mysql pod using the same PVC you can reed more about PVC in the docs.

https://kubernetes.io/docs/concepts/storage/persistent-volumes/

-- wolmi
Source: StackOverflow