Skip to content

Instantly share code, notes, and snippets.

View lbbedendo's full-sized avatar

Leonardo Barbieri Bedendo lbbedendo

View GitHub Profile
@mousavian
mousavian / k8s-cronjob-suspend.sh
Last active September 15, 2023 08:40
Suspending all cronjobs in all namespaces in kubernetes
#!/bin/bash
for ns in $(kubectl get ns -o jsonpath="{.items[*].metadata.name}"); do
for cj in $(kubectl get cronjobs -n "$ns" -o name); do
kubectl patch "$cj" -n "$ns" -p '{"spec" : {"suspend" : true }}';
done
done