Last active
October 30, 2022 18:30
-
-
Save dschaaff/95bb21604139b8b3da27912050cc2347 to your computer and use it in GitHub Desktop.
Force a renewal cert-manager issued certificates in kubernetes.
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 | |
set -euo pipefail | |
namespaces="$(kubectl get namespaces -o json | jq -r '.items[] | .metadata.name')" | |
for name in $namespaces | |
do | |
certificates="$(kubectl get certificates -n $name -o json | jq -r '.items[] | .metadata.name')" | |
for cert in $certificates | |
do | |
kubectl patch certificate "$cert" -n "$name" -p '[{"op": "add", "path": "/spec/renewBefore", "value":"2159h59m30s"}]' --type='json' | |
#kubectl patch certificate "$cert" -n "$name" -p '[{"op": "remove", "path": "/spec/renewBefore"}]' --type='json' | |
done | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment