Repository navigation
feat(cert-manager): pin v1.21.2, real gateway-shim, safe fallback - #36
Merged
Merged
Conversation
- Default/example cert_manager_version v1.19.2 -> v1.21.2 (latest 1.21 patch; k8s 1.33-1.36). Live clusters already run v1.21.1 from a manual Helm upgrade on 2026-07-31. - Helm values: crds.enabled/crds.keep instead of deprecated installCRDs; config.gatewayAPI.enabled=true instead of --controllers=*,gateway-shim, which registers the shim but never starts its informers (>=1.15). - Refuse to delete CRDs/namespace when the Helm release is not found unless cleanup_unmanaged_install=true; detect release via helm status. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Bring cert-manager on the three apps clusters (poc/nprd/prd) back under Terraform at the latest 1.21 patch, and fix two latent problems in the
cert_managermodule.Findings that drove this
helm upgradeon 2026-07-31 with onlyinstallCRDs=true. Terraform state still records v1.19.2, which is the "6 to replace" drift.cert-manager/cert-manageris owned by this repo'smodules/cert_manager(apps clusters). gitops-core Fleet bundles (cert-manager/overlays/<cluster>) only ship the ClusterIssuer, default-cert ConfigMap, rke2-ingress-nginx HelmChartConfig and (manager) the cert-sync CronJob — not the chart, so there is no double management. No HelmChart CRs for cert-manager exist. The manager's cert-manager is installed byrancher_cluster/deploy-rancher.sh(no version trigger, so out of scope here).serviceAccountRefagainst the controller SA.--controllers=*,gateway-shimregisters the shim, but its Gateway informers only start whengatewayAPI.enabledis true, so it waited forever. The manual 1.21.1 upgrade also dropped that flag. The prdhigh-command-gateway-https-dataknife-aiCertificate has no owner (it was created by hand) and keeps renewing normally either way. Gateway API CRDs (v1.4.1) are present on all three apps clusters, whichgatewayAPI.enabledrequires (otherwise the controller crash-loops). The shim refuses to modify Certificates it doesn't own.Changes
cert_manager_versiondefault/example:v1.19.2→v1.21.2(root var,cert_managermodule,rancher_clustermodule).crds.enabled=true crds.keep=true(replaces deprecatedinstallCRDs; CRDs keephelm.sh/resource-policy: keep) andconfig.gatewayAPI.enabled=true.helm listfailure was enough to trigger it. It now exits with an error unlesscleanup_unmanaged_install = true. Release detection useshelm status.Rollout (after merge)
Targeted
-refresh=falseapplies, one cluster at a time: poc-apps → nprd-apps → prd-apps, with a state backup first and the full plan reviewed (it must contain onlymodule.cert_manager_<cluster>.null_resource.{deploy,verify}_cert_manager). Each cluster gets verified before moving on. nprd/prd are gated on the in-flight CNPG Barman plugin work being idle.Test plan
helm templatev1.21.2 with the new values renders the controller ConfigMap withgatewayAPI.enabled: trueand 6 CRDs withresource-policy: keepterraform fmton the moduleNote
Medium Risk
Changes cert-manager Helm values and version on apps clusters where all cluster TLS depends on Certificate/Issuer CRDs; the new fail-safe reduces accidental CRD deletion risk during apply.
Overview
Re-aligns Terraform-managed cert-manager with live clusters by bumping the default chart pin from
v1.19.2tov1.21.2(root variable,rancher_cluster, example tfvars, CHANGELOG).The
cert_managermodule updates Helm install/upgrade to usecrds.enabled/crds.keepinstead of deprecatedinstallCRDs, andconfig.gatewayAPI.enabled=trueinstead of--controllers=*,gateway-shimso the gateway-shim actually runs on cert-manager 1.15+. Post-install checks readgatewayAPI.enabledfrom the controller ConfigMap.Safety fix: when cert-manager resources exist but Helm does not show a
cert-managerrelease, the module errors by default instead of deleting CRDs/namespace (which would wipe all Certificates/Issuers). Destructive cleanup requires newcleanup_unmanaged_install = true. Release detection useshelm statusrather than greppinghelm list.Reviewed by Cursor Bugbot for commit d780413. Bugbot is set up for automated code reviews on this repo. Configure here.