-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce dynamic scaling of lifecycle env
Introduce scaling of lifecycle env, via a `deploy` script that deploys N number of lifecycle namespaces, and also via a `scale` script that increases the number of replicas per namespace. Also change slow-cooker from a Job to a Deployment. Part of #43. Signed-off-by: Andrew Seigner <[email protected]>
- Loading branch information
Showing
5 changed files
with
123 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
NAMESPACES=${1:-1} | ||
|
||
if [ "$NAMESPACES" -gt 100 ]; then | ||
echo "Don't deploy more than 100 namespaces" | ||
exit 1 | ||
fi | ||
|
||
echo "Deploying $NAMESPACES namespaces..." | ||
|
||
for i in `seq 1 $NAMESPACES`; | ||
do | ||
NS=lifecycle$i | ||
|
||
echo "\nDeploying $NS..." | ||
kubectl create ns $NS | ||
cat lifecycle.yml | | ||
conduit inject --conduit-namespace conduit-lifecycle - | | ||
kubectl -n $NS apply -f - | ||
done |
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 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
NAMESPACES=${1:-1} | ||
REPLICAS=${2:-1} | ||
|
||
if [ "$NAMESPACES" -gt 100 ]; then | ||
echo "Don't deploy more than 100 namespaces" | ||
exit 1 | ||
fi | ||
|
||
if [ "$REPLICAS" -gt 100 ]; then | ||
echo "Don't scale more than 100 replicas" | ||
exit 1 | ||
fi | ||
|
||
echo "Scaling $NAMESPACES namespaces to $REPLICAS replicas..." | ||
|
||
for i in `seq 1 $NAMESPACES`; | ||
do | ||
NS=lifecycle$i | ||
|
||
echo "\nScaling $NS to $REPLICAS replicas..." | ||
kubectl -n lifecycle$i scale --replicas=$REPLICAS deploy/bb-p2p deploy/bb-terminus | ||
done |
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,12 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
NAMESPACES=${1:-1} | ||
|
||
echo "Tearing down $NAMESPACES namespaces...\n" | ||
|
||
for i in `seq 1 $NAMESPACES`; | ||
do | ||
kubectl delete ns lifecycle$i || true | ||
done |
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