mirror of
https://github.com/Telecominfraproject/wlan-toolsmith.git
synced 2025-10-28 17:42:24 +00:00
48 lines
1.0 KiB
Bash
Executable File
48 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
. ./utils.sh
|
|
|
|
check_env
|
|
echo "Scaling cluster:"
|
|
show_env
|
|
echo "Press ENTER to continue [or CTRL-C to exit]"
|
|
read enter
|
|
|
|
declare -a steps
|
|
max_steps=10
|
|
for ((i=0; i < $max_steps; i++)) ; do
|
|
steps[$i]=""
|
|
done
|
|
if [ -n "$1" ] ; then
|
|
for ((i=0; i < $1; i++)) ; do
|
|
steps[$i]="echo"
|
|
done
|
|
fi
|
|
cstep=1
|
|
logv startscale "$(date)"
|
|
#set -x
|
|
echo "Determine caller identity"
|
|
if [ -n "$AWS_PROFILE" ] ; then
|
|
account_id=$(aws sts get-caller-identity --query Account --output text --profile $AWS_PROFILE)
|
|
else
|
|
account_id=$(aws sts get-caller-identity --query Account --output text)
|
|
fi
|
|
logv accountid $account_id
|
|
if [ -z "$account_id" ] ; then
|
|
echo "Unable to determine caller-identity!"
|
|
exit 1
|
|
fi
|
|
|
|
config_file="cluster.$CLUSTER_NAME.yaml"
|
|
echo "Generating cluster.yml file -> $config_file"
|
|
envsubst < cluster.yaml > $config_file
|
|
|
|
#eksctl create nodegroup -f cluster.$CLUSTER_NAME.yaml
|
|
eksctl scale nodegroup -f cluster.$CLUSTER_NAME.yaml
|
|
logv scaled $CLUSTER_NAME
|
|
logv endscale "$(date)"
|
|
|
|
#----------------------------------
|
|
#set +x
|
|
cstep=-1
|