Last active
July 24, 2020 12:59
-
-
Save unacceptable/92a82c1cebc1db9471b5de2eb8905e0e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Restart pods in a deployment | |
kubepatch(){ | |
TYPE="${1:-"deployment"}" | |
NAMESPACE="${2:-"dev"}" | |
NAME="$(kubectl get "$TYPE" -n "$NAMESPACE" | awk '{print $1}' | fzf)" | |
kubectl patch "$TYPE" \ | |
"$NAME" \ | |
-n "$NAMESPACE" \ | |
-p "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"date\":\"$(date '+%s')\"}}}}}" && \ | |
kubectl rollout status "$TYPE" \ | |
-n "$NAMESPACE" \ | |
"$NAME" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment