Skip to content

Conversation

@dan-osterrath
Copy link
Contributor


This PR adds support to the Airflow Helm chart for disabling the service account token automounting into the Airflow Scheduler pods. This might be restricted by cluster policies for security reasons and best practices. When automounting is disabled and the executor is a Pod launching executor (CeleryExecutor, CeleryKubernetesExecutor, KubernetesExecutor or LocalKubernetesExecutor), the service account token is mounted manually into the Schedulers container. You can configure some token parameters like volume name, mount path, token audience and TTL. By default the service account token is still mounted automatically to keep backward compatibility. There are sensible defaults for the token parameters to keep backward compatibility.

closes: #59099
related: #30722 #43464

@boring-cyborg
Copy link

boring-cyborg bot commented Dec 7, 2025

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@dano-nx dano-nx force-pushed the bugfix/59099-disable-sa-automount-for-scheduler branch from 0d419b6 to 1c63149 Compare December 7, 2025 23:15
@dan-osterrath dan-osterrath marked this pull request as ready for review December 8, 2025 08:36
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and the extensive documentation added. Not many PRs make such a good and proper documentation alongside the functional contribution!

Two pieces are too verbose, can you adjust these? Then in my view it is okay to be merged.

…n page and created newsfragment 59156.significant.rst to properly document these changes in the changelog as suggested. (apache#59099)
…edicated service-account-token-examples.rst document for comprehensive configuration examples and use cases. (apache#59099)
…n page and created newsfragment 59156.significant.rst to properly document these changes in the changelog as suggested. (apache#59099)
…edicated service-account-token-examples.rst document for comprehensive configuration examples and use cases. (apache#59099)
@jscheffl jscheffl force-pushed the bugfix/59099-disable-sa-automount-for-scheduler branch from 4ed219a to d5f5e41 Compare December 9, 2025 22:02
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me now! Let's make CI green and then LGTM!

@jscheffl
Copy link
Contributor

jscheffl commented Dec 9, 2025

Ups, some nit in RST formatting - can you fix?

@jscheffl jscheffl added this to the Airflow Helm Chart 1.19.0 milestone Dec 10, 2025
@dan-osterrath
Copy link
Contributor Author

Looks good for me now! Let's make CI green and then LGTM!

Is there any way to make these flaky tests green? Can I retrigger them on my own somehow?

downloading uv 0.9.16 x86_64-unknown-linux-gnu
curl: (22) The requested URL returned error: 504
failed to download https://github.com/astral-sh/uv/releases/download/0.9.16/uv-x86_64-unknown-linux-gnu.tar.gz
this may be a standard network error, but it may also indicate
that uv's release process is not working. When in doubt
please feel free to open an issue!

@potiuk
Copy link
Member

potiuk commented Dec 13, 2025

Is there any way to make these flaky tests green? Can I retrigger them on my own somehow?

Yes. Rebase your PR or close/reopen it - the problem was with GitHub having hiccups - so those were not flaky tests - those were tests that did not run because GitHub infrastructure had problems.

@jscheffl jscheffl merged commit 900e692 into apache:main Dec 14, 2025
237 of 239 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Dec 14, 2025

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@dan-osterrath dan-osterrath deleted the bugfix/59099-disable-sa-automount-for-scheduler branch December 15, 2025 07:14
TempestShaw pushed a commit to TempestShaw/airflow that referenced this pull request Dec 24, 2025
)

* Add support for manual mounting of Service Account tokens in Scheduler when using Pod launching executors (apache#59099)

* fix bug in helper function for determining if executor is Pod launching (apache#59099)

* Remove emojis in production guide (apache#59099)

* Auto formatting by prek and some manual cleanup (apache#59099)

* Removed the detailed security enhancements from the main documentation page and created newsfragment 59156.significant.rst to properly document these changes in the changelog as suggested.  (apache#59099)

* Reduced redundancy by removing detailed examples and linking to the dedicated service-account-token-examples.rst document for comprehensive configuration examples and use cases. (apache#59099)

* Add support for manual mounting of Service Account tokens in Scheduler when using Pod launching executors (apache#59099)

* fix bug in helper function for determining if executor is Pod launching (apache#59099)

* Remove emojis in production guide (apache#59099)

* Auto formatting by prek and some manual cleanup (apache#59099)

* Removed the detailed security enhancements from the main documentation page and created newsfragment 59156.significant.rst to properly document these changes in the changelog as suggested.  (apache#59099)

* Reduced redundancy by removing detailed examples and linking to the dedicated service-account-token-examples.rst document for comprehensive configuration examples and use cases. (apache#59099)

* Fix title underlines in SA token examples RST file. (apache#59099)

* Fix spell checks and removed wrong Helm values schema spec for Worker. (apache#59099)

* Minor fix in descriptions. (apache#59099)

---------

Co-authored-by: Dan Osterrath <9108541+dan-osterrath@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable automountServiceAccountToken for Kubernetes executor

3 participants