Delete Instance

This feature is used to delete MySQL-PXC instances. Users can delete a specified instance by specifying the instance name and namespace. After deleting the instance, you can choose whether to retain the instance data. If the instance data is not retained, it will be permanently deleted and cannot be recovered.

Procedure

CLI
Web Console
  1. Determine whether to retain data
  • Retain data
kubectl patch mysql -n <namespace> <name> --type json -p '[{"op": "add", "path": "/metadata/finalizers/-", "value": "delete-pvc"}]'
  • Delete data
current_finalizers=$(kubectl get mysql -n <namespace> <name> -o jsonpath='{.metadata.finalizers}' | jq --arg f "delete-pvc" 'map(select(. != $f))')
kubectl patch mysql -n <namespace> <name> --type merge -p "{\"metadata\":{\"finalizers\":$current_finalizers}}"
  1. Delete the instance
kubectl delete mysql -n <namespace> <name>
ON THIS PAGE