How to set a different namespace for child helm charts?

我的未来我决定 提交于 2019-12-01 03:24:36

问题


When you install a chart with a child chart that doesn't specify a namespace, Helm will use the one specified on command line via --namespace. Is it possible to override this flag for a specific child chart?

For example if I have chart A which depends on chart B and I specify --namespace foo, I want to be able to customize the resources of chart B to be installed into some other namespace bar instead of foo.


回答1:


Update 2: Helm 3 added support for multi namespaces https://github.com/helm/helm/issues/2060

Update 1: If a resource template specifies a metadata.namespace, then it will be installed in that namespace. For example, if I have a pod with metadata.namespace: x and I run helm install mychart --namespace y, that pod will be installed in x. I guess you could use regular helm templates with the namespace to parameterize it.

Original answer:

We do not plan on fully supporting multi-namespaced releases until Helm 3.0 https://github.com/kubernetes/helm/issues/2060#issuecomment-306847365

As a workaround, you install for each namespace individually using --skip-dependencies or with dependency conditions



来源:https://stackoverflow.com/questions/51072849/how-to-set-a-different-namespace-for-child-helm-charts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!