Skip to content

fix(ingress): serve existing dns-01 certificates before the first pass - #158

Merged
kvinwang merged 1 commit into
mainfrom
fix/ingress-serve-first
Oct 16, 2026
Merged

kvinwang merged 1 commit into
mainfrom
fix/ingress-serve-first

Conversation

@kvinwang

@kvinwang kvinwang commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Why

dns-01 finished a whole certificate pass before starting haproxy. After a restart every domain stayed unserved for as long as the slowest one took: a certbot run up to its timeout for a domain that fails, or up to DNS_SETUP_TIMEOUT (30 min) per domain whose delegation CNAMEs are still being created.

What

  • dns-01: if any certificate is on disk, start haproxy first and let the background loop run the pass immediately. With none, keep the old order: issue first, and exit if the pass still leaves nothing to serve.
  • Both modes: new prepare_serving in cert-lib.sh runs just before haproxy starts. It republishes the evidence, or withdraws what the last run left (it attests a container that may be gone) when that is not possible yet; tls-alpn-01 used to serve the old evidence until its first pass. haproxy reads the PEMs built there itself, so the first pass no longer reloads it.
  • README and TESTING.md updated.

Tests

prepare_serving stubbed over account present/absent × evidence ok/failing. Pebble end-to-end results will follow in a comment.

@kvinwang
kvinwang force-pushed the fix/ingress-serve-first branch 3 times, most recently from 8f49c1a to c5e01e2 Compare October 16, 2026 01:20
@kvinwang
kvinwang changed the base branch from fix/ingress-apply-retry to main October 16, 2026 01:22
@kvinwang
kvinwang force-pushed the fix/ingress-serve-first branch 2 times, most recently from bd162d4 to 7eb3401 Compare October 16, 2026 01:25
dns-01 finished a whole certificate pass before starting haproxy, so on
a restart every domain stayed unserved for as long as the slowest one
took: a certbot run up to its timeout for a domain that fails, or up to
DNS_SETUP_TIMEOUT (30 min) per domain whose delegation CNAMEs are still
being created. When any certificate is on disk, start haproxy first and
run the pass in the background loop. Without one, keep issuing first and
exit if the pass yields nothing to serve.

Serving before the pass would also serve what the last run left in
/evidences, which attests a container that may no longer be running --
as tls-alpn-01 already did. So both modes now prepare serving the same
way (prepare_serving in cert-lib.sh): republish the evidence before
haproxy starts, or withdraw it if that is not possible yet. haproxy
reads the PEMs built there itself, so the first pass no longer reloads
it either.

Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang force-pushed the fix/ingress-serve-first branch from 7eb3401 to f01040e Compare October 16, 2026 01:27
@kvinwang
kvinwang merged commit a9f71d4 into main Oct 16, 2026
6 checks passed
@kvinwang
kvinwang deleted the fix/ingress-serve-first branch October 16, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant