在部署多容器吊舱中的头盔图表时,如何覆盖值?

时间:2019-08-04 21:55:07

标签: docker kubernetes kubernetes-helm

我在values.yaml中有一个定义,可以在一个pod中部署2个容器。 运行自定义CI / CD管道时,我想覆盖更改的容器的标记(版本)。

通常我会这样做:

helm upgrade --install app-pod-testing --set container.tag=0.0.2

values.yaml定义了2个容器:

containers:
        - repo: services/qa/helloworld1
          tag: 843df3a1fcc87489d7b52b152c50fc6a9d59744d
          pullPolicy: Always
          ports:
            container: 8080
          resources:
              limits:
                memory: 128Mi
          securityContext:
            allowPrivilegeEscalation: false
        - repo: services/qa/helloword2 
          tag: bdaf287eaa3a8f9ba89e663ca1c7785894b5128f
          pullPolicy: Always
          ports:
            container: 9080
          resources:
              limits:
                memory: 128Mi
          securityContext:
            allowPrivilegeEscalation: true

在部署过程中,如何设置仅覆盖回购服务/ qa / helloword2的标记? 任何帮助/建议都表示感谢。

2 个答案:

答案 0 :(得分:1)

要做:

helm upgrade --install app-pod-testing --set containers[1].tag=0.0.2

请参见Helm docs

答案 1 :(得分:0)

您是这个头盔图表的作者吗?如果是,则可以为模板中的每个容器使用不同的属性路径。

相关问题