Skip to content

Commit

Permalink
Merge pull request kubernetes#26993 from mwielgus/ca-rename
Browse files Browse the repository at this point in the history
Rename ENABLE_NODE_AUTOSCALER to ENABLE_CLUSTER_AUTOSCALER - part 1
  • Loading branch information
piosz committed Jun 8, 2016
2 parents 1d12861 + edf2190 commit d93ebd0
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions cluster/aws/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ DNS_REPLICAS=1
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
ENABLE_CLUSTER_AUTOSCALER="${KUBE_ENABLE_CLUSTER_AUTOSCALER:-false}"
if [[ "${ENABLE_CLUSTER_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_NODES}}"
Expand Down
4 changes: 2 additions & 2 deletions cluster/aws/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ DNS_REPLICAS=1
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
ENABLE_CLUSTER_AUTOSCALER="${KUBE_ENABLE_CLUSTER_AUTOSCALER:-false}"
if [[ "${ENABLE_CLUSTER_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_NODES}}"
Expand Down
4 changes: 2 additions & 2 deletions cluster/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,9 @@ RKT_PATH: $(yaml-quote ${RKT_PATH:-})
KUBERNETES_CONFIGURE_CBR0: $(yaml-quote ${KUBERNETES_CONFIGURE_CBR0:-true})
EOF
fi
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
if [[ "${ENABLE_NODE_AUTOSCALER:-}" == "true" || "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then
cat >>$file <<EOF
ENABLE_NODE_AUTOSCALER: $(yaml-quote ${ENABLE_NODE_AUTOSCALER})
ENABLE_CLUSTER_AUTOSCALER: $(yaml-quote "true")
AUTOSCALER_MIG_CONFIG: $(yaml-quote ${AUTOSCALER_MIG_CONFIG})
EOF
fi
Expand Down
5 changes: 3 additions & 2 deletions cluster/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
ENABLE_NODE_PROBLEM_DETECTOR="${KUBE_ENABLE_NODE_PROBLEM_DETECTOR:-true}"

# Optional: Create autoscaler for cluster's nodes.
ENABLE_NODE_AUTOSCALER="${KUBE_ENABLE_NODE_AUTOSCALER:-false}"
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
ENABLE_CLUSTER_AUTOSCALER="${KUBE_ENABLE_CLUSTER_AUTOSCALER:-false}"
if [[ "${KUBE_ENABLE_NODE_AUTOSCALER:-false}" == "true" || "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then
ENABLE_CLUSTER_AUTOSCALER="true"
AUTOSCALER_MIN_NODES="${KUBE_AUTOSCALER_MIN_NODES:-}"
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-}"
AUTOSCALER_ENABLE_SCALE_DOWN="${KUBE_AUTOSCALER_ENABLE_SCALE_DOWN:-true}"
Expand Down
5 changes: 3 additions & 2 deletions cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ ENABLE_CLUSTER_UI="${KUBE_ENABLE_CLUSTER_UI:-true}"
ENABLE_NODE_PROBLEM_DETECTOR="${KUBE_ENABLE_NODE_PROBLEM_DETECTOR:-true}"

# Optional: Create autoscaler for cluster's nodes.
ENABLE_NODE_AUTOSCALER="${KUBE_ENABLE_NODE_AUTOSCALER:-false}"
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
ENABLE_CLUSTER_AUTOSCALER="${KUBE_ENABLE_CLUSTER_AUTOSCALER:-false}"
if [[ "${KUBE_ENABLE_NODE_AUTOSCALER:-false}" == "true" || "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then
ENABLE_CLUSTER_AUTOSCALER="true"
AUTOSCALER_MIN_NODES="${KUBE_AUTOSCALER_MIN_NODES:-}"
AUTOSCALER_MAX_NODES="${KUBE_AUTOSCALER_MAX_NODES:-}"
AUTOSCALER_ENABLE_SCALE_DOWN="${KUBE_AUTOSCALER_ENABLE_SCALE_DOWN:-false}"
Expand Down
4 changes: 2 additions & 2 deletions cluster/gce/configure-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,9 @@ EOF
eviction_hard: '$(echo "${EVICTION_HARD}" | sed -e "s/'/''/g")'
EOF
fi
if [[ "${ENABLE_NODE_AUTOSCALER:-false}" == "true" ]]; then
if [[ "${ENABLE_CLUSTER_AUTOSCALER:-false}" == "true" ]]; then
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
enable_node_autoscaler: '$(echo "${ENABLE_NODE_AUTOSCALER}" | sed -e "s/'/''/g")'
enable_cluster_autoscaler: '$(echo "${ENABLE_CLUSTER_AUTOSCALER}" | sed -e "s/'/''/g")'
autoscaler_mig_config: '$(echo "${AUTOSCALER_MIG_CONFIG}" | sed -e "s/'/''/g")'
EOF
fi
Expand Down
2 changes: 1 addition & 1 deletion cluster/gce/gci/configure-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ function start-kube-scheduler {

# Starts cluster autoscaler.
function start-cluster-autoscaler {
if [[ "${ENABLE_NODE_AUTOSCALER:-}" == "true" ]]; then
if [[ "${ENABLE_NODE_AUTOSCALER:-}" == "true" || "${ENABLE_CLUSTER_AUTOSCALER:-}" == "true" ]]; then
echo "Start kubernetes cluster autoscaler"
prepare-log-file /var/log/cluster-autoscaler.log

Expand Down
2 changes: 1 addition & 1 deletion cluster/gce/trusty/configure-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ start_kube_scheduler() {

# Starts k8s cluster autoscaler.
start_cluster_autoscaler() {
if [ "${ENABLE_NODE_AUTOSCALER:-}" = "true" ]; then
if [ "${ENABLE_NODE_AUTOSCALER:-}" = "true" ] || [ "${ENABLE_CLUSTER_AUTOSCALER:-}" = "true" ]; then
prepare-log-file /var/log/cluster-autoscaler.log

# Remove salt comments and replace variables with values
Expand Down
6 changes: 3 additions & 3 deletions cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [[ "${OS_DISTRIBUTION}" == "gci" ]]; then
fi

# Verfiy cluster autoscaler configuration.
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
if [[ "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then
if [ -z $AUTOSCALER_MIN_NODES ]; then
echo "AUTOSCALER_MIN_NODES not set."
exit 1
Expand Down Expand Up @@ -848,12 +848,12 @@ function create-cluster-autoscaler-mig-config() {
# - NODE_INSTANCE_PREFIX
# - PROJECT
# - ZONE
# - ENABLE_NODE_AUTOSCALER
# - ENABLE_CLUSTER_AUTOSCALER
# - AUTOSCALER_MAX_NODES
# - AUTOSCALER_MIN_NODES
function create-autoscaler-config() {
# Create autoscaler for nodes configuration if requested
if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then
if [[ "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then
create-cluster-autoscaler-mig-config
echo "Using autoscaler config: ${AUTOSCALER_MIG_CONFIG}"
fi
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if pillar.get('enable_node_autoscaler', '').lower() == 'true' %}
{% if pillar.get('enable_cluster_autoscaler', '').lower() == 'true' %}
{% set cloud_config = "" -%}
{% set cloud_config_mount = "" -%}
{% set cloud_config_volume = "" -%}
Expand Down
2 changes: 1 addition & 1 deletion cluster/saltbase/salt/top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ base:
{% if pillar.get('network_provider', '').lower() == 'opencontrail' %}
- opencontrail-networking-master
{% endif %}
{% if pillar.get('enable_node_autoscaler', '').lower() == 'true' %}
{% if pillar.get('enable_cluster_autoscaler', '').lower() == 'true' %}
- cluster-autoscaler
{% endif %}

0 comments on commit d93ebd0

Please sign in to comment.