mysql-operator
mysql-operator copied to clipboard
PersistenteVolume deleting when stopping the pod
This is my yaml file:
apiVersion: mysql.presslabs.org/v1alpha1
kind: MysqlCluster
metadata:
name: {{ .Values.magento_database_cluster.name }}
namespace: {{ .Values.namespace.name }}
spec:
replicas: 1
secretName: magento-database-users
initBucketURL: {{ .Values.magento_database.backup }}
initBucketSecretName: mysql-database-storage-secret
volumeSpec:
persistentVolumeClaim:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 15Gi
backupCompressCommand:
- pigz
- --stdout
backupDecompressCommand:
- gzip
rcloneExtraArgs:
- --buffer-size=1G
- --multi-thread-streams=8
- --retries-sleep=10s
- --retries=10
Every time I stop the pod the volume is getting deleted. It creates the persistenteVolume and persistenteVolumeClaim.
Using: minikube + skaffold + helm 3
Am I missing something?
Thanks
Hi @enoliveira, how do you stop the pod? The PVC gets deleted but only for replicas when the cluster is scaled-down and never for the master pod or index 0.
What version of k8s are you using?
Thank you!
Kubernetes version v1.20.
I'm using Skaffold to deploy. When I stop the deployment though Skaffold all volumes are persistent except the MysqlCluster.
It can be because of the k8s version. I didn't test on 1.20. We have a cleanup task that removes PVC if not used. I have to revise that.
Thank you!
me too
k8s version 1.17
me too
k8s version 1.21