**Update**

We discussed and decide this CLI should always only clean up pods created by Airflow.

<hr>

### Description

Currently command `kubernetes cleanup-pods` cleans up Pods that meet specific conditions in a given namespace.

Underlying code: https://github.com/apache/airflow/blob/2.0.1/airflow/cli/commands/kubernetes_command.py#L70

### Use case / motivation

The problem to me is: users may have other non-Airflow stuff running in this specific namespace, and they may want to have different strategy/logic for Pod cleaning-up for these non-Airflow pods.

We may want to have an additional boolean flag for this command, like `--only-airflow-pods`, so that users can decide if they only want to clean up Airflow-created Pods.

It should not be hard to identify Airflow-created pods, given the specific labels Airflow adds to the Pods it creates (https://github.com/apache/airflow/blob/2.0.1/airflow/kubernetes/pod_generator.py#L385)




airflow/cli/commands/kubernetes_command.py
"""Generates yaml files for each task in the DAG. Used for testing output of KubernetesExecutor"""
    execution_date = args.execution_date
    dag = get_dag(subdir=args.subdir, dag_id=args.dag_id)
    yaml_output_path = args.output_path
    kube_config = KubeConfig()
    for task in dag.tasks:
        ti = TaskInstance(task, execution_date)
        pod = PodGenerator.construct_pod(
            dag_id=args.dag_id,
            task_id=ti.task_id,
            pod_id=create_pod_id(args.dag_id, ti.task_id),
            try_number=ti.try_number,
            kube_image=kube_config.kube_image,
            date=ti.execution_date,
            args=ti.command_as_list(),
            pod_override_object=PodGenerator.from_obj(ti.executor_config),
            scheduler_job_id="worker-config",
            namespace=kube_config.executor_namespace,
            base_worker_pod=PodGenerator.deserialize_model_file(kube_config.pod_template_file),
        )
        pod_mutation_hook(pod)
        api_client = ApiClient()
        date_string = pod_generator.datetime_to_label_safe_datestring(execution_date)
        yaml_file_name = f"{args.dag_id}_{ti.task_id}_{date_string}.yml"
        os.makedirs(os.path.dirname(yaml_output_path + "/airflow_yaml_output/"), exist_ok=True)