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

[resources] Cannot set resources for initContainers

Open nttvgonzafe opened this issue 2 years ago • 3 comments

Currently the spec doesn't allow setting the resources field on initContainers. On clusters that enforce setting resources for all containers, this blocks databases created by the operator from starting.

Related code is at https://github.com/cockroachdb/cockroach-operator/blob/c7ea8c17f2cce43506d50108449b9169323b44fe/pkg/resource/statefulset.go#L253

nttvgonzafe avatar Jan 24 '23 09:01 nttvgonzafe

A possible workaround is to add a LimitRange with the default resources. Anyway, this initContainerResources can be a good thing to have.

nttvgonzafe avatar Jan 24 '23 09:01 nttvgonzafe

Hey @nttvgonzafe, thanks for opening this issue! Ideally, how would you envision this working? Would it be exposing a top-level field on the cluster CRD for example?

pseudomuto avatar Feb 21 '23 15:02 pseudomuto

Hey! I think so, exposing a initResources at the same level as resources in the CRD with the same schema should be intuitive. Edit: initResources or initContainerResources whichever seems more idiomatic.

nttvgonzafe avatar Feb 22 '23 07:02 nttvgonzafe