Kube pod not in running state

146 views Asked by At

We have a argo-rollout for one of the service. I used the cmd to update the image.

kubectl-argo-rollouts -n ddash5 set image detector detector=starry-academy-177207/detector:deepak-detector-8

I was expecting this to update the pod, but it created a new one.

NAME                                     READY   STATUS      RESTARTS   AGE
detector-5d96bc8456-h2x7p                1/1     Running     0          35m
detector-68f89d8b45-j465j                0/1     Running     0          35m

Even if I delete detector-5d96bc8456-h2x7p, pod gets recreated with the older image. and detector-68f89d8b45-j465j stays in 0/1 state.

I am new to kube, Can someone give me insights to this?

Thanks!!! Deepak

1

There are 1 answers

0
Sai Chandra Gadde On BEST ANSWER

You are using argo rollout, where rolling updates allow deployment updates pods instances with new ones. The new Pods will be scheduled on Nodes with available resources.That is the reason new pods are getting created by replacing existing pods.

Instead you can use kubectl set image command which is used to update images of existing deployment, it will update images without recreating the deployment.Use the following command.

kubectl set image deployment/<deployment-name> <container-name>=<image>:<tag>

In your case:

kubectl set image deployment/detector detector=starry-academy-177207/detector:deepak-detector-8

This will update existing deployment, try it and let me know if this works.Found ArgoCD Image updater you can check it.