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

feat(controller): Allow to configure main container resources #4656

Merged
merged 6 commits into from Dec 9, 2020
Merged

feat(controller): Allow to configure main container resources #4656

merged 6 commits into from Dec 9, 2020

Conversation

terrytangyuan
Copy link
Member

@terrytangyuan terrytangyuan commented Dec 7, 2020

Some clusters require explicit resources in all containers. This would allow us to configure the resources for the main container.

Signed-off-by: terrytangyuan terrytangyuan@gmail.com

Checklist:

@alexec
Copy link
Contributor

alexec commented Dec 7, 2020

podSpecPatch?

@terrytangyuan
Copy link
Member Author

Thanks for the suggestion. It's definitely an option. However, podSpecPatch requires all of our existing users to modify their workflow spec which is not trivial (especially when we have long-running workflows and established usage patterns). Configuring this in the config of controller seems to be a better option for now.

@@ -151,6 +151,9 @@ func (woc *wfOperationCtx) createWorkflowPod(nodeName string, mainCtr apiv1.Cont
wfSpec := woc.execWf.Spec.DeepCopy()

mainCtr.Name = common.MainContainerName
if isResourcesSpecified(woc.controller.Config.MainContainer) {
mainCtr.Resources = woc.controller.Config.MainContainer.Resources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The workflow spec should take priority over the config.
  2. Test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. Just updated the PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can ignore podSpePatch, but you should check tmpl.Container

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify why we need to check tmpl.Container? The goal of this PR is to customize main container no matter what's in the template (similar to what's currently done for executor).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that would be contrary to how we do it for other item - the user should be able to override a global setting like this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually another goal of this PR is to set reasonable default resources for the main container.

I've added a check on tmpl.Container. Let me know if I've missed anything here.

@alexec alexec self-assigned this Dec 7, 2020
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
@alexec alexec merged commit b1e2c20 into argoproj:master Dec 9, 2020
@alexec alexec added this to the v3.0 milestone Dec 9, 2020
@terrytangyuan terrytangyuan deleted the main-ctr-resources-config branch December 9, 2020 01:24
@simster7 simster7 mentioned this pull request Dec 17, 2020
9 tasks
simster7 pushed a commit that referenced this pull request Dec 17, 2020
Signed-off-by: terrytangyuan <terrytangyuan@gmail.com>
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