[kubitodev/servarr] Set explicit namespace on all rendered resources#68
Open
thiagocrepaldi wants to merge 1 commit into
Open
[kubitodev/servarr] Set explicit namespace on all rendered resources#68thiagocrepaldi wants to merge 1 commit into
thiagocrepaldi wants to merge 1 commit into
Conversation
Add namespace: {{ .Release.Namespace }} to the metadata of every
template. Plain `helm install`/`helm upgrade` behavior is unchanged
(helm already applies manifests into the release namespace), but the
rendered manifests now carry the namespace explicitly, which fixes
deployments through render-then-apply pipelines:
- kustomize `helmCharts` inflation: since kustomize v5.8.0 the
`namespace:` transformer skips helm-generated resources
(kubernetes-sigs/kustomize#6058), so charts that do not template
.Release.Namespace end up in the kubectl default namespace.
- Argo CD / Flux and `helm template | kubectl apply` flows benefit the
same way.
Verified with `helm lint`, `helm template` (with and without -n), and
a kustomize v5.8.1 build: all 48 rendered objects, ingresses included,
now land in the release namespace.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Thiago Crepaldi <thiago@thiagocrepaldi.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.
What
Adds
namespace: {{ .Release.Namespace }}to themetadataof every template in the servarr chart (65 metadata blocks across 59 files), and bumps the chart version to 1.5.3 per the contributing guidelines.Why
Plain
helm install/helm upgradeusers see no behavior change — helm already applies manifests into the release namespace, and.Release.Namespaceresolves identically.The change matters for render-then-apply pipelines, which are increasingly common:
helmChartsinflation: since kustomize v5.8.0, thenamespace:transformer deliberately skips helm-generated resources (Kustomize 5.8.0 no longer add namespaces to resources in helm charts without explicit namespace kubernetes-sigs/kustomize#6058, regression from fix: performance recession when propagating namespace to helm kubernetes-sigs/kustomize#5971). Charts that don't template.Release.Namespacetherefore render with no namespace at all, and everything lands in the kubectl default namespace. With this change the chart's own output carries the right namespace regardless of kustomize version.helm template | kubectl applyflows benefit the same way.The chart already uses
.Release.Namespacein the jellyfin RoleBinding subjects, so this just applies the same pattern consistently. Several widely-used charts (metallb, argo-cd) set metadata namespace explicitly for the same reason.Verification
helm lintpasses.helm template servarr .(no-n) → all docs rendernamespace: default, matching previous install-time behavior.helm template servarr . -n mediawith a real-world values file (11 sub-apps enabled) → all 48 docs rendernamespace: media, including the RoleBinding subjects path withjellyfin.tailscale.enabled=true.kustomize build --enable-helm(v5.8.1) over this chart previously produced 48 namespace-less objects; with this change every object, ingresses included, carries the release namespace.