Skip to content

Instantly share code, notes, and snippets.

@mhewedy
Last active January 7, 2021 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhewedy/57ec9c4e78cacf6cc716b7a2e47d51db to your computer and use it in GitHub Desktop.
Save mhewedy/57ec9c4e78cacf6cc716b7a2e47d51db to your computer and use it in GitHub Desktop.
script to update spring boot apps configurations inside k8s/openshift
#!/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