-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from SmartColumbusOS/crashloop-fix
Update Strimzi and Kafka Versions
- Loading branch information
Showing
7 changed files
with
77 additions
and
2 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
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,26 @@ | ||
rm -f replicas.txt | ||
|
||
scaleAppToIn () { | ||
kubectl scale --replicas=$2 deployment/$1 -n $3 | ||
} | ||
|
||
recordReplicas () { | ||
replicas=`kubectl get deployment $1 -n $2 -o=jsonpath='{.status.replicas}'` | ||
echo "$1 has $replicas replicas" | ||
echo "$1 $2 $replicas" >> replicas.txt | ||
} | ||
|
||
echo | ||
echo "Recording current replicas:" | ||
recordReplicas andi admin | ||
for app in reaper valkyrie forklift streisand flair odo | ||
do | ||
recordReplicas $app streaming-services | ||
done | ||
|
||
echo | ||
echo "Scaling apps down to 0:" | ||
while IFS=" " read -r app namespace replicas remainder | ||
do | ||
scaleAppToIn $app 0 $namespace | ||
done < "replicas.txt" |
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,10 @@ | ||
scaleAppToIn () { | ||
kubectl scale --replicas=$2 deployment/$1 -n $3 | ||
} | ||
|
||
echo | ||
echo "Scaling apps up to previous replicas:" | ||
while IFS=" " read -r app namespace replicas remainder | ||
do | ||
scaleAppToIn $app $replicas $namespace | ||
done < "replicas.txt" |
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,35 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
echo | ||
echo "Deleting old Stateful Sets:" | ||
kubectl delete sts streaming-service-public-kafka -n streaming-public --cascade=false | ||
kubectl delete sts streaming-service-kafka -n streaming-prime --cascade=false | ||
|
||
start_time="$(date -u +%s)" | ||
elapsed="$(($end_time-$start_time))" | ||
|
||
echo | ||
echo "Waiting for Strimzi to recreate the Stateful Sets:" | ||
until kubectl get sts streaming-service-kafka -n streaming-prime 2> /dev/null | ||
do | ||
printf "." | ||
sleep 10s | ||
done | ||
end_time="$(date -u +%s)" | ||
elapsed="$(($end_time-$start_time))" | ||
echo "Prime STS Recreated in $elapsed seconds" | ||
|
||
until kubectl get sts streaming-service-public-kafka -n streaming-public 2> /dev/null | ||
do | ||
printf "." | ||
sleep 10s | ||
done | ||
end_time="$(date -u +%s)" | ||
elapsed="$(($end_time-$start_time))" | ||
echo "Public STS Recreated in $elapsed seconds" | ||
|
||
/bin/bash ./scale_down.sh | ||
|
||
kubectl annotate statefulset streaming-service-kafka strimzi.io/manual-rolling-update=true -n streaming-prime | ||
kubectl annotate statefulset streaming-service-public-kafka strimzi.io/manual-rolling-update=true -n streaming-public |