Skip to content

Support setting resources limit/request for ACME HTTP01 solver pod via podTemplate #7825

@lunarwhite

Description

@lunarwhite

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:

// 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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions