When I run kubectl delete deployment.yaml, It is displayed on cli that the deployment is deleted. The pod also gets into terminating state. But a new pod is again created with the same deployment and replica-set.
On further digging in I found out that deployment and RS are not being removed. Any reason why deployment and RS wouldn't be removed? Why would the be terminated if deployment isn't removed?
Any leads are appreciated.
As OP confirmed in the comments that they are running
argocdthen the recreation of the resources is expected behaviour if argocd is running in auto sync mode for the impacted namespace.Here is a short snippet from the document
Solution: you can disable autosync and monitor the delta and approve sync manually. This is something decided at project level. you can read about it here.