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

Changes to include the resources limits and requests #155

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

mandarbhosle
Copy link

Hello,
This in in regards with issue #147 Query about resource limits and requests

I have updated the confimap.yaml and main.py to pick the resource limits and requests from the values.yaml

Request to you to review.

Copy link
Owner

@hardbyte hardbyte left a comment

Choose a reason for hiding this comment

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

Looking good, just need to make sure we keep working for the case where probe resources are not provided too.

Comment on lines 15 to 24
"resources": {
"limits": {
"cpu":{{ .Values.probeConfig.resources.limits.cpu | quote }},
"memory":{{ .Values.probeConfig.resources.limits.memory | quote }}
},
"requests": {
"cpu":{{ .Values.probeConfig.resources.requests.cpu | quote }},
"memory":{{ .Values.probeConfig.resources.requests.memory | quote }}
}
},
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
"resources": {
"limits": {
"cpu":{{ .Values.probeConfig.resources.limits.cpu | quote }},
"memory":{{ .Values.probeConfig.resources.limits.memory | quote }}
},
"requests": {
"cpu":{{ .Values.probeConfig.resources.requests.cpu | quote }},
"memory":{{ .Values.probeConfig.resources.requests.memory | quote }}
}
},
"resources": {{ .Values.probeConfig.resources | toJson }}

@@ -693,6 +694,7 @@ def create_job_spec(
image_pull_policy=settings.probe.image.pullPolicy,
command=command,
volume_mounts=volume_mounts,
resources=client.V1ResourceRequirements(limits=settings.probe.resources["limits"],requests=settings.probe.resources["requests"]),
Copy link
Owner

Choose a reason for hiding this comment

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

This needs to work for the case where there are no resources defined.

Probably cleaner to create the V1ResourceRequirements instance above, then pass in to the V1Container

@mandarbhosle
Copy link
Author

Hello,

Updated the code further to include resource quotas, node affinity

Regards,
Mandar Bhosle

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.

2 participants