在旁边安装更新版本的图表

huangapple go评论56阅读模式
英文:

Install newer version of chart side by side

问题

我正在尝试使用Istio实施金丝雀部署,但首先我必须部署旧版本的图表Pod(已成功完成),以及新版本的图表Pod。
我创建了一个新版本的图表。图表已成功创建。
现在,我尝试使用helm install命令将新版本与旧版本并行部署。
我将一个新的发布名称传递给该命令,以避免覆盖旧版本my-release-v2,但我收到一个错误,指出“图表中的发布名称必须与发布名称匹配”。
在这个阶段,我有点困惑。我是否应该在values.yaml中覆盖它,如果是 - 如何确切地做到这一点?这是否是最佳实践?

英文:

I'm trying to implement canary deployment with Istio but first I have to deploy chart pods from the old version (Already managed to do it) and chart pods from the new version.
I created a new version of my chart. The chart has been created successfully.
Now I try to use helm install command to deploy the new version side by side with the old one.
I pass a new release name to the command in order to avoid overriding the old version my-release-v2 but I get an error that the release name in the chart must match the release name.
At this stage I'm a bit puzzled. Should I override it in the values.yaml if so - How exactly? Is this a best practice?

答案1

得分: 0

好的,我理解了这一点,如果对某人有所帮助。 发布名称应该是唯一的。一个好的做法是在我们的 helm install 命令中使用我们的应用程序名称 Chart.AppName.fullname 以及预期版本。 然后,我们可以对部署我们的Pod的 Deployment 对象使用相同的做法,使其与版本唯一对应。(deployment.yaml 中的相关部分)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include ".Chart.Name.fullname" . }}-{{ .Chart.AppVersion }}

当然,对于将来在 Istio 中创建选择器,也要在Pod中创建一个版本标签(deployment.yaml 中的相关部分):

apiVersion: apps/v1
kind: Deployment
spec:
  replicas: {{ .Values.replicaCount }}
  template:
    metadata:
      labels:
        app.kubernetes.io/version: {{ .Chart.AppVersion }}
英文:

OK, I got this one is case it helps someone.
The release name should be unique. A good practice is to use our application name Chart.AppName.fullname along with the intended version in our helm install conmmand.
Then, we can use the same practice for our Deployment object that deploys our pods so it will be unique to the version. (Relevant part in the deployment.yaml)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include ".Chart.Name.fullname" . }}-{{ .Chart.AppVersion }}

And of course for a future selector in Istio create a version label in the pods (Relevant part in the deployment.yaml):

apiVersion: apps/v1
kind: Deployment
spec:
  replicas: {{ .Values.replicaCount }}
  template:
    metadata:
      labels:
        app.kubernetes.io/version: {{ .Chart.AppVersion }}

</details>



huangapple
  • 本文由 发表于 2023年1月9日 01:04:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75049751.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定