argo-workflows: ClusterWorkflowTemplate podMetadata are ignored with `workflowTemplateRef `
Summary
I expected that creating a Workflow from a ClusterWorkflowTemplate, the resulting pods would inherit labels from podMetadata
.
Those labels are mainly used to match specific NetworkPolicies granting access to internet and other services.
Argo Workflows version: 3.1.3
Diagnostics
Either a workflow that reproduces the bug, or paste you whole workflow YAML, including status, something like:
apiVersion: argoproj.io/v1alpha1
kind: ClusterWorkflowTemplate
metadata:
name: go-pipeline
spec:
serviceAccountName: cicd-pipeline
activeDeadlineSeconds: 3600
ttlStrategy:
secondsAfterCompletion: 604800
podMetadata:
labels:
domain: ci
component: ci-executor-pod
provider: http
...
Kubernetes provider: GKE
executor: PNS
# Logs from the workflow controller:
kubectl logs -n argo deploy/workflow-controller | grep go-pipeline-***
time="2021-10-28T16:17:01.700Z" level=info msg="Processing workflow" namespace=cicd-pipelines workflow=go-pipeline-59vhk
time="2021-10-28T16:17:01.737Z" level=info msg="Updated phase -> Running" namespace=cicd-pipelines workflow=go-pipeline-59vhk
time="2021-10-28T16:17:01.737Z" level=info msg="Creating pvc go-pipeline-59vhk-workdir" namespace=cicd-pipelines workflow=go-pipeline-59vhk
time="2021-10-28T16:17:01.746Z" level=info msg="DAG node go-pipeline-59vhk initialized Running" namespace=cicd-pipelines workflow=go-pipeline-59vhk
time="2021-10-28T16:17:01.747Z" level=info msg="All of node go-pipeline-59vhk.clone-code dependencies [] completed" namespace=cicd-pipelines workflow=go-pipeline-59vhk
time="2021-10-28T16:17:01.747Z" level=info msg="Pod node go-pipeline-59vhk-2560901167 initialized Pending" namespace=cicd-pipelines workflow=go-pipeline-59vhk
time="2021-10-28T16:17:01.781Z" level=info msg="Created pod: go-pipeline-59vhk.clone-code (go-pipeline-59vhk-2560901167)" namespace=cicd-pipelines workflow=go-pipeline-59vhk
time="2021-10-28T16:17:01.860Z" level=info msg="Workflow update successful" namespace=cicd-pipelines phase=Running resourceVersion=91309602 workflow=go-pipeline-59vhk
time="2021-10-28T16:18:01.778Z" level=info msg="Processing workflow" namespace=cicd-pipelines workflow=go-pipeline-59vhk
time="2021-10-28T16:18:01.779Z" level=info msg="Updating node go-pipeline-59vhk-2560901167 status Pending -> Running" namespace=cicd-pipelines workflow=go-pipeline-59vhk
time="2021-10-28T16:18:01.795Z" level=info msg="Workflow update successful" namespace=cicd-pipelines phase=Running resourceVersion=91310073 workflow=go-pipeline-59vhk
kubectl get pods --show-labels
NAME READY STATUS RESTARTS AGE LABELS
go-pipeline-59vhk-2641655615 0/2 Pending 0 4s workflows.argoproj.io/completed=false,workflows.argoproj.io/workflow=go-pipeline-59vhk
Impacted by this bug? Give it a š. We prioritise the issues with the most š.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 27 (10 by maintainers)
@sarabala1979 I have the same issue with
WorkflowTemplate
using the latest versionv3.2.3
, I created aworkflowTemplate
with labels inpodMetadata
, this labels should be applied to the workflow pod. But they were ignored.Diagnostics
Here is a
WorkflowTemplate
and aWorkflow
to reproduce the bug.What Kubernetes provider are you using? Iām running Argo on a Gke cluster with following version of k8s :
Kubernetes v1.21.5
What executor are you running?
Emissary
I was expecting the following labels to be added to the pod labels