Skip to content

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 }}

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