From f2511051643bbbdbfcfe26c4d9b009903dc8f5de Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Thu, 27 Jul 2023 16:32:36 -0300 Subject: [PATCH] 20610: Allows disabling backend controllers for rolling updates. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- .../multi_host/aws/pillars/nginx_balancer_configuration.sls | 5 +++++ tools/salt-install/local.params.example.multiple_hosts | 1 + tools/salt-install/provision.sh | 2 ++ 3 files changed, 8 insertions(+) diff --git a/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_balancer_configuration.sls b/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_balancer_configuration.sls index 92ad3af2e8..73ae9ca309 100644 --- a/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_balancer_configuration.sls +++ b/tools/salt-install/config_examples/multi_host/aws/pillars/nginx_balancer_configuration.sls @@ -6,6 +6,7 @@ {%- import_yaml "ssl_key_encrypted.sls" as ssl_key_encrypted_pillar %} {%- set domain = "__DOMAIN__" %} {%- set balancer_backends = "__CONTROLLER_NODES__".split(",") %} +{%- set disabled_controller = "__DISABLED_CONTROLLER__" %} ### NGINX nginx: @@ -20,7 +21,11 @@ nginx: '__CLUSTER_INT_CIDR__': 0 upstream controller_upstream: {%- for backend in balancer_backends %} + {%- if disabled_controller == "" or not backend.startswith(disabled_controller) %} 'server {{ backend }}:80': '' + {%- else %} + 'server {{ backend }}:80 down': '' + {% endif %} {%- endfor %} ### SNIPPETS diff --git a/tools/salt-install/local.params.example.multiple_hosts b/tools/salt-install/local.params.example.multiple_hosts index 4234a965d5..b70ad747a9 100644 --- a/tools/salt-install/local.params.example.multiple_hosts +++ b/tools/salt-install/local.params.example.multiple_hosts @@ -165,6 +165,7 @@ SHELL_INT_IP=10.1.2.17 # Load balancing settings ENABLE_BALANCER="no" +DISABLED_CONTROLLER="" # Performance tuning parameters #CONTROLLER_NGINX_WORKERS= diff --git a/tools/salt-install/provision.sh b/tools/salt-install/provision.sh index 610134cf39..09edaa05ff 100755 --- a/tools/salt-install/provision.sh +++ b/tools/salt-install/provision.sh @@ -466,6 +466,7 @@ for f in $(ls "${SOURCE_PILLARS_DIR}"/*); do s#__MONITORING_PASSWORD__#${MONITORING_PASSWORD}#g; s#__DISPATCHER_SSH_PRIVKEY__#${DISPATCHER_SSH_PRIVKEY//$'\n'/\\n}#g; s#__ENABLE_BALANCER__#${ENABLE_BALANCER}#g; + s#__DISABLED_CONTROLLER__#${DISABLED_CONTROLLER}#g; s#__BALANCER_NODENAME__#${ROLES['balancer']}#g; s#__PROMETHEUS_NODENAME__#${ROLES['monitoring']}#g; s#__CONTROLLER_NODES__#${ROLES['controller']}#g; @@ -559,6 +560,7 @@ if [ -d "${SOURCE_STATES_DIR}" ]; then s#__MONITORING_PASSWORD__#${MONITORING_PASSWORD}#g; s#__DISPATCHER_SSH_PRIVKEY__#${DISPATCHER_SSH_PRIVKEY//$'\n'/\\n}#g; s#__ENABLE_BALANCER__#${ENABLE_BALANCER}#g; + s#__DISABLED_CONTROLLER__#${DISABLED_CONTROLLER}#g; s#__BALANCER_NODENAME__#${ROLES['balancer']}#g; s#__PROMETHEUS_NODENAME__#${ROLES['monitoring']}#g; s#__CONTROLLER_NODES__#${ROLES['controller']}#g; -- 2.30.2