具有 Azure DevOps Pipeline 的 AKS Kubernetes - helm 升级错误

Sco*_*key 0 azure kubernetes azure-devops kubernetes-helm azure-aks

我是一个完全的 Azure DevOps 菜鸟,尝试在 Azure DevOps 中设置 AKS 集群和发布管道,以使用 Helm 部署到它。

我创建了(禁用 RBAC,以简化流程)一个 AKS 集群,将发布管道连接到它,使用 Azure Cloud Shell 连接到 AKS 集群并运行 helm init,但发布因以下问题而失败:

2018-12-14T16:35:55.9461744Z ##[section]Starting: helm upgrade <REDACTED>
2018-12-14T16:35:55.9467164Z ==============================================================================
2018-12-14T16:35:55.9467299Z Task         : Package and deploy Helm charts
2018-12-14T16:35:55.9467387Z Description  : Deploy, configure, update your Kubernetes cluster in Azure Container Service by running helm commands.
2018-12-14T16:35:55.9467647Z Version      : 0.138.14
2018-12-14T16:35:55.9467963Z Author       : Microsoft Corporation
2018-12-14T16:35:55.9468016Z Help         : [More Information](https://go.microsoft.com/fwlink/?linkid=851275)
2018-12-14T16:35:55.9468114Z ==============================================================================
2018-12-14T16:35:58.3023980Z [command]/opt/hostedtoolcache/helm/2.11.0/x64/linux-amd64/helm upgrade --namespace dev --install --recreate-pods --force --values /home/vsts/work/r1/a/_<REDACTED>/helm-charts/<REDACTED>/values-dev.yaml --set image.tag=development --wait <REDACTED> /home/vsts/work/r1/a/_<REDACTED>/helm-charts/<REDACTED>
2018-12-14T16:40:57.6309603Z Release "<REDACTED>" does not exist. Installing it now.
2018-12-14T16:40:57.6311297Z Error: release <REDACTED> failed: timed out waiting for the condition
2018-12-14T16:40:57.6428880Z ##[error]Error: release <REDACTED> failed: timed out waiting for the condition

2018-12-14T16:40:57.6440575Z ##[section]Finishing: helm upgrade <REDACTED>
Run Code Online (Sandbox Code Playgroud)

(注意,已删除敏感项目名称)。

edb*_*ead 5

由于您在部署中 使用--wait标志

如果设置,将等到 Deployment 的所有 Pod、PVC、Services 和最小数量的 Pod 都处于就绪状态,然后再将发布标记为成功。它会等待 --timeout

如果您有任何运行时间超过 300 秒的作业或挂钩,您可以使用--timeout n作业完成所需的秒数设置标志。

如果您的部署中没有运行任何作业:

  • 检查所有 Pod 是否都处于“就绪”状态。例如,如果您有任何 pod 处于CrashLoopBackoff状态,则 helm 将因超时而失败。
  • timeout如果您的 Pod 需要 300 秒以上才能进入就绪状态,请找到最佳方案。