Skip to content
Snippets Groups Projects
Commit faa901e3 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Adds cronjob spread migration.

parent 5083880c
No related branches found
No related tags found
No related merge requests found
#!/bin/bash -eu
for NS in `kubectl get psmdb -A --no-headers -o custom-columns=":metadata.namespace"`; do
echo $NS
export psmdb=`kubectl get psmdb -n $NS --no-headers -o custom-columns=":metadata.name"`
echo $psmdb
kubectl -n ${NS} patch psmdb ${psmdb} --type=json -p '[{"op":"replace","path":"/spec/backup/tasks/0/schedule","value":"'"$(( $RANDOM % 59 ))"' '"$(( $RANDOM % 5 ))"' * * *"}]'
done
for NS in `kubectl get cj -l application=spilo -A --no-headers -o custom-columns=":metadata.namespace"`; do
echo $NS
export cj=`kubectl -n ${NS} get cj -l application=spilo --no-headers -o custom-columns=":metadata.name"`
echo $cj
kubectl -n ${NS} patch cj ${cj} --type=json -p '[{"op":"replace","path":"/spec/schedule","value":"'"$(( $RANDOM % 59 ))"' '"$(( $RANDOM % 5 ))"' * * *"}]'
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment