diegoalvarez-clarity opened a new pull request, #70180:
URL: https://github.com/apache/airflow/pull/70180
## Why
The chart mounts `airflow.cfg` (and `airflow_local_settings.py`) into every
component and the KubernetesExecutor pod template via a `subPath` bind-mount of
the `config` ConfigMap. `subPath` + ConfigMap hits a known Kubernetes race: on
node/volume lifecycle events (kubelet volume reconstruction, node autoscaling)
the pre-computed subPath source inode goes stale and runc fails the mount at
container init:
error during container init: error mounting
".../volume-subpaths/config/base/1" to rootfs at
"/opt/airflow/airflow.cfg"
The task fails with `StartError` and no application log (the container never
starts). It's intermittent, cross-component, multi-node, and
runtime-version-independent. See #33788.
## What
Add an opt-in `mountConfigAsDir` (default `false`; existing behaviour
unchanged). When `true`, the `config` ConfigMap is mounted as a directory at
`{airflowHome}/config` (no subPath) and `AIRFLOW_CONFIG` is set to
`{airflowHome}/config/airflow.cfg`. A directory-projected ConfigMap volume has
no pre-computed subPath bind source, so it's immune to the race.
`airflow_local_settings.py` keeps its default path, so local-settings loading
is unaffected. The separate `pod_template_file.yaml` subPath mount is out of
scope.
## Tests
- `test_mount_config_as_dir` — flag on: directory mount, no
cfg/local-settings subPath, `AIRFLOW_CONFIG` set, across all components.
- `test_config_mounted_via_subpath_by_default` — default behaviour preserved.
## Notes
Backward compatible (default off).
This PR was created with the assistance of generative AI tools.
Refs: #33788
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]