vitess-operator icon indicating copy to clipboard operation
vitess-operator copied to clipboard

Set vttablet init container resource requests and limits

Open brandt opened this issue 3 years ago • 2 comments

Sets the resource requirements on each of the default vttablet init containers to the same request and limit values as the vttablet container itself.

This fixes the issue reported in #212 where pods would fail to be created on clusters with strict quota requirements because no limit was set on the init containers.

History

This is a reimplementation of #216 with the change that it no longer sets a default resource limit.

This fixes the issue reported in #240 and discussed in #244 where the vttablet pod would fail to be created when the user sets a request larger than the default limit without also setting a larger limit. The user's nil limit would not override the default value because update.ResourceRequirements(dst, src) won't update dst with a nil src (for good reasons).

With this change, users can once again increase the request by itself. If a cluster requires a limit, the user will already need to have set it on for vttablet so we can use the same value to override the init containers' default nil limit.

fixes #212 fixes #240

Signed-off-by: J. Brandt Buckley [email protected]

brandt avatar Mar 06 '22 22:03 brandt

@brandt There are others better suited for the review, but I just wanted to say THANK YOU for the contribution! It's really nice to see non-PlanetScale contributors to the operator. ❤️

mattlord avatar Mar 09 '22 17:03 mattlord

@mattlord My pleasure!

brandt avatar Mar 09 '22 22:03 brandt

@brandt Are you still working on this? We would like to get this change in before we do the next release.

GuptaManan100 avatar Jan 16 '23 11:01 GuptaManan100

Closed in favour of https://github.com/planetscale/vitess-operator/pull/370

GuptaManan100 avatar Feb 02 '23 11:02 GuptaManan100