首页 > 解决方案 > Istioctl 运算符 init 在 Azure Devops 管道中不起作用

问题描述

我的 AKS 群集在 Azure 中运行。我的 Azure DevOps 管道具有到此 AKS 群集的服务连接。我想从 Azure DevOps Pipeline 运行 istioctl 作为任务。我尝试添加 Istio 任务并想运行 istioctl operator init。

操作员初始化步骤失败。可以请一些帮助。 在此处输入图像描述 在此处输入图像描述

标签: istioazure-aks

解决方案


我改为使用 Azure CLI 任务而不是第三方 Istio 任务。我可以通过 Azure Pipeline 在 AKS 集群上安装 Istio。在运行之前在设置级别做的几件事 1) 下载 Istio 2) operator init 等是 1) Azure 订阅需要在行内脚本中设置,然后 2) 上下文到资源组和我的 aks 集群 3) 转换了我的到 yaml 的经典管道。..这里是用于通过 azure 管道安装 istio 的工作 yaml 管道,用于 uat、staging、prod 等上层环境,我们不需要一一运行命令。感谢使用 shell 而不是使用第 3 个的想法派对。

 trigger: none 

 jobs:
 - job: Job_1
   displayName: Agent job 1
   pool:
     vmImage: ubuntu-20.04
   steps:
   - checkout: self
   - task: AzureCLI@2
     displayName: Azure CLI [ 1 ]
     inputs:
       connectedServiceNameARM: $(DEV-CONN-SVC-NAME-ARM)
       scriptType: bash
       scriptLocation: inlineScript
       inlineScript: >-
    
         az account set --subscription $(DEV-SUBSCRIPTION)
         az aks get-credentials --resource-group $(DEV-RESOURCE-GROUP) --name $(DEV-RESOURCE-NAME)

         ls -lrt

         pwd

         curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.9.1 sh -

         cd istio-1.9.1

         export PATH=$PWD/bin:$PATH

         echo "run istioctl version"

         echo "************************************************************"

         istioctl version

         echo "************************************************************"

         echo "run istioctl operator init"

         echo "************************************************************"

         istioctl operator init

         echo "************************************************************"

推荐阅读