Repository navigation
fix(cert-manager): enable the Gateway API solver in the host cert-manager - #4039
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe system bundle configures cert-manager to enable its Gateway API solver. The hosted variant includes the Gateway API CRDs, and cert-manager depends on them. New Helm tests cover controller configuration and bundle wiring. ChangesCert-manager Gateway API integration
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~15 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change enables Gateway API solver support for the platform’s root-tenant Gateway, with no concrete merge-blocking risk established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change is narrowly scoped to the host installation and preserves tenant defaults and existing permissions. Dependency gates and controller configuration wiring support the intended rollout. No introduced vulnerability was established, but cleanup of active challenge routes after rollback remains unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a00589f to
7951cf4
Compare
IvanHunters
left a comment
There was a problem hiding this comment.
Verdict
NOT LGTM
Reviewed at 7951cf4db against merge-base a5d12e78d. The code change is sound, well-scoped and well-tested; the one blocker is the commit trailer, which is failing a required CI gate.
The implementation is correct. The platform threads a ControllerConfiguration{enableGatewayAPI: true} into the host cert-manager Package's component values rather than making it a chart default, and that split is both correct and complete: the vendored chart renders the config only when .Values.config is set, so tenant installs of the same chart (where the Gateway API CRDs are opt-in) keep the solver off, and the third unit test pins that default. The change is genuinely needed, not cosmetic: packages/system/cert-manager-issuers/templates/cluster-issuers.yaml:44 renders an http01.gatewayHTTPRoute solver whenever the host runs with gateway-enabled=true, and cert-manager refuses that solver unless the flag is on, so today every ACME challenge on such a host fails with "gateway api is not enabled".
A few things I checked specifically:
- HTTP-01 / DNS-01 are not affected.
enableGatewayAPIonly adds the Gateway API solver path; it does not remove or alter the ingress or DNS-01 solvers, and the ingress/DNS RBAC rules are untouched. - No RBAC expansion. The gateway RBAC the solver needs (
gateway.networking.k8s.iohttproutes on the challenges role, gateways/httproutes/listenersets on the ingress-shim role) is already granted unconditionally in the vendored chart (rbac.yaml:262-263,311-315), so this PR correctly does not touch RBAC. No wildcard, no new verb, no new subject. - Ordering holds.
cozystack.gateway-api-crdsis emitted on every host variant withhelm.sh/resource-policy: keepanddependsOn: [], and the cert-manager PackageSource alreadydependsOnit (pre-existing,sources/cert-manager.yaml:16), so the CRDs are present before the controller starts with the flag.
CI on the reviewed head:
- "Commit trailers" is red because the commit carries
Assisted-By: Claude <[email protected]>. The repo's checker requires the attribution value to be exactlyLLM(Assisted-by: LLM). This is the single blocking item; amend the trailer and the gate goes green. See the finding. - "E2E (in-tree)" is red on an unrelated suite,
chainsaw/clickhouse-1-backup-contracts(the ClickHouse backup sidecar could not reach the server onlocalhost:9000, and the clickhouse-operator loggedUpdate Service ... just recreate the service in case of service type change ''=>'ClusterIP'). This is not caused by this change: in the same run cert-manager installed cleanly with the new config (Helm install succeeded for release cozy-cert-manager/cert-manager.v1, components carryingenableGatewayAPI). I am not blocking on it, but it needs a re-run to go green before merge.
One thing I could not verify hermetically (Caveat, not a blocker): the existing-install upgrade. On an already-running host cert-manager, this change makes the controller Deployment gain the --config arg plus a config volume/volumeMount, which triggers a rolling restart, and creates a brand-new cert-manager ConfigMap. Reasoned through, that is a normal podTemplate roll with no SSA-ownership or immutable-field hazard, and the Gateway API CRDs are already present on an existing cluster, so the restarted controller does not crashloop. But the live upgrade restart was not exercised (the E2E run is a fresh install). Recommend a cozystack-pr-test upgrade run against a disposable dev cluster before merge to close it.
Findings not anchored to changed lines
These reference code outside this PR's diff (unchanged files, or lines outside a hunk), so GitHub cannot render them inline.
[MAJOR] commit 7951cf4db (message trailer):? Commit AI-attribution trailer uses a disallowed form, failing the required Commit trailers CI gate
The commit trailer is Assisted-By: Claude <[email protected]>. cozystack's trailer checker requires the attribution value to be exactly LLM, i.e. Assisted-by: LLM. The "Commit trailers" check is red on the reviewed head because of this, so the PR cannot merge until the trailer is amended (and the commit re-signed with the existing Signed-off-by: Aleksei Sviridkin <[email protected]>). This is a one-line commit amend; no code change is implied.
$ git log -1 --format='%B' 7951cf4db | tail -3
Signed-off-by: Aleksei Sviridkin <[email protected]>
Assisted-By: Claude <[email protected]>
$ gh api repos/cozystack/cozystack/actions/jobs/111977505811/logs | grep -A1 -i 'attribution trailer'
Assisted-By: Claude <[email protected]>
attribution trailer value must be exactly LLM
Assisted-by: LLM
##[error]Process completed with exit code 1.
7951cf4 to
a1d1d20
Compare
|
Fixed the trailer: the commit is now a1d1d20 with |
a1d1d20 to
4796719
Compare
IvanHunters
left a comment
There was a problem hiding this comment.
LGTM. enableGatewayAPI matches cert-manager v1.20.2, and the Gateway API CRDs are ordered ahead of cert-manager via dependsOn: cozystack.gateway-api-crds. helm unittest green.
The red E2E is unrelated: it timed out at computeplane-lifecycle on a cilium dependency with no cert-manager error in the log; needs a re-run.
With the platform Gateway enabled, the ClusterIssuers in cert-manager-issuers and the per-tenant Issuers rendered for TenantGateway carry an http01.gatewayHTTPRoute solver, but the controller only honours that solver when Gateway API support is switched on, and the vendored chart leaves it off. Every HTTP-01 challenge behind the Gateway then fails with "gateway api is not enabled" and no ACME certificate is issued. Pass a ControllerConfiguration with enableGatewayAPI to the host cert-manager through the component values of its platform Package. The host always ships the Gateway API CRDs and orders cert-manager after them, so the flag is safe on every variant. It is not a default of the system/cert-manager chart: the same chart is installed into tenant clusters, where the CRDs are an opt-in addon and a controller started with Gateway API support and no CRDs exits at startup. The tenant side keeps opting in on its own. Signed-off-by: Aleksei Sviridkin <[email protected]> Assisted-by: LLM
4796719 to
76b9e55
Compare
|
Successfully created backport PR for |
What this PR does
With the platform Gateway enabled, the ClusterIssuers in
cert-manager-issuersand the per-tenant Issuers rendered forTenantGatewaycarry anhttp01.gatewayHTTPRoutesolver, but the controller refuses it: the vendored chart never turns Gateway API support on, so every HTTP-01 challenge behind the Gateway fails withgateway api is not enabledand no certificate is issued.This passes a
ControllerConfigurationwithenableGatewayAPI: trueto the host cert-manager through the component values of its platform Package. The host ships the Gateway API CRDs on every variant and orders cert-manager after them, so the flag is safe there.It is deliberately not a default of the
system/cert-managerchart. The same chart is installed into tenant Kubernetes clusters, where the CRDs are an opt-in addon, and cert-manager v1.20 exits at startup when Gateway API support is on and the CRDs are missing. The tenant HelmRelease inpackages/apps/kubernetesalready passes the sameControllerConfigurationwhen itsgatewayAPIaddon is enabled, so both clusters now opt in from the layer that knows whether the CRDs are there, and the chart itself stays neutral.The new tests pin both halves: the host Package carries the flag and the preconditions that make it safe, and the chart wires
configthrough to the controller while shipping none by default.Closes #3725
Screenshots
Not applicable, no UI changes.
Downstream repositories
Release note
Summary by CodeRabbit