fix(helm): generate namespace-aware SANs in certgen and cert-manager templates#2062
Merged
Merged
Conversation
…templates The certgen hook and cert-manager Certificate template hardcoded openshell.openshell.svc.cluster.local in server certificate SANs, breaking deployments in any namespace other than openshell. Use .Release.Namespace in the templates so the SANs match the actual service FQDN regardless of the target namespace. Closes NVIDIA#2060 Signed-off-by: Akram <akram.benaissi@gmail.com>
Collaborator
|
/ok to test 4e65dc8 |
TaylorMutch
approved these changes
Jun 30, 2026
Collaborator
|
Looks good, thanks for the fix! |
This was referenced Jul 1, 2026
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.
The certgen hook and cert-manager Certificate template hardcoded
openshell.openshell.svc.cluster.localin server certificate SANs, breaking deployments in any namespace other thanopenshell. This PR adds anopenshell.defaultServerDnsNameshelper that derives SANs from.Release.Namespace, so the server certificate matches the actual service FQDN regardless of the target namespace.Summary
The certgen hook and cert-manager Certificate template hardcoded
openshell.openshell.svc.cluster.localin server certificate SANs, breaking deployments in any namespace other thanopenshell. This PR adds anopenshell.defaultServerDnsNameshelper that derives SANs from.Release.Namespace, so the server certificate matches the actual service FQDN regardless of the target namespace.Related Issue
Closes #2060 by implementing option B (Helm-generated SANs).
Changes
_helpers.tpl: newopenshell.defaultServerDnsNameshelper that builds the default SAN list using.Release.Namespacevialist+toYamlcertgen.yaml: iterate the helper output withfromYamlArrayto pass namespace-aware--server-sanargs to the certgen binarycert-manager-pki.yaml: replacetoYaml .Values.certManager.serverDnsNameswith the same helper loop for the CertificatednsNamesfield, appending user-provided extra SANs from valuesNote: the Rust
DEFAULT_SERVER_SANSconstant inpki.rsstill adds the hardcodedopenshell.openshell.svcSANs alongside the Helm-generated ones. This results in harmless duplicate/extra SANs in the certificate. Fully removing the Rust defaults is tracked as option A in #2060.Testing
openshell-systemon OpenShift (ROSA HCP 4.21)openshell.openshell-system.svc.cluster.localin SANsBadCertificateerrors) — previously failed withTLS handshake failed error=received fatal alert: BadCertificatehelm templaterenders correctly for bothopenshellandopenshell-systemnamespaces--set certManager.enabled=truemise run pre-commit— helm:lint fails on main too (missing postgresql dependency, pre-existing)Checklist