Sobes.tech
Middle+

What happens if you manually delete StatefulSet and DaemonSet pods?

sobes.tech AI

Answer from AI

If you manually delete pods managed by a StatefulSet, the StatefulSet controller will detect that the number of pods is less than specified in the configuration and will create new pods with the same names and identities (for example, with the same ordinal indices). StatefulSet guarantees order and stability of identity, so the new pods will be restored with the same name and volume attachments.

For DaemonSet, the situation is similar: the DaemonSet controller ensures that a pod is running on each suitable node. If a pod is manually deleted, the DaemonSet will create a new pod on that same node.

Thus, manually deleting pods in StatefulSet and DaemonSet will lead to their automatic recovery by the controllers, ensuring high availability and stability of services.