metaflow icon indicating copy to clipboard operation
metaflow copied to clipboard

[argo] Add k8s labels to tempalte.metadata instead of spec.podMetadata

Open jhasm opened this issue 2 years ago • 3 comments

Summary

Argo does not propagate the spec.podLabels to the pods. Only the sections under templates from the WorkflowTemplate are propagated to the Workflow and the pods. Their docs are misleading.

Here are related argo issues,

  1. https://github.com/argoproj/argo-workflows/issues/7091
  2. https://github.com/argoproj/argo-workflows/issues/7013

Particularly, this comment is helpful in demystifying some confusion of the argo terminology

Testing

I tested against my argo installation. I did not see my custom labels before the change and I saw the labels applied after the change. I used METAFLOW_KUBERNETES_LABELS property in the ~/.metaflowconfig/config.json file.

jhasm avatar Oct 31 '23 23:10 jhasm

Took this for a quick spin but I have a few questions just so I understand the situation correctly. Tried with something along the lines of

METAFLOW_KUBERNETES_LABELS="customlabelA=testA,customlabelB=123" python test.py argo-workflows create
python test.py argo-workflows trigger

then grabbing the Kubernetes pod name for f.ex. the start task and running kubectl describe pod -n metaflow-ns start-task-pod-name. For my case the pod has both of the custom labels. Is this the case that was not working for you?

Which version of Argo Workflows are you running on? I noticed that there was mention of this behavior being a bug in v3.1.3

saikonen avatar Nov 01 '23 22:11 saikonen

Yeah, I did not see the custom labels in my case. Our argo version is 3.0.7. I know this is kind of old, but adding the labels under template metadata makes it work for all argo version.

jhasm avatar Nov 01 '23 23:11 jhasm

@saikonen any thoughts?

jhasm avatar Nov 14 '23 22:11 jhasm