You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/05 16:05:34 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #15204: BugFix: CLI 'kubernetes cleanup-pods' should only clean up Airflow-created Pods

kaxil commented on a change in pull request #15204:
URL: https://github.com/apache/airflow/pull/15204#discussion_r607172542



##########
File path: airflow/cli/commands/kubernetes_command.py
##########
@@ -90,7 +90,23 @@ def cleanup_pods(args):
     print('Loading Kubernetes configuration')
     kube_client = get_kube_client()
     print(f'Listing pods in namespace {namespace}')
-    list_kwargs = {"namespace": namespace, "limit": 500}
+    airflow_pod_labels = [
+        'dag_id',
+        'task_id',
+        'execution_date',
+        'try_number',
+        'airflow_version',
+    ]

Review comment:
       We should probably not look for **all** of these labels:
   
   We could probably simplify this to see if there is `kubernetes_pod_operator` or `kubernetes_executor` in the labels.
   
   Let me think a bit more on this to see if we are missing a case -- what happens if a **Celery Worker**  pod hangs around




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org