-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Support setting resources limit/request for ACME HTTP01 solver pod via podTemplate #7825
Description
Is your feature request related to a problem? Please describe.
As a user, I'd like to set the ACME HTTP01 solver pod's resources limit/request via podTemplate stanza: https://cert-manager.io/docs/configuration/acme/http01/#podtemplate. But the container resources is not one of the currently supported fields: https://cert-manager.io/docs/reference/api-docs/#acme.cert-manager.io/v1.ACMEChallengeSolverHTTP01IngressPodTemplate
There are already relevant controller flags which can be set globally:
cert-manager/cmd/controller/app/options/options.go
Lines 110 to 125 in 63b4706
| // HTTP-01 solver pod configuration via flags is a now deprecated | |
| // mechanism - please use pod template instead when adding any new | |
| // configuration options | |
| // https://github.com/cert-manager/cert-manager/blob/f1d7c432763100c3fb6eb6a1654d29060b479b3c/pkg/apis/acme/v1/types_issuer.go#L270 | |
| // These flags however will not be deprecated for backwards compatibility purposes. | |
| fs.StringVar(&c.ACMEHTTP01Config.SolverResourceRequestCPU, "acme-http01-solver-resource-request-cpu", c.ACMEHTTP01Config.SolverResourceRequestCPU, ""+ | |
| "Defines the resource request CPU size when spawning new ACME HTTP01 challenge solver pods.") | |
| fs.StringVar(&c.ACMEHTTP01Config.SolverResourceRequestMemory, "acme-http01-solver-resource-request-memory", c.ACMEHTTP01Config.SolverResourceRequestMemory, ""+ | |
| "Defines the resource request Memory size when spawning new ACME HTTP01 challenge solver pods.") | |
| fs.StringVar(&c.ACMEHTTP01Config.SolverResourceLimitsCPU, "acme-http01-solver-resource-limits-cpu", c.ACMEHTTP01Config.SolverResourceLimitsCPU, ""+ | |
| "Defines the resource limits CPU size when spawning new ACME HTTP01 challenge solver pods.") | |
| fs.StringVar(&c.ACMEHTTP01Config.SolverResourceLimitsMemory, "acme-http01-solver-resource-limits-memory", c.ACMEHTTP01Config.SolverResourceLimitsMemory, ""+ | |
| "Defines the resource limits Memory size when spawning new ACME HTTP01 challenge solver pods.") |
But:
- It can only be set globally to a common value, not allowed to configure at issuer/solver level.
- While the comments describe the flag-based configuration as "a now deprecated mechanism," the podTemplate does not provide equivalent support, which may confuse users (i.e. make http01 solver pod resource request/limits configurable, refs #892 #923 (comment))
Describe the solution you'd like
Follow #1097, to add resources field in HTTP01 solver podTemplate.
(Linked similar issues for reference: #2770, #3108, #3853)
Describe alternatives you've considered
Additional context
We should both support acme-http01-solver-* flags and podTemplate.spec.resources for backwards compatibility. As for the precedence , I would prefer that if an Issuer/ClusterIssuer specifies resource settings via podTemplate, those values should override the ones set/defaulted by the acme-http01-solver-* flags.
/kind feature