Repository navigation
Conversation
Signed-off-by: Richard Wall <[email protected]>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: Richard Wall <[email protected]>
|
One API design question I looked at was whether this should introduce a I think a I have still kept
So for now this PR keeps the existing |
Signed-off-by: Richard Wall <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
|
/kind feature |
Signed-off-by: Richard Wall <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
|
One observability point I looked at was whether this PR should also add a metric for self-check timing. I have not included one here. We do already expose ACME client request metrics, but I do not think there is currently a metric for challenge self-check or readiness duration. I think that is better treated as a follow-up, because the right shape is not entirely obvious once delayed acceptance is possible. For example, there is a design choice between measuring time to successful self-check, time to challenge acceptance, or distinguishing acceptance via self-check from acceptance via delay fallback. For now, |
There was a problem hiding this comment.
Pull request overview
This PR introduces an ACME “escape hatch” to allow accepting challenges after a per-solver delay when cert-manager’s self-check cannot reliably observe the same validation path as the ACME server (e.g., split-horizon DNS, NAT loopback issues). It does this by adding spec.acme.solvers[].acceptChallengeAfter and recording status.presentedAt on Challenge so the delay can be measured from first successful presentation.
Changes:
- Add
acceptChallengeAftertoACMEChallengeSolverand generate CRDs/OpenAPI/applyconfigurations accordingly. - Add
status.presentedAttoChallengeStatusand set/reset it in the challenges controller. - Factor readiness/acceptance decision logic into a controller-internal readiness evaluator with new unit coverage, plus a small e2e assertion that
presentedAtis set.
Reviewed changes
Copilot reviewed 17 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/gen/challenge.go | Adds unit-test helpers for presentedAt and acceptChallengeAfter. |
| test/e2e/suite/issuers/acme/certificate/webhook.go | Extends e2e assertions to require status.presentedAt once presented. |
| pkg/controller/acmechallenges/sync.go | Records presentedAt, resets it on finalization, and routes acceptance through readiness evaluation. |
| pkg/controller/acmechallenges/sync_test.go | Adds/adjusts sync tests for presentedAt and delayed acceptance behavior. |
| pkg/controller/acmechallenges/readiness.go | Introduces internal readiness evaluators (strict self-check vs delay-after-presentation). |
| pkg/controller/acmechallenges/readiness_test.go | Adds unit tests covering readiness evaluation behavior. |
| pkg/controller/acmechallenges/controller.go | Wires controller clock into the challenges controller for deterministic time handling. |
| pkg/client/applyconfigurations/internal/internal.go | Updates applyconfiguration schema for new fields. |
| pkg/client/applyconfigurations/acme/v1/challengestatus.go | Adds applyconfig support/docs for presentedAt. |
| pkg/client/applyconfigurations/acme/v1/acmechallengesolver.go | Adds applyconfig support/docs for acceptChallengeAfter. |
| pkg/apis/acme/v1/types_issuer.go | Adds public API field acceptChallengeAfter on solver. |
| pkg/apis/acme/v1/types_challenge.go | Adds status.presentedAt to Challenge status API. |
| pkg/apis/acme/v1/zz_generated.deepcopy.go | Regenerates deepcopy for new fields. |
| internal/apis/acme/types_issuer.go | Mirrors internal API field for acceptChallengeAfter. |
| internal/apis/acme/types_challenge.go | Mirrors internal API field for presentedAt. |
| internal/apis/acme/zz_generated.deepcopy.go | Regenerates internal deepcopy for new fields. |
| internal/apis/acme/v1/zz_generated.conversion.go | Regenerates conversions for new fields and import alias adjustments. |
| internal/generated/openapi/zz_generated.openapi.go | Regenerates OpenAPI for new fields. |
| deploy/crds/cert-manager.io_issuers.yaml | CRD regen to include acceptChallengeAfter. |
| deploy/crds/cert-manager.io_clusterissuers.yaml | CRD regen to include acceptChallengeAfter. |
| deploy/crds/acme.cert-manager.io_challenges.yaml | CRD regen to include acceptChallengeAfter and status.presentedAt. |
| deploy/charts/cert-manager/templates/crd-cert-manager.io_issuers.yaml | Helm CRD template regen for acceptChallengeAfter. |
| deploy/charts/cert-manager/templates/crd-cert-manager.io_clusterissuers.yaml | Helm CRD template regen for acceptChallengeAfter. |
| deploy/charts/cert-manager/templates/crd-acme.cert-manager.io_challenges.yaml | Helm CRD template regen for acceptChallengeAfter and status.presentedAt. |
Files not reviewed (6)
- internal/apis/acme/v1/zz_generated.conversion.go: Language not supported
- internal/apis/acme/zz_generated.deepcopy.go: Language not supported
- pkg/apis/acme/v1/zz_generated.deepcopy.go: Language not supported
- pkg/client/applyconfigurations/acme/v1/acmechallengesolver.go: Language not supported
- pkg/client/applyconfigurations/acme/v1/challengestatus.go: Language not supported
- pkg/client/applyconfigurations/internal/internal.go: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Richard Wall <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
Signed-off-by: Richard Wall <[email protected]>
|
/retest |
|
I dug into the latest This one looks like infra rather than a branch regression:
There also seems to be a broader issue with the same job on unrelated open PRs: for example /retest |
|
/test pull-cert-manager-master-e2e-v1-35 |
|
The latest pull-cert-manager-master-e2e-v1-35 failure still appears consistent with the earlier infrastructure problem rather than with this change. From the available build log, the job got through kind setup, cert-manager install, Pebble install, and the samplewebhook Helm invocation, then hit the overall 2 hour timeout without any sign that it had progressed into Ginkgo test execution. As that looks like the same setup-stage mode of failure we were seeing before, I think it is worth retrying now that the underlying e2e infrastructure problem may have been addressed. /retest |
|
Took me a while to remember why we didn't accept the idea of adding smth like The RFC says "SHOULD NOT", and not "MUST NOT", so it feels OK to me. And since the default is still to fail if the self-check doesn't succeed, I think public ACME issuers like Let's Encrypt won't come to us saying that cert-manager is hammering them... hopefully. Now, what about the risk of rate limit with most public ACME issuers? For Let's Encrypt, the rate limit for failed validation is 5 failures per account, per hostname, per hour. Using Let's Encrypt + I don't really know what the risk of having a Let's Encrypt account with lots of failed validations would be. Maybe it would increase the risk of hitting other rate limits if an order has lots of hostnames but only one is failing... I'm thinking the regular certificaterequest exponential backoff would kick in, but I'm not sure. It would be great to have some explanation of these risks (if someone understands them) in the docs. Also, why should cert-manager perform the self-check when waitInsteadOfSelfCheck: 30sThat way, it's clear that cert-manager's self checks aren't worth doing. And it would match certbot's behavior. I can't see a scenario where self-checks normally work and someone would still use |
|
Superseded by #8858. I have opened a fresh replacement PR because the review feedback changed both the public field name and the feature semantics, so keeping the old PR would have left a confusing review trail around the earlier hybrid design. |
Fixes: #1292
It adds a per-solver
acceptChallengeAfterescape hatch for ACME challenges:The intention is to help in environments where cert-manager cannot reliably observe the same validation path as the ACME server, for example split-horizon DNS, NAT loopback limitations, or public/private ingress asymmetry.
This is a smaller and simpler version of the approach previously explored in #5006. It keeps the public API small, but still factors the controller logic through an internal readiness evaluator so the behaviour is easier to test and reason about.
Prototype docs for the next minor release are in cert-manager/website#2101.
API shape in this prototype
This also adds
status.presentedAtonChallengeso the delay is measured from first successful presentation.Implementation notes
acceptChallengeAfteris not setmake generate-codegen generate-crdsTesting
I have run:
go test ./pkg/controller/acmechallenges -count=1make generate-codegen generate-crdsThe unit coverage in
readiness_test.goandsync_test.goincludes:I have not added a new ACME e2e test for the delayed-acceptance path in this PR. The reason is that the distinguishing behaviour here requires a test topology where cert-manager and the ACME server intentionally observe different validation paths. The existing e2e environment is set up so that both normally see the same working path, so a new e2e would either be weak wiring coverage only or require much more invasive and potentially flaky test setup. For this PR, I think the targeted unit coverage gives better signal.
TODO
Kind
/kind feature
Release Note
Relates to #1292.