Kubernetes Executor Commands¶
Note
The CLI commands below are used from provider by Airflow 2.7.0+. Previously they were part of the core Airflow, so if you are using Airflow below 2.7.0 look at the core Airflow documentation for the list of CLI commands and parameters available.
Usage: airflow [-h] GROUP_OR_COMMAND ...
Positional Arguments¶
- GROUP_OR_COMMAND
- Possible choices: kubernetes 
Sub-commands¶
kubernetes¶
Tools to help run the KubernetesExecutor
airflow kubernetes [-h] COMMAND ...
Positional Arguments¶
- COMMAND
- Possible choices: cleanup-pods, generate-dag-yaml 
Sub-commands¶
cleanup-pods¶
Clean up Kubernetes pods (created by KubernetesExecutor/KubernetesPodOperator) in evicted/failed/succeeded/pending states
airflow kubernetes cleanup-pods [-h] [--min-pending-minutes MIN_PENDING_MINUTES] [--namespace NAMESPACE] [-v]
Named Arguments¶
- --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). - Default: - 30
- --namespace
- Kubernetes Namespace. Default value is [kubernetes] namespace in configuration. - Default: - 'default'
- -v, --verbose
- Make logging output more verbose - Default: - False
generate-dag-yaml¶
Generate YAML files for all tasks in DAG. Useful for debugging tasks without launching into a cluster
airflow kubernetes generate-dag-yaml [-h] [-B BUNDLE_NAME] [-l LOGICAL_DATE] [-o OUTPUT_PATH] [-v] dag_id
Positional Arguments¶
- dag_id
- The id of the dag 
Named Arguments¶
- -B, --bundle-name
- The name of the DAG bundle to use; may be provided more than once 
- -l, --logical-date
- The logical date of the DAG 
- -o, --output-path
- The output for generated yaml files - Default: - '[CWD]'
- -v, --verbose
- Make logging output more verbose - Default: - False