When using emqx5 operator there is a problem with persistence.
Using Azure cloud this happens:
When I follow the non-terraform guide (which means ‘kubectl apply -f emqx.yaml’, ‘kubectl delete -f emqx.yaml’, ‘kubectl apply -f emqx.yaml’) the PV remains claimed by PVC and when recreating the emqx cluster the PVC get’s tied back to the pod.
But when I delete the terraform resource ( ‘terraform destroy --target=kubernetes_manifest.this_emqx5’ ) it also releases the PVC and then the PVC/PV and the storage (on Azure) gets deleted.
resource “kubernetes_manifest” “this_emqx5” {
manifest = {
“apiVersion” = “apps.emqx.io/v2alpha1”
“kind” = “EMQX”
“metadata” = {
“name” = emqx5
“namespace” = default
}
“spec” = {
“image” = “emqx/emqx:5.0.21”
“coreTemplate” = {
“spec” = {
“replicas” = “3”
“volumeClaimTemplates” = {
“storageClassName” = “azurefile-csi-nfs”
“resources” = {
“requests” = {
“storage” = “20Mi”
}
}
“accessModes” = [“ReadWriteOnce”]
}
}
}
}
}
}
Don’t know where to start debugging.