After delete pod, multiple pods create automatically

Pratyush 1 Reputation point
2025-04-04T07:30:26.5866667+00:00

After delete pod, multiple pods create automatically.

Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Obinna Ejidike 1,910 Reputation points
    2025-04-04T08:49:31.4966667+00:00

    Hi Pratyush

    Thanks for using QandA platform.

    When you delete a pod and multiple pods are automatically created, this typically indicates that the pod is managed by a higher-level Kubernetes controller, such as a:

    Deployment, ReplicaSet, StatefulSet, DaemonSet, or Job.

    The above controllers are designed to maintain a desired state. So when you manually delete a pod, the controller detects the change and re-creates it, or even multiple pods, depending on the configuration.

    Check what's creating the pods by running:

    kubectl get pod <pod-name> -o yaml
    

    Look for what tells you which controller owns the pod:

    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
      name: frontend
      labels:
        app: guestbook
        tier: frontend
    spec:
      # modify replicas according to your case
      replicas: 3
      selector:
        matchLabels:
          tier: frontend
    

    Find Doc: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/

    If you want to stop pods from being recreated:

    kubectl scale deployment myapp-deployment --replicas=0
    

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Obinna.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.