简体   繁体   English

将 Helm 模板安装到特定的命名空间

[英]Install Helm template into specific namespace

I'm installing argocd, but I want to include the official install yaml in a helm chart, but the kubectl command uses a namespace declaration as follows:我正在安装 argocd,但我想在 helm chart 中包含官方安装 yaml,但是kubectl命令使用如下命名空间声明:

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

I attempted to install the file as part of the helm chart in templates/ , and added namespace: argocd to each object's metadata in the file.我尝试将该文件安装为templates/掌舵图表的一部分,并将namespace: argocd添加到文件中每个对象的元数据中。

I also have helm creating the namespace, and according to the docs, it'll create the namespace first, so that can't be the issue.我也掌舵创建了命名空间,根据文档,它会首先创建命名空间,所以这不是问题。

What happens is all pods start in the default namespace.发生的情况是所有 pod 都在默认命名空间中启动。

Is there a way to have helm run an option similar to -n argocd on just that template, maybe in the Chart.yaml file?有没有办法让 helm 在该模板上运行类似于-n argocd的选项,也许在Chart.yaml文件中? Or is there a more sensible way to approach this?或者有没有更明智的方法来解决这个问题?

Helm 本身支持命名空间参数https://helm.sh/docs/helm/helm_install/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM