I want to deploy a pod name core-x but that pod is already running in my cluster what I want is to overwrite the old one with the new one.
Knowing that my image version has the same tag?
I need your help please
@yosser_mahfoudh you can't create a new pod with the same name and you can't change name of the existing pod too since name and namespace fields are immutable. Some of the fields can be changed though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So if I create a new pod named core-Y. how the core-X stop runing in my kubernetes cluster?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@yosser_mahfoudh you will have to explicitly delete it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That would be "kubectl delete pod $podName -n $namespace" if you're using kubectl.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. Perhaps, to delete the pod you don't need to run any sed against yaml. It'll be deleted as long as a pod with such a name exists in the namespace (its spec does not really matter)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's will delete whatever is in metadata.name in your yaml.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried what you said but it deletes it and never restart creating the pod from the begin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@yosser_mahfoudh yes, this is what delete command is expected to do. In the next step you can apply again (I'd recommend adding a 10-15 second sleep to give apiserver time to delete the pod).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do you mean like this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@yosser_mahfoudh I was more thinking about a new step. So your steps in the pipeline would differ by one command only.
Also, I'd recommend looking at an official K8s documentation and play with kubectl and your pod yaml in the command line to better understand kubectl and cluster behavior.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.