Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dependent on #719; can be reviewed before merging that.
Which problem is this PR solving?
In v1, Refinery allowed setting a
MaxAlloc
value that controlled the maximum amount of memory it would try to use. This is hard to keep configured properly, because the guidance is to set it to some fraction of the memory allocated to the pod. This PR implements two new values:AvailableMemory
MaxMemory
The existing
MaxAlloc
value is still supported. If the first two are nonzero, they are multiplied to get the maximum allocation; otherwise,MaxAlloc
is used. As in v1, if all of them are 0, refinery doesn't attempt to limit its own use.I spent a while trying to find a way to allow the app to read the max allocation from the system, but it's pretty platform-dependent. It seemed better to just make it so that the value can be put into the environment in the Helm chart.
Short description of the changes
AvailableMemory
and make it settable in the environment and on the command line