Skip to content

Conversation

@ronaldorcampos
Copy link
Contributor

When trying to run cleanup cronjob on a CeleryExecutor, the cronjob errors when trying to exec airflow kubernetes:

airflow command error: argument GROUP_OR_COMMAND: invalid choice: 'kubernetes' (choose from api-server, assets, backfill, celery, cheat-sheet, config, connections, dag-processor, dags, db, db-manager, fab-db, info, jobs, kerberos, permissions-cleanup, plugins, pools, providers, roles, rotate-fernet-key, scheduler, standalone, sync-perm, tasks, triggerer, users, variables, version), see help above.
Usage: airflow [-h] GROUP_OR_COMMAND ...
....
Options:
  -h, --help            show this help message and exit
stream closed: EOF for airflow/airflow-cleanup-29401785-bq5zs (airflow-cleanup-pods)

Once KubernetesExecutor is enabled, the error above goes away and the cronjob runs to completion.

This PR makes it so the cronjob and its respective service account become conditional on KubernetesExecutor.

Also removed the sidecar.istio.io/inject: "false" from cleanup-pods as requested in #58155 (comment)


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@ronaldorcampos
Copy link
Contributor Author

Seems we have an issue open about this #46978

@ronaldorcampos ronaldorcampos changed the title Make cleanup cronjob conditional on kubernetes executor Make cleanup-pods cronjob conditional on kubernetes executor Nov 26, 2025
@jscheffl jscheffl added this to the Airflow Helm Chart 1.19.0 milestone Nov 30, 2025
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 fix!

@jscheffl jscheffl merged commit b48c909 into apache:main Nov 30, 2025
86 checks passed
@ronaldorcampos ronaldorcampos deleted the fix/cleanup branch December 1, 2025 07:52
RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Dec 3, 2025
Copilot AI pushed a commit to jason810496/airflow that referenced this pull request Dec 5, 2025
itayweb pushed a commit to itayweb/airflow that referenced this pull request Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:helm-chart Airflow Helm Chart

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants