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

Add resource requirements to sidecar agent #401

Merged
merged 1 commit into from
May 9, 2019
Merged

Add resource requirements to sidecar agent #401

merged 1 commit into from
May 9, 2019

Conversation

objectiser
Copy link
Contributor

@objectiser objectiser commented May 8, 2019

Related to #169

Adds resource requirements to the agent sidecar.

Signed-off-by: Gary Brown [email protected]

@objectiser objectiser requested a review from pavolloffay May 8, 2019 15:55
@objectiser
Copy link
Contributor Author

It doesn't answer the issue raised in #70 related to how to define resource requirements if using both daemonset and sidecar agents, but addresses the more immediate issue of not being able to define resource limits for sidecar agents, when only that approach is being used.

So currently the resource limits defined against the agent will be used for both daemonset and sidecar agents.

@codecov
Copy link

codecov bot commented May 8, 2019

Codecov Report

Merging #401 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #401      +/-   ##
==========================================
+ Coverage   89.71%   89.72%   +<.01%     
==========================================
  Files          64       64              
  Lines        3092     3094       +2     
==========================================
+ Hits         2774     2776       +2     
  Misses        216      216              
  Partials      102      102
Impacted Files Coverage Δ
pkg/inject/sidecar.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97350c6...0d0329b. Read the comment docs.

@pavolloffay
Copy link
Member

Shouldn't we have more fine-grained control over agent sidecar resources? There is already a PR which sets the resources based on annotations #169.

I think this could go in as default global setting and be able to override it via annotations.

@@ -104,6 +104,8 @@ func container(jaeger *v1.Jaeger) corev1.Container {
jgCompactTrft := util.GetPort("--processor.jaeger-compact.server-host-port=", args, 6831)
jgBinaryTrft := util.GetPort("--processor.jaeger-binary.server-host-port=", args, 6832)

commonSpec := util.Merge([]v1.JaegerCommonSpec{jaeger.Spec.Agent.JaegerCommonSpec, jaeger.Spec.JaegerCommonSpec})
Copy link
Member

Choose a reason for hiding this comment

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

What does this do? Why isn't it enough to use just Spec.Agent.Resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It allows common resource requirements to be defined in jaeger.Spec.Resources and only agent specific requirements defined in jaeger.Spec.Agent.Resources. Its a pattern used for all parts of the common spec (e.g. volumnes, mounts, annotations, etc).

Copy link
Member

Choose a reason for hiding this comment

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

So if no agent resources are specified would it use ones from jaeger.Spec.Resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It has been done from a consistency perspective - but if is not reasonable, then we just need to make sure it is documented clearly that for agent as a sidecar (or agent in general), the parent resources are not inherited.

Copy link
Member

Choose a reason for hiding this comment

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

I would maybe prefer applying only resources on the agent spec as sidecar can populate to a lot of pods but I don't have strong objections.

@objectiser
Copy link
Contributor Author

@pavolloffay I've removed the closes 169, so that will now remain open, so that it can be added on top of this PR to provide annotation based approach aswell.

@objectiser
Copy link
Contributor Author

@pavolloffay I'll keep like this for now, just for consistency. Most people will probably just set the requirements on the Agent itself - so if we decide to change later it probably won't have a big impact.

@jpkrohling When you get a chance, would be good to get your thoughts on this.

@objectiser objectiser merged commit a7bd08e into jaegertracing:master May 9, 2019
@objectiser objectiser deleted the sidecarres branch May 9, 2019 09:06
@pavolloffay pavolloffay added the enhancement New feature or request label May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants