Home > Enterprise >  Mongodb cluster Kubernetes Stateful set is not deleting
Mongodb cluster Kubernetes Stateful set is not deleting

Time:12-26

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.

CodePudding user response:

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>

CodePudding user response:

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>
  • Related