Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding namespace from values.yaml #8387

Open
monwolf opened this issue Nov 11, 2024 · 3 comments
Open

Allow overriding namespace from values.yaml #8387

monwolf opened this issue Nov 11, 2024 · 3 comments
Labels
Helm Issues related to Helm charts

Comments

@monwolf
Copy link

monwolf commented Nov 11, 2024

I have a unique helm chart for managing all the stuff in my eks cluster. We have some sub-charts, such as Prometheus, that allow overriding the namespace. This is a useful feature because, with one chart, you can have multiple applications isolated in different namespaces.

They implemented this using a macro:

  namespace: {{ include "prometheus.namespace" . }}
{{/*
Define the prometheus.namespace template if set with forceNamespace or .Release.Namespace is set
*/}}
{{- define "prometheus.namespace" -}}
  {{- default .Release.Namespace .Values.forceNamespace -}}
{{- end }}

Could you add something like this to your chart?

@blackpiglet blackpiglet added the Helm Issues related to Helm charts label Nov 11, 2024
@blackpiglet
Copy link
Contributor

@jenting Please help take a look.

@jenting
Copy link
Contributor

jenting commented Nov 11, 2024

@monwolf
Copy link
Author

monwolf commented Nov 11, 2024

Nope, I don't.

I have this chart definition:

apiVersion: v2
name: my-eks-appliers
description: A Helm chart for Kubernetes
type: application
version: 1.28.6
appVersion: "1.28.6"
dependencies:
  - name: my-basic-config
    repository: s3://my-helm3-appliers-repo/charts/
    version: 0.2.1
    condition: my-basic-config.enabled
  - name: prometheus
    repository: https://prometheus-community.github.io/helm-charts 
    version: 23.0.0 # 25.22.1 (23.0.0 es la compatible con la versión alojada en ECR)
    condition: prometheus.enabled
  - name: velero
    repository: https://vmware-tanzu.github.io/helm-charts
    version: 7.1.0
    condition: velero.enabled

And In the values.yaml I would like to do:

my-basic-config
  enabled: true
  forceNamespace:  kube-system
  .....
prometheus:
  enabled: true
  forceNamespace:  monitoring
  ....

velero:
  enabled: true
  forceNamespace: velero
  ....

And then apply it by using

helm install my-appliers ..... -n whatever  

And each subchart stay in its namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Helm Issues related to Helm charts
Projects
None yet
Development

No branches or pull requests

3 participants