Last active
January 7, 2021 08:47
-
-
Save mhewedy/57ec9c4e78cacf6cc716b7a2e47d51db to your computer and use it in GitHub Desktop.
script to update spring boot apps configurations inside k8s/openshift
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
#!/usr/bin/env bash | |
ips=$(kubectl get ep myapp -o jsonpath='{range @}{.subsets[*].addresses[*].ip}{end}') | |
arr=($ips) | |
curls="" | |
for ip in "${arr[@]}"; do | |
curls="${curls}curl ${ip}:8080/actuator/refresh -d {} -H 'Content-Type: application/json' && " | |
done | |
curls="${curls} echo *****done*****" | |
echo -e "executing: \n$curls" | |
kubectl run configupdater-$RANDOM --image=radial/busyboxplus:curl -it --rm --restart=Never -- bash -c "$curls" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment