Skip to content

Commit

Permalink
Merge pull request #25734 from jszczepkowski/kac-test
Browse files Browse the repository at this point in the history
Added enforcing of setting nodes numbers for cluster autoscaler.
  • Loading branch information
fgrzadkowski committed May 20, 2016
2 parents d162711 + 858eb03 commit 2f2b7c8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cluster/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
# Optional: Create autoscaler for cluster's nodes.
ENABLE_NODE_AUTOSCALER="${KUBE_ENABLE_NODE_AUTOSCALER:-false}"
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
AUTOSCALER_MIN_NODES="${KUBE_AUTOSCALER_MIN_NODES:-1}"
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-${NUM_NODES}}"
AUTOSCALER_MIN_NODES="${KUBE_AUTOSCALER_MIN_NODES:-}"
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-}"
fi

# Admission Controllers to invoke prior to persisting objects in cluster
Expand Down
5 changes: 2 additions & 3 deletions cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
# Optional: Create autoscaler for cluster's nodes.
ENABLE_NODE_AUTOSCALER="${KUBE_ENABLE_NODE_AUTOSCALER:-false}"
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
AUTOSCALER_MIN_NODES="${KUBE_AUTOSCALER_MIN_NODES:-1}"
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-${NUM_NODES}}"
TARGET_NODE_UTILIZATION="${KUBE_TARGET_NODE_UTILIZATION:-0.7}"
AUTOSCALER_MIN_NODES="${KUBE_AUTOSCALER_MIN_NODES:-}"
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-}"
fi

# If we included ResourceQuota, we should keep it at the end of the list to prevent incremeting quota usage prematurely.
Expand Down
12 changes: 12 additions & 0 deletions cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ else
exit 1
fi

# Verfiy cluster autoscaler configuration.
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
if [ -z $AUTOSCALER_MIN_NODES ]; then
echo "AUTOSCALER_MIN_NODES not set."
exit 1
fi
if [ -z $AUTOSCALER_MAX_NODES ]; then
echo "AUTOSCALER_MAX_NODES not set."
exit 1
fi
fi

NODE_INSTANCE_PREFIX="${INSTANCE_PREFIX}-minion"

ALLOCATE_NODE_CIDRS=true
Expand Down

0 comments on commit 2f2b7c8

Please sign in to comment.