-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use rolling restart of pods for rosa scaling benchmark
Closes #799 Signed-off-by: Kamesh Akella <[email protected]>
- Loading branch information
Showing
3 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env bash | ||
# Use this for deleting all Keycloak pods in sequence. | ||
set -e | ||
|
||
if [[ "$RUNNER_DEBUG" == "1" ]]; then | ||
set -x | ||
fi | ||
|
||
: ${PROJECT:="runner-keycloak"} | ||
|
||
echo -e "\033[0;31mINFO:$(date '+%F-%T-%Z') Deleting all Keycloak pods in sequence\033[0m" | ||
|
||
ALL_KC_PODS=$(kubectl -n "${PROJECT}" -o 'jsonpath={.items[*].metadata.name}' get pods -l app=keycloak | tr " " "\n") | ||
|
||
ATTEMPT=0 | ||
for KC_POD in $ALL_KC_PODS; do | ||
ATTEMPT=$((ATTEMPT + 1)) | ||
kubectl get pods -n "${PROJECT}" -l app=keycloak | ||
echo -e "\033[0;31mINFO:$(date '+%F-%T-%Z') Killing Pod '${KC_POD}'\033[0m" | ||
kubectl delete pod -n "${PROJECT}" "${KC_POD}" --grace-period=1 | ||
|
||
START=$(date +%s) | ||
|
||
kubectl wait --for=condition=Available --timeout=120s deployments.apps/keycloak-operator -n "${PROJECT}" || true | ||
kubectl wait --for=condition=Ready --timeout=120s keycloaks.k8s.keycloak.org/keycloak -n "${PROJECT}" || true | ||
|
||
END=$(date +%s) | ||
DIFF=$(( END - START )) | ||
|
||
echo -e "\033[0;31mINFO:$(date '+%F-%T-%Z') Keycloak pod ${KC_POD} took ${DIFF} seconds to recover\033[0m" | ||
done | ||
|
||
kubectl get pods -n "${PROJECT}" -l app=keycloak | ||
echo -e "\033[0;31mINFO:$(date '+%F-%T-%Z') All Keycloak pods have been processed.\033[0m" |