<ol>
<li><p>ECR is just a registry - so it only stores images - it does not identify latest images, nor provides any additional information beyond tags and sha256 image digests. So it is up to you to identify the sequence, common way is to use meaningful versioning system and tag with that. I.e., if you use SemVer, you can tag something like myimage:1.0.1, myimage:1.0.2 - which makes it pretty obvious what is newer.</p>
</li>
<li><p>Things have not changed in principle since the last question. Generally speaking, promotion of a newer image to a Kubernetes cluster is a separate process (CD) from creating and storing such image (CI). So you need some other trigger to make the promotion happen - you can automate this as well, and add such trigger directly at the end of the CI step if that is what you want for now - though note that usually there is more complex approval logic here in production settings.</p>
</li>
</ol>

CC BY-SA 4.0
2023-08-09T02:58:01.967Z
2023-08-09T02:58:01.967Z
taleodor
<p>I have a CircleCI set-up to push docker images to ECR, similar to this question here: <a href="https://devops.stackexchange.com/questions/14767/what-is-the-idiomatic-way-to-reload-eks-kube-configs-when-a-new-image-is-pushed">What is the idiomatic way to reload EKS/Kube configs when a new image is pushed to ECR</a></p>
<p>My question is two-fold:</p>
<ol>
<li><p>I've read that the <code>latest</code> tag is an anti-pattern and should be avoided and instead simply use the git commit id or something like that to tag the image. How does ECR identify which is the latest image if it is not explicitly tagged <code>latest</code>?</p>
</li>
<li><p>How should I trigger EKS to pick the most recent image - have things changed since that last question was posted? Does it need the <code>latest</code> tag ?</p>
</li>
</ol>

<kubernetes><eks><aws-ecr><circleci>
Run the latest image from ECR on EKS
Devang Sanghani
# Run the latest image from ECR on EKS

(Asked by: username_0 on 2023-08-08)

I have a CircleCI set-up to push docker images to ECR, similar to this question here: [What is the idiomatic way to reload EKS/Kube configs when a new image is pushed to ECR](https://devops.stackexchange.com/questions/14767/what-is-the-idiomatic-way-to-reload-eks-kube-configs-when-a-new-image-is-pushed)

My question is two-fold:

1. I've read that the `latest` tag is an anti-pattern and should be avoided and instead simply use the git commit id or something like that to tag the image. How does ECR identify which is the latest image if it is not explicitly tagged `latest`?
2. How should I trigger EKS to pick the most recent image - have things changed since that last question was posted? Does it need the `latest` tag ?

**Tags:** kubernetes, eks, aws-ecr, circleci


---

## 1 answers

### Answer by username_1 on 2023-08-09. Score: 1 | Accepted answer

1. ECR is just a registry - so it only stores images - it does not identify latest images, nor provides any additional information beyond tags and sha256 image digests. So it is up to you to identify the sequence, common way is to use meaningful versioning system and tag with that. I.e., if you use SemVer, you can tag something like myimage:1.0.1, myimage:1.0.2 - which makes it pretty obvious what is newer.
2. Things have not changed in principle since the last question. Generally speaking, promotion of a newer image to a Kubernetes cluster is a separate process (CD) from creating and storing such image (CI). So you need some other trigger to make the promotion happen - you can automate this as well, and add such trigger directly at the end of the CI step if that is what you want for now - though note that usually there is more complex approval logic here in production settings.


---

