This is an automated email from the ASF dual-hosted git repository.

jedcunningham pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 4c9f12d2bc Chart: set `workers.safeToEvict` default to False (#40229)
4c9f12d2bc is described below

commit 4c9f12d2bce5af0c629e9b9e9916cd525817931d
Author: Jed Cunningham <66968678+jedcunning...@users.noreply.github.com>
AuthorDate: Fri Jun 14 12:36:20 2024 -0600

    Chart: set `workers.safeToEvict` default to False (#40229)
    
    This is a safer default for our workers.
    
    This can be safe to set to true if you have a long enough
    `workers.terminationGracePeriodSeconds` set, but what is
    "long enough" is very situational, so I feel its better to
    default to not evicting worker pods.
---
 chart/newsfragments/40229.significant.rst | 6 ++++++
 chart/values.schema.json                  | 2 +-
 chart/values.yaml                         | 2 +-
 helm_tests/airflow_core/test_worker.py    | 2 +-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/chart/newsfragments/40229.significant.rst 
b/chart/newsfragments/40229.significant.rst
new file mode 100644
index 0000000000..56187f3f60
--- /dev/null
+++ b/chart/newsfragments/40229.significant.rst
@@ -0,0 +1,6 @@
+``workers.safeToEvict`` default changed to False
+
+The default for ``workers.safeToEvict`` now defaults to False. This is a safer 
default
+as it prevents the nodes workers are running on from being scaled down by the
+[K8s Cluster 
Autoscaler](https://kubernetes.io/docs/concepts/cluster-administration/cluster-autoscaling/#cluster-autoscaler).
+If you would like to retain the previous behavior, you can set this config to 
True.
diff --git a/chart/values.schema.json b/chart/values.schema.json
index c2abb29441..7ee05eecfc 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -1864,7 +1864,7 @@
                 "safeToEvict": {
                     "description": "This setting tells Kubernetes that it's ok 
to evict when it wants to scale a node down.",
                     "type": "boolean",
-                    "default": true
+                    "default": false
                 },
                 "extraContainers": {
                     "description": "Launch additional containers into workers 
(templated). Note, if used with KubernetesExecutor, you are responsible for 
signaling sidecars to exit when the main container finishes so Airflow can 
continue the worker shutdown process!",
diff --git a/chart/values.yaml b/chart/values.yaml
index 333fa44d4d..f8b03a5ef6 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -676,7 +676,7 @@ workers:
 
   # This setting tells kubernetes that its ok to evict
   # when it wants to scale a node down.
-  safeToEvict: true
+  safeToEvict: false
 
   # Launch additional containers into worker (templated).
   # Note: If used with KubernetesExecutor, you are responsible for signaling 
sidecars to exit when the main
diff --git a/helm_tests/airflow_core/test_worker.py 
b/helm_tests/airflow_core/test_worker.py
index af370f3d9a..1fcc88caa6 100644
--- a/helm_tests/airflow_core/test_worker.py
+++ b/helm_tests/airflow_core/test_worker.py
@@ -755,7 +755,7 @@ class TestWorker:
     @pytest.mark.parametrize(
         "globalScope, localScope, precedence",
         [
-            ({}, {}, "true"),
+            ({}, {}, "false"),
             ({}, {"safeToEvict": True}, "true"),
             ({}, {"safeToEvict": False}, "false"),
             (

Reply via email to