2f69e36d dink logo

Today’s post brought to you by the letter ‘k’: quickly re-pull an image in kubernetes


What do KDE, Kubernetes, and Krusty the Klown have in common? They all paid attention in English class where they taught us about cacaphony. In Xanadu did Kubla Khan a stately pleasure dome decree. And all their commands are ‘k*’. Ps, poor euphony, never used.

So here’s a ‘k*’ for you. You are developing along. You have a setup that is working, and you want to repetitively try out new containers without dropping all the volume claims, ingress, etc. You’ve set your imagePullPolicy to Always, and still, no dice.

Well, lets ‘patch’.

kubectl patch deployment MYCONTAINER -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"

bam. We have just forced it to do a repull, and nothing else will have changed. Wait a few seconds and debug on.

https://youtu.be/7KNtWrC7vfI
Krusty Komedy Klassic Kills Kubernetes Kacaphony