Skip to content

Namespaced templates#126

Open
urbaman wants to merge 33 commits into
valkey-io:mainfrom
urbaman:namespaced-templates
Open

Namespaced templates#126
urbaman wants to merge 33 commits into
valkey-io:mainfrom
urbaman:namespaced-templates

Conversation

@urbaman

@urbaman urbaman commented Jan 20, 2026

Copy link
Copy Markdown

Hi,

I added the namespace metadata to all namespaced resourced, managed valkey.namespace in helpers, and added namespaceOverride value to override the default.

Add namespace to ConfigMap metadata in configmap.yaml

Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Add namespace to Service metadata in service-read.yaml

Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
Signed-off-by: Nicola Urbinati <urbaman@gmail.com>
@lindhe

lindhe commented Mar 13, 2026

Copy link
Copy Markdown

I'm so glad to see this PR!

In Kustomize <5.8.1, there was a bug (kubernetes-sigs/kustomize#5566) where Kustomize would ungracefully set the namespace of resources rendered by Helm, without consideration to .Release.Namespace in the templates. This was fixed as of kubernetes-sigs/kustomize#5940 and released with 5.8.1, but that has the significant (albeit intentional) side-effect of not setting .metadata.namespace unless the Helm chart does so explicitly. This breaks things for me and others that manage this Helm chart via Kustomize.

As far as I can tell, this PR would fix that issue and be fully backwards and forwards compatible between different versions of Kustomize.

@lindhe lindhe left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't have the authority to merge anything, but here's a review anyway to hopefully push things in the right direction. I think it'd be great if this could be merged soon.

Comment on lines +14 to +18
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}

@lindhe lindhe Mar 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think this matters a lot, since overly long input is uncommon, but if we want to truncate the namespace I guess we might as well do that for .Release.Namespace too. I'm not sure I like my own suggestion here (I think your stanza is sufficient), but here's a suggestion of what that could look like:

Suggested change
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" -}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants