Skip to content

Commit

Permalink
Chart: set workers.safeToEvict default to False (apache#40229)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jedcunningham authored Jun 14, 2024
1 parent ca73694 commit 4c9f12d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions chart/newsfragments/40229.significant.rst
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
Expand Down
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion helm_tests/airflow_core/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ def test_should_add_component_specific_annotations(self):
@pytest.mark.parametrize(
"globalScope, localScope, precedence",
[
({}, {}, "true"),
({}, {}, "false"),
({}, {"safeToEvict": True}, "true"),
({}, {"safeToEvict": False}, "false"),
(
Expand Down

0 comments on commit 4c9f12d

Please sign in to comment.