I have created Mongodb stateful set using mongodb kubernetes operator.
Now I want to delete that stateful set from kubernetes dashboard, but it is getting recreated again and again.
How do we delete stateful set permanently so that it doesn't get created again.
Are you trying to delete a pod or the Stateful set itself?
Try to run:
kubectl scale sts <Stateful Set name> --replicas=0 -n <your namespace>
For deleting pod forcefully use this.
kubectl delete pod <Pod_Name> -n <namespace_name> --grace-period=0 --force
OR
kubectl delete pod <Pod_Name> -n <namespace_name> --wait=false
For reference please follow below link. https://kubernetes.io/docs/tasks/run-application/force-delete-stateful-set-pod/
How do we delete stateful set permanently so that it doesn't get created again.
List and check the name of statefulset
kubectl get statefulsets -n <namespace name>
Command to delete the stateful set permanently
kubectl delete statefulset <Mongo statefulset name> -n <namespace name>
Update
Try deleting the CRD also
kubectl get crd
delete CRD for mongo
kubectl delete crd <CRD name>