多行覆盖值 Helm 安装 Azure DevOps

ejl*_*ouw 2 azure-devops kubernetes-helm azure-pipelines-yaml

是否可以在 Azure devOps 管道的 HelmDeploy 任务中指定要覆盖的值?例如,类似于下面的任务(显然不能完全按原样工作):

  - task: HelmDeploy@0
              displayName: 'helm install'
              inputs:
                connectionType: 'Azure Resource Manager'
                azureSubscription: '$(RM_SERVICE_CONNECTION_NAME)'
                azureResourceGroup: '$(AKS_RESOURCE_GROUP)'
                kubernetesCluster: '$(AKS_NAME)'
                namespace: '$(AKS_NAMESPACE)'
                command: 'install'
                chartType: 'FilePath'
                chartPath: '$(deploymentChartName)'
                releaseName: test-release
                overrideValues: |
                  value1='value_1'
                  value2='value_2'                 
Run Code Online (Sandbox Code Playgroud)

是否有任何类似于上述示例的格式可以工作?

Lev*_*SFT 5

恐怕overrideValues字段不能接受多行覆盖变量。正如文档所说,多个值应该用逗号分隔值key1=val1,key2=val2

但是,您可以尝试使用该arguments字段并传递变量。

见下文:

  - task: HelmDeploy@0
    displayName: 'helm install'
    inputs:
       connectionType: 'Azure Resource Manager'
       azureSubscription: '$(RM_SERVICE_CONNECTION_NAME)'
       ...
       ...
       arguments: >
          --set foo=bar
          --set foo1=bar1
          --set foo2=bar2
Run Code Online (Sandbox Code Playgroud)