Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jhasm
Copy link

@jhasm jhasm commented Oct 31, 2023

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. ClusterWorkflowTemplate podMetadata are ignored with workflowTemplateRef  argoproj/argo-workflows#7091
  2. Pods created by Argo Workflows don't have the desired labels defined by the podMetadata field argoproj/argo-workflows#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.

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. argoproj/argo-workflows#7091
2. argoproj/argo-workflows#7013

Particularly, this [comment](argoproj/argo-workflows#7091 (comment))
is helpful in demystifying some confusion of the argo terminology

Signed-off-by: jhasm <[email protected]>
@saikonen
Copy link
Collaborator

saikonen commented Nov 1, 2023

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

@jhasm
Copy link
Author

jhasm commented Nov 1, 2023

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
Copy link
Author

jhasm commented Nov 14, 2023

@saikonen any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants