Created
May 15, 2019 08:43
-
-
Save marfenij/893082cb023a691e913c28f2cf929707 to your computer and use it in GitHub Desktop.
Suspend/Resume k8s cronjobs
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
# suspend active cronjobs | |
kubectl.exe get cronjob | grep False | awk '{print $1}' | xargs kubectl patch cronjob -p '{"spec" : {"suspend" : true }}' | |
# resume suspended cronjobs | |
kubectl.exe get cronjob | grep True | awk '{print $1}' | xargs kubectl patch cronjob -p '{"spec" : {"suspend" : false }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment