charts icon indicating copy to clipboard operation
charts copied to clipboard

Missing Namespace in Service resources

Open carhartl opened this issue 2 years ago • 2 comments

The namespace that can be passed as Helm value isn't picked up in the Service resources part of the chart:

apiVersion: v1
kind: Service
metadata:
  name: {{ $root.Values.oldNamingStyle | ternary $endpoint.name (printf "%s-%s" (include "yugabyte.fullname" $root) $endpoint.name) | quote }}
  annotations:
...

=>

apiVersion: v1
kind: Service
metadata:
  name: {{ $root.Values.oldNamingStyle | ternary $endpoint.name (printf "%s-%s" (include "yugabyte.fullname" $root) $endpoint.name) | quote }}
  namespace: "{{ $root.Release.Namespace }}"
  annotations:
...

I was expecting all resources to be part of the namespace I'm specifying in the chart.

Similar to #64

carhartl avatar Jan 10 '23 06:01 carhartl

Workaround in my case:

---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
  - name: yugabyte
    releaseName: yugabytedb
    repo: https://charts.yugabyte.com
    version: 2.17.0
    namespace: yugabytedb-system
    valuesInline:
      replicas:
        master: 1
        tserver: 1
      resource:
        master:
          requests:
            cpu: 0.5
            memory: 0.5Gi
        tserver:
          requests:
            cpu: 0.5
            memory: 0.5Gi
patches:
  - patch: |-
      - op: add
        path: /metadata/namespace
        value: yugabytedb-system
    target:
      version: v1
      kind: Service
      name: yb-.*

carhartl avatar Jan 10 '23 06:01 carhartl

@carhartl : Thanks for letting us know. Please feel free to send over a PR, otherwise, we will include this in our bug prioritization.

iSignal avatar Feb 06 '23 17:02 iSignal