简体   繁体   English

azure 管道的 HELM 升级/安装问题

[英]HELM upgrade/install issue with azure pipelines

I am trying to create a new namespace and install release name in azure pipelines, but my pipelines are getting timed-out after an hour.我正在尝试在 azure 管道中创建一个新的命名空间并安装版本名称,但我的管道在一小时后超时。

Here's the code:这是代码:

- task: HelmDeploy@0 
  displayName: Dry run for upgrade 
  inputs: 
    connectionType: $(connectionType) 
    azureSubscription: $(azureServiceConnection) 
    azureResourceGroup: $(azureResourceGroup) 
    kubernetesCluster: $(kubernetesCluster) 
    namespace: '$(namespace)' 
    command: 'upgrade' 
    chartType: 'Name' 
    chartName: $(chartName) 
    releaseName: $(releaseName) 
    valueFile: $(valueFile) 
    install: true 
    waitForExecution: true 
    arguments: '--timeout 1h0m0s --create-namespace --install'

Can someone help with this case?有人可以帮忙处理这个案子吗?

The answer (which took me about a day of reading the docs to work out as I had the same issue) is simply that your HelmDeploy task requires internal Admin RBAC permissions.答案(我花了大约一天的时间阅读文档,因为我遇到了同样的问题)只是您的 HelmDeploy 任务需要内部管理员 RBAC 权限。

The absolute easiest way to fix your code is to add useClusterAdmin: true to your HelmDeploy@0 task eg add the last line:修复代码最简单的方法是将useClusterAdmin: true添加到HelmDeploy@0任务,例如添加最后一行:

- task: HelmDeploy@0 
  displayName: Dry run for upgrade 
  inputs: 
    connectionType: $(connectionType) 
    azureSubscription: $(azureServiceConnection) 
    azureResourceGroup: $(azureResourceGroup) 
    kubernetesCluster: $(kubernetesCluster)
    namespace: '$(namespace)' 
    command: 'upgrade' 
    chartType: 'Name' 
    chartName: $(chartName) 
    releaseName: $(releaseName) 
    valueFile: $(valueFile) 
    install: true 
    waitForExecution: true 
    arguments: '--timeout 1h0m0s --create-namespace --install'
    useClusterAdmin: true

For clarity, this will bypass your cluster's RBAC permissions.为清楚起见,这将绕过集群的 RBAC 权限。 If you wanted something more granular, then referring tothis dicussion , you'd have to not use the dedicated HelmDeploy task, and use AzureCLI@2 with helm upgrade... .如果你想要更精细的东西,那么参考这个讨论,你不必使用专用的 HelmDeploy 任务,而是使用AzureCLI@2 with helm upgrade...

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

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