mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-02 11:18:16 +00:00
Minion->Node rename: NUM_NODES
This commit is contained in:
@@ -17,13 +17,13 @@
|
||||
ZONE=${KUBE_AWS_ZONE:-us-west-2a}
|
||||
MASTER_SIZE=${MASTER_SIZE:-}
|
||||
NODE_SIZE=${NODE_SIZE:-}
|
||||
NUM_MINIONS=${NUM_MINIONS:-4}
|
||||
NUM_NODES=${NUM_NODES:-4}
|
||||
|
||||
# Dynamically set node sizes so that Heapster has enough space to run
|
||||
if [[ -z ${NODE_SIZE} ]]; then
|
||||
if (( ${NUM_MINIONS} < 50 )); then
|
||||
if (( ${NUM_NODES} < 50 )); then
|
||||
NODE_SIZE="t2.micro"
|
||||
elif (( ${NUM_MINIONS} < 150 )); then
|
||||
elif (( ${NUM_NODES} < 150 )); then
|
||||
NODE_SIZE="t2.small"
|
||||
else
|
||||
NODE_SIZE="t2.medium"
|
||||
@@ -33,9 +33,9 @@ fi
|
||||
# Dynamically set the master size by the number of nodes, these are guesses
|
||||
# TODO: gather some data
|
||||
if [[ -z ${MASTER_SIZE} ]]; then
|
||||
if (( ${NUM_MINIONS} < 50 )); then
|
||||
if (( ${NUM_NODES} < 50 )); then
|
||||
MASTER_SIZE="t2.micro"
|
||||
elif (( ${NUM_MINIONS} < 150 )); then
|
||||
elif (( ${NUM_NODES} < 150 )); then
|
||||
MASTER_SIZE="t2.small"
|
||||
else
|
||||
MASTER_SIZE="t2.medium"
|
||||
@@ -121,7 +121,7 @@ ENABLE_NODE_AUTOSCALER="${KUBE_ENABLE_NODE_AUTOSCALER:-false}"
|
||||
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
|
||||
# TODO: actually configure ASG or similar
|
||||
AUTOSCALER_MIN_NODES="${KUBE_AUTOSCALER_MIN_NODES:-1}"
|
||||
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-${NUM_MINIONS}}"
|
||||
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-${NUM_NODES}}"
|
||||
TARGET_NODE_UTILIZATION="${KUBE_TARGET_NODE_UTILIZATION:-0.7}"
|
||||
fi
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ ZONE=${KUBE_AWS_ZONE:-us-west-2a}
|
||||
|
||||
MASTER_SIZE=${MASTER_SIZE:-}
|
||||
NODE_SIZE=${NODE_SIZE:-}
|
||||
NUM_MINIONS=${NUM_MINIONS:-2}
|
||||
NUM_NODES=${NUM_NODES:-2}
|
||||
|
||||
# Dynamically set node sizes so that Heapster has enough space to run
|
||||
if [[ -z ${NODE_SIZE} ]]; then
|
||||
if (( ${NUM_MINIONS} < 50 )); then
|
||||
if (( ${NUM_NODES} < 50 )); then
|
||||
NODE_SIZE="t2.micro"
|
||||
elif (( ${NUM_MINIONS} < 150 )); then
|
||||
elif (( ${NUM_NODES} < 150 )); then
|
||||
NODE_SIZE="t2.small"
|
||||
else
|
||||
NODE_SIZE="t2.medium"
|
||||
@@ -34,9 +34,9 @@ fi
|
||||
# Dynamically set the master size by the number of nodes, these are guesses
|
||||
# TODO: gather some data
|
||||
if [[ -z ${MASTER_SIZE} ]]; then
|
||||
if (( ${NUM_MINIONS} < 50 )); then
|
||||
if (( ${NUM_NODES} < 50 )); then
|
||||
MASTER_SIZE="t2.micro"
|
||||
elif (( ${NUM_MINIONS} < 150 )); then
|
||||
elif (( ${NUM_NODES} < 150 )); then
|
||||
MASTER_SIZE="t2.small"
|
||||
else
|
||||
MASTER_SIZE="t2.medium"
|
||||
@@ -117,7 +117,7 @@ ENABLE_NODE_AUTOSCALER="${KUBE_ENABLE_NODE_AUTOSCALER:-false}"
|
||||
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
|
||||
# TODO: actually configure ASG or similar
|
||||
AUTOSCALER_MIN_NODES="${KUBE_AUTOSCALER_MIN_NODES:-1}"
|
||||
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-${NUM_MINIONS}}"
|
||||
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-${NUM_NODES}}"
|
||||
TARGET_NODE_UTILIZATION="${KUBE_TARGET_NODE_UTILIZATION:-0.7}"
|
||||
fi
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ export MASTER_SIZE=c4.large
|
||||
export NODE_SIZE=r3.large
|
||||
```
|
||||
|
||||
If you don't specify master and minion sizes, the scripts will attempt to guess the correct size of the master and worker nodes based on `${NUM_MINIONS}`.
|
||||
If you don't specify master and minion sizes, the scripts will attempt to guess the correct size of the master and worker nodes based on `${NUM_NODES}`.
|
||||
In particular for clusters less than 50 nodes it will
|
||||
use a `t2.micro` for clusters between 50 and 150 nodes it will use a `t2.small` and for clusters with greater than 150 nodes it will use a `t2.medium`.
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ network_provider: '$(echo "$NETWORK_PROVIDER")'
|
||||
opencontrail_tag: '$(echo "$OPENCONTRAIL_TAG")'
|
||||
opencontrail_kubernetes_tag: '$(echo "$OPENCONTRAIL_KUBERNETES_TAG")'
|
||||
opencontrail_public_subnet: '$(echo "$OPENCONTRAIL_PUBLIC_SUBNET")'
|
||||
num_nodes: $(echo "${NUM_MINIONS}")
|
||||
num_nodes: $(echo "${NUM_NODES}")
|
||||
e2e_storage_test_environment: '$(echo "$E2E_STORAGE_TEST_ENVIRONMENT" | sed -e "s/'/''/g")'
|
||||
EOF
|
||||
|
||||
|
||||
@@ -1010,8 +1010,8 @@ function start-minions() {
|
||||
${AWS_ASG_CMD} create-auto-scaling-group \
|
||||
--auto-scaling-group-name ${ASG_NAME} \
|
||||
--launch-configuration-name ${ASG_NAME} \
|
||||
--min-size ${NUM_MINIONS} \
|
||||
--max-size ${NUM_MINIONS} \
|
||||
--min-size ${NUM_NODES} \
|
||||
--max-size ${NUM_NODES} \
|
||||
--vpc-zone-identifier ${SUBNET_ID} \
|
||||
--tags ResourceId=${ASG_NAME},ResourceType=auto-scaling-group,Key=Name,Value=${NODE_INSTANCE_PREFIX} \
|
||||
ResourceId=${ASG_NAME},ResourceType=auto-scaling-group,Key=Role,Value=${NODE_TAG} \
|
||||
@@ -1022,7 +1022,7 @@ function start-minions() {
|
||||
attempt=0
|
||||
while true; do
|
||||
find-running-minions > $LOG
|
||||
if [[ ${#NODE_IDS[@]} == ${NUM_MINIONS} ]]; then
|
||||
if [[ ${#NODE_IDS[@]} == ${NUM_NODES} ]]; then
|
||||
echo -e " ${color_green}${#NODE_IDS[@]} minions started; ready${color_norm}"
|
||||
break
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user