CI/CD for developers · mid
Image tags, versions and knowing what is running
Tag every image with the commit SHA and deploy by digest. The latest tag hides which code runs and breaks rollbacks.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- With latest, applying the same manifest changes nothing in the pod template, so no rollout happens. Pods pick up whatever latest points to whenever they restart, so different pods can run different code.
- Rolling back to a revision that also says latest pulls the newest image again, which may contain someone else's unfinished change.
- Tag with the git commit SHA on every build, and add a semantic version for releases if useful. Never reuse or move a tag. In ECR, turn on immutable tags.
- What is running: kubectl get pods -o jsonpath on status.containerStatuses[*].imageID shows the digest each pod really runs. Compare it with what the registry says.
- Expose the version: a /version endpoint or build info in logs and metrics, so an incident starts with which version.
- Deploy by digest (image@sha256:...) for the strongest guarantee. Tags can be moved unless immutable.
- GitOps: the Git history of the environment repository is the record of what was deployed and when.
The red pen
Common traps: mistake → fix
Mistake: latest is fine for staging
Fix: It breaks rollouts and rollbacks there too.
Mistake: A tag is a fixed version
Fix: Tags can be moved unless immutable. A digest is fixed.
Mistake: kubectl rollout undo goes back to the old code if the tag is the same
Fix: It goes back to the old manifest, which can pull new code.
Easy to hard
Questions interviewers ask, easy to hard
- Why is the latest tag a problem in Kubernetes?
- How do you find out which version a pod is running?
- Which tag scheme do you use and why?
- Why use immutable tags in a registry?
- Nobody knows which version is running in production. How do you find out and prevent it?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.