0

I have deployed and setup mysql in kubernetes via the stable/mysql helm chart backed by NFS storage class. When I deploy a second copy of the mysql chart for another app it fails with the following error:

[ERROR] --initialize specified but the data directory has files in it. Aborting.

I have tried adding a subPath property to the values config but didn't help. It seems like it is mounting to the same path as the first mysql deployment. To my knowledge PersistentVolumeClaims should be isolated from one another and theirfore be an empty directory for mysql to mount into?

Any help of tips are appreciated.

  • Does this answer your question? [Kubernetes NFS Persistent Volumes - multiple claims on same volume? Claim stuck in pending?](https://stackoverflow.com/questions/44204223/kubernetes-nfs-persistent-volumes-multiple-claims-on-same-volume-claim-stuck) – Matt Oct 07 '20 at 03:49
  • Also don't rely on NFS for any serious DB work – Matt Oct 07 '20 at 03:50
  • @Matt thanks for your response. I have looked at the answer and does not seem to directly address the issue of why when making a PVC on the same mountPath to a PV it seems as tho the PVC is not empty? Are claims not isolated from each other? – Vaugen Wakeling Oct 07 '20 at 07:06
  • Could you provide your configuration YAMLs (Deployment, NFS storage class, PVC, PV) also output of `kubectl describe deployment ` and `kubectl describe pvc` Its your local env or cloud env? – PjoterS Oct 07 '20 at 10:26

0 Answers0