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

workflow-level PodSpecPatch is not applied to agent pod #12387

Closed
3 tasks done
jswxstw opened this issue Dec 19, 2023 · 1 comment · Fixed by #12440
Closed
3 tasks done

workflow-level PodSpecPatch is not applied to agent pod #12387

jswxstw opened this issue Dec 19, 2023 · 1 comment · Fixed by #12440
Labels
area/controller Controller issues, panics area/spec Changes to the workflow specification. area/templates/http P3 Low priority type/bug

Comments

@jswxstw
Copy link
Member

jswxstw commented Dec 19, 2023

Pre-requisites

  • I have double-checked my configuration
  • I can confirm the issues exists when I tested with :latest
  • I'd like to contribute the fix myself (see contributing guide)

What happened/what did you expect to happen?

As shown in the following workflow demo, we set a workflow-level podSpecPatch to schedule the pod directly to the node named virtual-node.
However, HTTP Tempalte will create a agent pod and podSpecPatch was not applied to it.

Version

latest

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: http-template-
  labels:
    workflows.argoproj.io/test: "true"
  annotations:
    workflows.argoproj.io/description: |
      Http template will demostrate http template functionality
    workflows.argoproj.io/version: '>= 3.2.0'
spec:
  podSpecPatch: |
    nodeName: virtual-node
  entrypoint: main
  templates:
    - name: main
      steps:
        - - name: good
            template: http
            arguments:
              parameters: [{name: url, value: "https://raw.githubusercontent.com/argoproj/argo-workflows/4e450e250168e6b4d51a126b784e90b11a0162bc/pkg/apis/workflow/v1alpha1/generated.swagger.json"}]
  
    - name: http
      inputs:
        parameters:
          - name: url
      http:
       # url: http:https://dummy.restapiexample.com/api/v1/employees
       url: "{{inputs.parameters.url}}"

Logs from the workflow controller

kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

Logs from in your workflow's wait container

kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded
@jswxstw
Copy link
Member Author

jswxstw commented Dec 20, 2023

The agent pod need to apply workflow level PodSpecPatch like the workflow pod does.

        # workflow/controller/agent.go
	if woc.execWf.Spec.HasPodSpecPatch() {
		patchedPodSpec, err := util.ApplyPodSpecPatch(pod.Spec, woc.execWf.Spec.PodSpecPatch)
		if err != nil {
			return nil, errors.Wrap(err, "", "Error applying PodSpecPatch")
		}
		pod.Spec = *patchedPodSpec
	}

@jswxstw jswxstw changed the title workflow-level PodSpecPatch is not vaild for agent pod workflow-level PodSpecPatch is not applied to agent pod Dec 20, 2023
jswxstw added a commit to jswxstw/argo-workflows that referenced this issue Jan 2, 2024
jswxstw added a commit to jswxstw/argo-workflows that referenced this issue Jan 2, 2024
jswxstw added a commit to jswxstw/argo-workflows that referenced this issue Jan 3, 2024
jswxstw added a commit to jswxstw/argo-workflows that referenced this issue Jan 3, 2024
terrytangyuan pushed a commit that referenced this issue Jan 3, 2024
hittingray pushed a commit to atlassian-forks/argo-workflows that referenced this issue Jan 4, 2024
hittingray pushed a commit to atlassian-forks/argo-workflows that referenced this issue Jan 4, 2024
sarabala1979 pushed a commit that referenced this issue Jan 9, 2024
@agilgur5 agilgur5 added area/controller Controller issues, panics area/spec Changes to the workflow specification. area/templates/http P3 Low priority labels Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Controller issues, panics area/spec Changes to the workflow specification. area/templates/http P3 Low priority type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants