jedcunningham opened a new issue, #46978:
URL: https://github.com/apache/airflow/issues/46978
### Apache Airflow version
main (development)
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
Currently, the k8s cleanup command is directly tied to the
KubernetesExecutor, but the command is helpful for and documented to be used
for KubernetesPodOperator users as well.
### What you think should happen instead?
The command should work regardless of executor choice, if you have the
kubernetes provider installed.
### How to reproduce
With LocalExecutor:
```
$ AIRFLOW__CORE__EXECUTOR=LocalExecutor airflow kubernetes cleanup-pods
--help
Usage: airflow [-h] GROUP_OR_COMMAND ...
...
airflow command error: argument GROUP_OR_COMMAND: invalid choice:
'kubernetes' (choose from 'assets', 'backfill', 'cheat-sheet', 'config',
'connections', 'd
ag-processor', 'dags', 'db', 'fab-db', 'fastapi-api', 'info', 'jobs',
'kerberos', 'plugins', 'pools', 'providers', 'roles', 'rotate-fernet-key',
'scheduler'
, 'standalone', 'sync-perm', 'tasks', 'triggerer', 'users', 'variables',
'version', 'webserver'), see help above.
```
With KubernetesExecutor:
```
$ AIRFLOW__CORE__EXECUTOR=KubernetesExecutor airflow kubernetes cleanup-pods
--help
Usage: airflow kubernetes cleanup-pods [-h] [--min-pending-minutes
MIN_PENDING_MINUTES] [--namespace NAMESPACE] [-v]
Clean up Kubernetes pods (created by
KubernetesExecutor/KubernetesPodOperator) in evicted/failed/succeeded/pending
states
Options:
-h, --help show this help message and exit
--min-pending-minutes MIN_PENDING_MINUTES
Pending pods created before the time interval are to
be cleaned up, measured in minutes. Default value is 30(m). The minimum value
is 5(m).
--namespace NAMESPACE
Kubernetes Namespace. Default value is ` namespace`
in configuration.
-v, --verbose Make logging output more verbose
```
### Operating System
macos
### Versions of Apache Airflow Providers
_No response_
### Deployment
Virtualenv installation
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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]