Deleting Stateful Sets in Kubernetes

3/13/2019

How to delete the Stateful Sets in Kubernetes permanently? They get re-created even after I delete them by setting --force and --grace-period=0 flags.

I know I can delete them all by removing the deployment itself. I'm interested in knowing if there is any way to preserve the deployments and delete only unwanted Stateful Sets.

-- Balajee Venkatesh
containers
kubernetes
openshift
statefulset

1 Answer

3/13/2019

Scaling the deployment to 0 will remove the pods, but will keep the deployment:

kubectl scale deploy/my-deployment --replicas=0

-- Amityo
Source: StackOverflow