问题描述
我已经使用helm create
命令创建了基本的头盔模板.在检查Ingress模板时,添加字符串RELEASE-NAME和appname像这样RELEASE-NAME-microapp
I have created basic helm template using helm create
command. While checking the template for Ingress its adding the string RELEASE-NAME and appname like this RELEASE-NAME-microapp
如何更改.Release.Name
的值?
helm template --kube-version 1.11.1 microapp/
# Source: microapp/templates/ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: RELEASE-NAME-microapp
labels:
app: microapp
chart: microapp-0.1.0
release: RELEASE-NAME
heritage: Tiller
annotations:
kubernetes.io/ingress.class: nginx
推荐答案
这取决于您拥有的Helm版本; helm version
可以告诉你这一点.
This depends on what version of Helm you have; helm version
can tell you this.
在Helm版本2中,它是helm install --name
参数的值,或者缺少此值,Helm会自行选择一个名称.如果您要检查通过helm template
生成的内容,它也需要一个--name
参数.
In Helm version 2, it's the value of the helm install --name
parameter, or absent this, a name Helm chooses itself. If you're checking what might be generated via helm template
that also takes a --name
parameter.
在Helm版本3中,它是helm install
命令的第一个参数.除非您明确要求helm install --generate-name
,Helm不会自动生成名称. helm template
也采用相同的选项.
In Helm version 3, it's the first parameter to the helm install
command. Helm won't generate a name automatically unless you explicitly ask it to helm install --generate-name
. helm template
also takes the same options.
这篇关于掌舵如何定义.Release.Name值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!