All containers are restarted after upgrade, because the container spec hash value is changed.
The upgrade procedure on control plane nodes should be executed one node at a time.
/etc/kubernetes/admin.conf
kubeadm upgrade also automatically renews the certificates that it manages on this node.
To opt-out of certificate renewal the flag --certificate-renewal=false can be used.
But if you maintain a CHANGELOG in this format, and/or your Git tags are also your Docker tags, you can get the previous version and use cache the this image version.
« Docker layer caching » is enough to optimize the build time.
Cache in CI/CD is about saving directories or files across pipelines.
We're building a Docker image, dependencies are installed inside a container.We can't cache a dependencies directory if it doesn't exists in the job workspace.
Dependencies will always be installed from a container but will be extracted by the GitLab Runner in the job workspace. Our goal is to send the cached version in the build context.
We set the directories to cache in the job settings with a key to share the cache per branch and stage.
To avoid old dependencies to be mixed with the new ones, at the risk of keeping unused dependencies in cache, which would make cache and images heavier.
If you need to cache directories in testing jobs, it's easier: use volumes !
version your cache keys !
sharing Docker image between jobs
In every job, we automatically get artifacts from previous stages.
docker save $DOCKER_CI_IMAGE | gzip > app.tar.gz
I personally use the « push / pull » technique,
we docker push after the build, then we docker pull if needed in the next jobs.