#6058·kustomize

Kustomize 5.8.0 no longer add namespaces to resources in helm charts without explicit namespace

Author: codestationCreated Feb 4, 2026Updated Sep 10, 2026
Labelskind/bugtriage/accepted

What happened?

Before kustomize 5.8.0 if i declare the namespace in the /namespace of the kustomization.yaml file it will add a namespace to all the resources without an explicit namespace.

After 5.8.0 it won't add the namespace, breaking several 3rd party charts where the resources doesn't have an explicit namespace: {{ .Release.Namespace }} template.

For example i can no longer install the mariadb-operator chart in argocd after the kustomize update because the resources no longer have a namespace.

As a workaround for this specific chart i am using the following:

yaml
patches:
  - target:
      kind: (ConfigMap|ServiceAccount|Deployment|ServiceMonitor|Role|RoleBinding|Service)
    patch: |-
      - op: add
        path: /metadata/namespace
        value: mariadb-system

But this can break anytime the chart or values.yaml is updated.

What did you expect to happen?

The resources must have a namespace like in previous versions.

How can we reproduce it (as minimally and precisely as possible)?

yaml
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: mariadb-system
helmCharts:
  - name: mariadb-operator
    repo: https://helm.mariadb.com/mariadb-operator
    version: 25.10.4
    releaseName: mariadb-operator
    namespace: mariadb-system

Expected output

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: mariadb-operator
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: mariadb-operator
    app.kubernetes.io/version: 25.10.4
    helm.sh/chart: mariadb-operator-25.10.4
  name: mariadb-operator
  namespace: mariadb-system
spec:
...

Actual output

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: mariadb-operator
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: mariadb-operator
    app.kubernetes.io/version: 25.10.4
    helm.sh/chart: mariadb-operator-25.10.4
  name: mariadb-operator
spec:
...

Kustomize version

5.8.0

Operating system

Linux

Source: kubernetes-sigs/kustomize