dakov commented on a change in pull request #6377:
URL: https://github.com/apache/airflow/pull/6377#discussion_r459647644



##########
File path: airflow/contrib/operators/kubernetes_pod_operator.py
##########
@@ -112,55 +113,54 @@ class KubernetesPodOperator(BaseOperator):  # pylint: 
disable=too-many-instance-
     """
     template_fields = ('cmds', 'arguments', 'env_vars', 'config_file')
 
+    @staticmethod
+    def create_labels_for_pod(context):
+        """
+        Generate labels for the pod s.t. we can track it in case of Operator 
crash
+        :param context:
+        :return:
+        """
+        labels = {
+            'dag_id': context['dag'].dag_id,
+            'task_id': context['task'].task_id,
+            'exec_date': context['ts']

Review comment:
       On our k8s cluster, we keep pods in the namespace for some time no 
matter the state they finished in (success, OOMKilled, evicted,....) -- I do 
not maintain the cluster and the decision is not up to me. Not having 
`try_number` as an identifying label of a pod makes airflow fail to launch 
another attempt. 




----------------------------------------------------------------
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:
[email protected]


Reply via email to