What happens if I have a container running on image:latest and I push new image that is also image:latest

3/5/2018

I'm new to the devOps space and I'm just wondering what would happen if I set up a compute instance or kubernetes instance on Google Cloud with the latest tag and I pushed an image with the same name and tag e.g. image:latest. I'm just trying to figure out what the best way to setup automated deployments is through something like CircleCI or Codeship

Will this cause:

Non-cluster compute instance

  1. Restart container using the newly pushed image with tag latest
  2. Restart container using newly pushed image with tag latest only when the container is stopped / restarted
  3. Do absolutely nothing

Cluster / Kubernetes instance

  1. Create an "image update update request" in queue
  2. Do nothing

Cheers!

-- Clement
deployment
devops
google-cloud-platform
kubernetes

1 Answer

3/5/2018

Pushing a new latest tag on an image replaces the previous latest tag. It won't cause an automatic container restart (unless you configure your CI/CD system to do so).

While useful for development, I avoid using the latest tag for non-development work. It can introduce surprises and ambiguity that you don't want if a container is restarted unexpectedly.

-- Ross Peoples
Source: StackOverflow