Skip to content

Instantly share code, notes, and snippets.

@snobu
Last active July 21, 2019 04:09
Show Gist options
  • Save snobu/6f275b8247736f901133171b15de6dc2 to your computer and use it in GitHub Desktop.
Save snobu/6f275b8247736f901133171b15de6dc2 to your computer and use it in GitHub Desktop.
kubectl set deployment force image repull
#!/bin/bash
# See https://github.com/kubernetes/kubernetes/issues/33664
if [[ $# -eq 0 ]]; then
printf 'Pass deployment name as argument.\n\n'
kubectl get deployment
exit 1
fi
echo Patching deployment $1...
printf '{"spec":{"template":{"metadata":{"labels":{"date":"%s"}}}}}' `date +%s` | \
xargs -0 kubectl patch deployment $1 -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment