New to k8s. I want to understand, what kubectl delete sts --cascade=false
does?
If i remove cascade, it deletes the statefulsets pods.
New to k8s. I want to understand, what kubectl delete sts --cascade=false
does?
If i remove cascade, it deletes the statefulsets pods.
It is clearly explained in the documentation under Deleting the Statefulset:
Deleting a StatefulSet through kubectl will scale it down to 0, thereby deleting all pods that are a part of it. If you want to delete just the StatefulSet and not the pods, use
--cascade=false
.
So by passing this flag to kubectl delete
the Pods that are managed by Statefulset are still running even though the StatefulSet
object itself is deleted.
As described by the fine manual, it deletes the StatefulSet
oversight mechanism without actually deleting the underlying Pods. Removing the oversight mechanism means that if a Pod dies, or you wish to make some kind of change, kubernetes will no longer take responsibility for ensuring the Pods are in the desired configuration.