Skip to content

fix(cert-manager): enable the Gateway API solver in the host cert-manager - #4039

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/cert-manager-gateway-api-solver
Oct 7, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
fix/cert-manager-gateway-api-solver

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

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 refuses it: the vendored chart never turns Gateway API support on, so every HTTP-01 challenge behind the Gateway fails with gateway api is not enabled and no certificate is issued.

This passes a ControllerConfiguration with enableGatewayAPI: true to 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-manager chart. 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 in packages/apps/kubernetes already passes the same ControllerConfiguration when its gatewayAPI addon 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 config through to the controller while shipping none by default.

Closes #3725

Screenshots

Not applicable, no UI changes.

Downstream repositories

Release note

fix(cert-manager): enable the Gateway API solver in the host cert-manager, so ACME HTTP-01 challenges succeed when the platform Gateway is enabled

Summary by CodeRabbit

  • New Features
    • Supported system bundles can now use cert-manager’s Gateway API HTTPRoute solver to issue certificates.
    • Hosted deployments include the required Gateway API custom resource definitions, installed before cert-manager.
    • Gateway API solver support remains opt-in in environments that do not provide the required definitions, avoiding unintended changes to certificate management there.

@lexfrei Aleksei Sviridkin (lexfrei) added kind/backport Categorizes issue or PR as requiring a backport to the current release line area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) labels Sep 2, 2026
@github-actions github-actions Bot added size/L This PR changes 100-499 lines, ignoring generated files kind/bug Categorizes issue or PR as related to a bug labels Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c69e194-15dd-4ab1-863a-c872eb4dbf87
📥 Commits

Reviewing files that changed from the base of the PR and between 4796719 and 76b9e55.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3f427d11-96bb-4e39-9c6e-99ab6631c6b7
📥 Commits

Reviewing files that changed from the base of the PR and between a00589f and 7951cf4.

📒 Files selected for processing (1)
  • packages/core/platform/templates/bundles/system.yaml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Cert-manager Gateway API integration

Layer / File(s) Summary
Controller configuration validation
packages/system/cert-manager/tests/*
Tests verify that a supplied ControllerConfiguration renders into a ConfigMap, that the deployment mounts it and passes its path to the controller, and that no config is rendered by default.
Platform bundle enablement and validation
packages/core/platform/templates/bundles/system.yaml, packages/core/platform/tests/*
The system bundle sets enableGatewayAPI: true for cert-manager. Tests check this setting in the isp-full and isp-hosted variants, hosted CRD inclusion, and cert-manager's dependency on the Gateway API CRDs.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 7951c

The change enables Gateway API solver support for the platform’s root-tenant Gateway, with no concrete merge-blocking risk established.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 7951c

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
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The newly reachable privileged outcome is host-controller creation and management of Gateway HTTP-01 solver routes. Its underlying route authority is cluster-wide, so the potential scope is not limited to one tenant. The PR does not expand Secret RBAC, change controller identity, or enable the feature by default in tenant clusters.

Trust Boundaries and Controls

  • observed — The inspected platform ClusterIssuer configuration fixes the solver’s parent Gateway to cozystack in the publishing namespace. Existing platform configuration explicitly allows the certificate-controller namespace to attach challenge routes. Separate tenant route admission policies deny hostnames outside the tenant namespace apex; these policies do not by themselves prove the complete controller-generated solver path.

Resilience and Maintainability Implications

  • inferred — The generated HelmRelease dependency gate is important to containment: a dependency Package can report Ready before its child release is ready, but cert-manager also depends directly on the dependency’s installable HelmRelease components. This supports waiting for CRD installation rather than starting an enabled controller solely on Package status.

Hardening Proposals

  • proposed — Validate feature rollback with an in-progress Gateway HTTP-01 Challenge, checking eventual solver-route cleanup and issuance recovery after re-enablement. This would address the lifecycle gap left by the configuration assertions; it is not an observed defect.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: enabling the Gateway API solver in the host cert-manager.
Linked Issues check ✅ Passed Issue #3725 requires Gateway API HTTP-01 challenges to complete when Gateway is enabled. The system bundle now passes enableGatewayAPI: true to host cert-manager in `packages/core/platform/templates…
Out of Scope Changes check ✅ Passed The changes are limited to host cert-manager configuration and tests for host package safety and chart config wiring. These changes implement issue #3725. No unrelated changes appear in the whole-PR d…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@IvanHunters IvanHunters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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. enableGatewayAPI only 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.io httproutes 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-crds is emitted on every host variant with helm.sh/resource-policy: keep and dependsOn: [], and the cert-manager PackageSource already dependsOn it (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 exactly LLM (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 on localhost:9000, and the clickhouse-operator logged Update 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 carrying enableGatewayAPI). 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.

@lexfrei
Aleksei Sviridkin (lexfrei) force-pushed the fix/cert-manager-gateway-api-solver branch from 7951cf4 to a1d1d20 Compare October 6, 2026 14:08
@lexfrei

Copy link
Copy Markdown
Contributor Author

Fixed the trailer: the commit is now a1d1d20 with Assisted-by: LLM, and the Commit trailers check is green. E2E is still running on it.

@lexfrei
Aleksei Sviridkin (lexfrei) force-pushed the fix/cert-manager-gateway-api-solver branch from a1d1d20 to 4796719 Compare October 7, 2026 01:39

@IvanHunters IvanHunters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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
@lexfrei
Aleksei Sviridkin (lexfrei) force-pushed the fix/cert-manager-gateway-api-solver branch from 4796719 to 76b9e55 Compare October 7, 2026 11:14
@lexfrei
Aleksei Sviridkin (lexfrei) merged commit 0a2bb5e into main Oct 7, 2026
19 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the fix/cert-manager-gateway-api-solver branch October 7, 2026 14:47
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

myasnikovdaniil added a commit that referenced this pull request Oct 14, 2026
…er in the host cert-manager (#4808)

# Description
Backport of #4039 to `release-1.6`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/platform Issues or PRs related to platform infrastructure (bundle, flux, talos, installer) kind/backport Categorizes issue or PR as requiring a backport to the current release line kind/bug Categorizes issue or PR as related to a bug size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cert-manager is started without --enable-gateway-api=true when gateway is enabled on platform and tenant level

2 participants