Closed fmcwalters-edited closed 2 years ago
@fmcwalters-edited what's the philosophy here - should we be proactively setting limits in all projects, or only ones where we run into issues?
@seangarner this is a reactive change required for Skuscraper as we had a few crawlers that would end up hogging RAM. I made resources
a non-required variable as I didn't want to have to retroactively enforce this for every single project.
Going forward it would be nice to have limits set on containers in projects, this enables us to do that; however it's beyond the scope of this PR to enforce this and I don't feel comfortable unilaterally forcing architectural changes on every single project that uses Kubetools and containers.
Thanks for the clarification @fmcwalters-edited.
It's made me think about the perspective of smart-proxy, given it's a node project and handles memory differently to python. If you're curious, I've asked the question specific to smart-proxy over in slack.
@seangarner in an ideal world every single project would have limits on it. Resource limits have a number of applications, but our two biggest benefits are:
Point 1) is useful regardless of how many projects we apply limits to, point 2) is only useful if every deployment in the cluster has limits.
@gchazot the use case isn't within another kubetools function, but when we import the package in other services such as here
The idea being we can import kubetools inside another python service, this function will generate a kuberetes config using an input kubetools file and then call k8s directly to create the job with desired resources attached.
@fmcwalters-edited tests are failing as we're passing 'resources': None}
in (as no resources are specified in the test config file). We need to confirm k8s will accept 'resources': None
, if so then we need to update the test file/test to handle it.
From the point of view of kubetools
, this is a half-baked functionality. Adding this as a possibility in the config generator means it also needs to be available from kubetools.yml
.
kubetools
is first a CLI tool.
in order to prevent jobs from hogging resources, we need to be able to add limits. These are optional and can be passed in as a dictionary adhering to: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
Purpose of PR
Parts of the app this will impact
Todos
Additional information
Related links