'How do I update my EKS cluster after pushing a change to a Pod's ECR image?

I have an EKS cluster running a service. After I've pushed a change to a Pod's ECR how can I get EKS to update the deployment with a new pod? So far I can only think of deleting the pod, forcing EKS to launch a new a new. Is there a better way of achieving this? I would like to have Jenkins force the pods recreation.



Solution 1:[1]

I recommend CI/CD here, after building your image, your CD will deploy it and Jenkins can take that role.

If the image tag hasn't changed, you can try with kubectl rollout restart deployment deployment-name (you may need this imagePullPolicy: Always).

If the image tag changes, you can use sed to replace it and run kubectl apply.

In my humble opinion, you should use v1.Jenkins-build-number or v1.merge-request-number ..., don't use latest for the image tag.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1