Is it possible to pass resources limits and requests on initContainers?
prachiwaghulkar opened this issue · comments
Is there a way to pass resource limits and request on all initContainers that are being created? Tried passing through spec.templates.spec.initContainers.resources but seems to not work since the initContainers didn't catch the data.
Expected behaviour:
We should be able to pass resource limits and requests to initContainers.
initContainers:
- command:
- cp
- version-upgrade-hook
- /hooks/version-upgrade
name: mongod-posthook
resources:
requests:
cpu: ..
memory: ..
limits:
cpu: ..
memory: ..
- command:
- cp
- /probes/readinessprobe
- /opt/scripts/readinessprobe
name: mongodb-agent-readinessprobe
resources:
requests:
cpu: ..
memory: ..
limits:
cpu: ..
memory: ..
Hi @prachiwaghulkar,
Thank you for reporting this issue
We don't see this as a priority, but we welcome any contributions
We may reconsider our plans if we find that this feature is often requested
Hey @prachiwaghulkar
Yes - it is possible to override the resource requirements for init containers. You'll need to make sure you specify the correct name of the init-container
in the override. We have added a sample here: https://github.com/mongodb/mongodb-kubernetes-operator/blob/master/config/samples/mongodb.com_v1_mongodbcommunity_specify_pod_resources.yaml .
Could you please double-check the sample and apply the CR and re-open the issue if it still persists(do attach the CR yaml you're applying).
Thanks