Had requirement to change the pod or deployment name.now when we deploy,we have 2 deployments and 3 pods each with old and new name So far i was deleting the old deployments manually.
do i need to manually delete the old deployment and pods or is there a better method?
To delete deployment use
$ kubectl delete deploy/old_deployment_name
This will delete deployment, including pods and rs, if you had them.
And dont do this mistake the second time :) @Kamol is right - the best way of managing resources is change config file(e.g your deployment) and re-apply with
kubectl apply -f deployment.yaml