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.