Created
October 21, 2018 23:05
-
-
Save markhilton/9626b2c132f8f92e59a10574eac1fd7c to your computer and use it in GitHub Desktop.
Kubernetes force rolling update on deployment. Usage: k8roll [required: deployment name] [optional: namespace]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -ge 1 ] || die "ERROR: deployment name argument is required, $# provided" | |
NAMESPACE=${2:-default} | |
kubectl -n $NAMESPACE patch deployment $1 -p \ | |
"{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"date\":\"`date +'%s'`\"}}}}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment