Skip to content

Commit

Permalink
feat: added scale in and scale out threshold for zsec vmss script
Browse files Browse the repository at this point in the history
  • Loading branch information
rhartnett-zscaler committed Jul 15, 2024
1 parent c943e20 commit f23c2fb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions examples/zsec
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,32 @@ first_run="yes"
echo "export TF_VAR_vmss_default_ccs=${vmss_default}" >> .zsecrc
echo "export TF_VAR_vmss_max_ccs=${vmss_max}" >> .zsecrc

#########################################
# Scale In/Out Threshold Configuration
#########################################
# Scale In threshold count
scale_in_default=50
read -r -p "${CYAN}Enter the scale in threshold for scale sets? This value refers to percent CPU utilization. [Default=$scale_in_default]: ${RESET}" scale_in_input
scale_in=${scale_in_input:-$scale_in_default}
if (( $scale_in < 1 || $scale_in > 100 )); then
echo "${RED}Invalid scale_in value. Must be a number between 1 and 100${RESET}"
echo "${YELLOW}Delete .zsecrc file and re-run zsec up...${RESET}"
exit 1
fi

# Scale Out threshold count
scale_out_default=70
read -r -p "${CYAN}Enter the scale out threshold for scale sets? This value refers to percent CPU utilization. [Default=$scale_out_default]: ${RESET}" scale_out_input
scale_out=${scale_out_input:-$scale_out_default}
if (( $scale_out < 1 || $scale_out > 100 || $scale_out <= $scale_in)); then
echo "${RED}Invalid scale_out value. Must be a number between 1 and 100 and be greater than scale_in value${RESET}"
echo "${YELLOW}Delete .zsecrc file and re-run zsec up...${RESET}"
exit 1
fi

echo "export TF_VAR_scale_in_threshold=${scale_in}" >> .zsecrc
echo "export TF_VAR_scale_out_threshold=${scale_out}" >> .zsecrc

#########################################
# Scheduled Scaling Configuration
#########################################
Expand Down

0 comments on commit f23c2fb

Please sign in to comment.