Skip to content

feat: add automatic re-issuance of failed custom hostname certificates#259

Merged
ecv merged 1 commit into
mainfrom
feat/reissuancecerts-rebased
Jul 13, 2026
Merged

feat: add automatic re-issuance of failed custom hostname certificates#259
ecv merged 1 commit into
mainfrom
feat/reissuancecerts-rebased

Conversation

@ecv

@ecv ecv commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Recreates #124 on current main. The original branch (feat/reissuancecerts) diverged onto an unrelated history (no common ancestor with main), so a normal rebase was impossible — this reapplies the net diff on a fresh branch.

What it does

Fast-track recovery for custom-hostname Certificates stuck in a failed state, bypassing cert-manager's exponential backoff:

  • CertificateReissuanceConfig added to gateway config — retryInterval (default 5m), maxRetries (default 3).
  • Detect failed Certificates in ensureListenerCertificates; past the retry interval, delete to trigger Kubernetes GC of the whole chain (CertificateRequest, Order, Challenge, solver HTTPRoute/HTTPRouteFilter) and recreate fresh next reconcile.
  • Re-issuance count tracked as annotations on the downstream Gateway (survives Certificate deletion); cleared on recovery to bound ACME retries.

Since #124 was written

main grew a listener cert health-gating layer (evaluateListenerCertHealth / listenerCertHealth, from #212). This PR coexists with it — both cert-failure paths are present and independently tested.

Design question for reviewers: #212 = don't serve / isolate a bad cert; this = actively re-issue it. They don't conflict mechanically. Left standalone so the diff maps 1:1 to #124 — flag if you'd prefer it folded into the listenerCertHealth flow.

Verification

Related

Recreate PR #124 on current main after the branch diverged onto an
unrelated history. Adds a fast-track recovery path for custom-hostname
Certificates stuck in a failed state, bypassing cert-manager's
exponential backoff.

Key changes:
- add CertificateReissuanceConfig to GatewayConfig (retryInterval
  default 5m, maxRetries default 3)
- detect failed Certificates in ensureListenerCertificates; delete past
  the retry interval to trigger Kubernetes GC of the chain
  (CertificateRequest, Order, Challenge, solver resources) and recreate
  fresh on the next reconcile
- track re-issuance count as annotations on the downstream Gateway so it
  survives Certificate deletion; clear on recovery to bound ACME retries
- coexists with the listener cert health-gating added for #212

@aflor024 aflor024 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@ecv ecv merged commit 4a1da1e into main Jul 13, 2026
10 of 11 checks passed
@ecv ecv deleted the feat/reissuancecerts-rebased branch July 13, 2026 02:49
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.

2 participants