Comment on What's the best approach to deploy a static website to K8s cluster from a CI pipeline?
doeknius_gloek@feddit.de 1 year agoOne simple way to pull the new image into your cluster is to overwrite the latest
tag, specify imagePullPolicy: always
in your deployment and then use kubectl rollout restart deployment my-static-site
from within your pipeline to restart all pods. Kubernetes will then terminate all pods and replace them with new ones that pull the latest image.
You can also work with versioned tags and kubectl set image deployment/my-static-site site=my/image:version
. This might be a bit nicer and allows imagePullPolicy: IfNotPresent
, but you have to pass your version number into your pipeline somehow, e.g. with git tags.