[ocp4_workload_rhacs] Pre-create CNAME to fix ACME DNS ENT issue on DDNS clusters#146
[ocp4_workload_rhacs] Pre-create CNAME to fix ACME DNS ENT issue on DDNS clusters#146prakhar1985 wants to merge 2 commits into
Conversation
When cert-manager runs a DNS-01 ACME challenge for the central route, it creates a _acme-challenge TXT record which produces a DNS Empty Non-Terminal (ENT). The ENT causes the wildcard *.apps.* to stop matching the central hostname, failing the ACME challenge for all issuers (Google, ZeroSSL) and falling back to selfsigned. Fix: add dns_cname_pre_cert.yml which pre-creates a specific CNAME for the central route before cert issuance. The CNAME and the _acme-challenge record coexist as siblings — no ENT problem. - Issuer-agnostic: finds any ClusterIssuer with a DDNS webhook via json_query, no hardcoded issuer names - Silently skips on non-DDNS clusters (AWS Route53, GCP, etc.) - Reads tsigAlgorithm from ClusterIssuer config, nothing hardcoded - Called from workload.yml before certificate.yml so the CNAME exists before any ACME challenge fires - dns_registration.yml unchanged — BareMetal A record logic unaffected
|
|
||
| - name: Pre-create CNAME record before ACME cert issuance | ||
| when: ocp4_workload_rhacs_enable_route_certs | bool | ||
| ansible.builtin.include_tasks: dns_cname_pre_cert.yml |
There was a problem hiding this comment.
Is this not doing the same thing in dns_registration.yml? We are already registering the CNAME.
|
Hey @treddy08 — not quite the same, three key differences:
|
|
Also to address the concern about which issuer's credentials are used — the TSIG credentials are per-cluster, not per-CA. Both issuers point to the same The CNAME is in the DNS zone — all issuers benefit from it. Once the CNAME exists it's just a DNS record. It doesn't know which CA later runs the ACME challenge. Whether cert-manager ends up using Google, ZeroSSL, or any future issuer, they all hit the same DNS zone and find the same CNAME — the ENT problem is gone for all of them. |
Problem
On DDNS clusters (
dyn.redhatworkshops.io), thecentralroute always ends up with a self-signed certificate despite having ACME ClusterIssuers available (Google CA, ZeroSSL).Root cause — DNS Empty Non-Terminal (ENT):
When cert-manager runs a DNS-01 ACME challenge for
central-stackrox.apps.cluster-<guid>.dyn.redhatworkshops.io, it creates:This TXT record creates an ENT at
central-stackrox.apps.cluster-<guid>in the DNS tree. Because the name now "exists", the wildcard*.apps.cluster-<guid>no longer matches it — the hostname returnsNODATAinstead of the router IP. The ACME challenge fails for all issuers (Google and ZeroSSL both use the same DDNS solver), and cert issuance falls back toselfsigned.Fix
New task file
dns_cname_pre_cert.ymlpre-creates a specific CNAME record for the central route before cert issuance:The CNAME and the
_acme-challengeTXT record coexist as siblings in the DNS zone — no ENT problem. The ACME challenge resolves correctly and a trusted certificate is issued.Called from
workload.ymlimmediately beforecertificate.yml.Changes
roles/ocp4_workload_rhacs/tasks/dns_cname_pre_cert.yml(new file)BareMetalandNone(SNO) to avoid conflicting with the A record thatdns_registration.ymlcreates after Central is deployedjson_query— no hardcoded issuer namestsigAlgorithm,tsigKeyName,tsigSecretRef,ddnsServer,ddnsZone) directly from the ClusterIssuer — nothing hardcodedcommunity.general.nsupdateroles/ocp4_workload_rhacs/tasks/workload.yml(modified)dns_cname_pre_cert.ymlimmediately beforecertificate.yml, gated onocp4_workload_rhacs_enable_route_certsPlatform behaviour
dns_registration.ymlcreates A record after deployBareMetal clusters are explicitly excluded because
dns_registration.ymlalready creates an A record for the same hostname after Central is deployed. A CNAME and an A record cannot coexist for the same name (RFC 1034).Notes
dns_registration.ymlis unchanged — BareMetal A record logic unaffectedcertificate.ymlacme-bifrost-production-ddnsandacme-bifrost-production-ddns-fallbackshare the same DDNS server, zone, andcert-manager-tsig-credssecret — the CNAME benefits whichever issuer runs the ACME challengeTest plan
centralroute gets a trusted (non-selfsigned) certdns_registration.ymlstill works