It is quite complicated to explain this issue, but I will do my best.
I am working on the project which has mono-repo with about 10 microservices at the moment. Develop and master are deployed to Kubernetes.
Before we had just
latest tag on Docker images in
deployment.yaml so after the build, we had to manually remove outdated pod to get it created with the latest image.
At the moment we made an improvement so on the Merge we make the build with the commit SHA as a tag for all docker images which goes to
deployment.yaml which triggers pods refresh, however, it is not a great solution (but still better than manual refresh of pods) because even if the merge really changed only one or two services, it triggers recreation of pods for all services.
I am looking for any good solutions to be able to (1)keep the tag of the image if it was fully built from the cache and then (2)be able to pass not changed tag to the deploy stage (or somehow determine which services changed and perform deploy only for those which changed, which sounds like a better idea).