如何通过 Azure DevOps 管道在 AKS 集群上部署 Istio?
How to deploy Istio on AKS Cluster through Azure DevOps pipeline?
我需要通过 Azure DevOps YAML 管道在 AKS 集群上部署 Istio(版本 - 1.7.3)?我怎样才能做到这一点 ?我目前收到错误。下面给出了我使用的代码。
$artifactsLocation = "$PSScriptRoot/artifacts"
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -URI "https://github.com/istio/istio/releases/download/$IstioVersion/istio-$IstioVersion-win.zip" -OutFile "$artifactsLocation/istio-$IstioVersion.zip"
Expand-Archive -Path "$artifactsLocation/istio-$IstioVersion.zip" -DestinationPath $artifactsLocation
kubectl create namespace istio-system --save-config
$istioctl = "$PSScriptRoot/artifacts/istio-$IstioVersion/bin/istioctl.exe
Invoke-Expression "$istioctl install -f $kubernetesInfrastructurePath/aks/yaml/istio.servicemesh.yaml"
我的管道任务没有给我任何错误(我正在使用脚本调用 powershell 文件,该脚本作为 Azure CLI 任务添加到管道中),但我猜,错误可能出现在上面代码的最后一行。由于我对错误完全一无所知,因此我缺少任何其他要添加的内容。
在使用“kubectl get all -n istio-operator”时,我得到的输出是“在 istio-operator 命名空间中找不到资源”。
更新:-
$istioctl = "$PSScriptRoot/artifacts/istio-$IstioVersion/bin/istioctl
当使用上一行时,错误是-
The term '/home/vsts/work/1/s/pipelines/scripts/aks/artifacts/istio-1.7.3/bin/istioctl' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
$istioctl = "$PSScriptRoot/artifacts/istio-$IstioVersion/bin/istioctl.exe
但是当使用上一行时(.exe added),错误是-
Error: no "view" mailcap rules found for type "application/x-msdos-program. /usr/bin/xdg-open: 869: www-browser: not found. /usr/bin/xdg-open: 869: links2: not found. /usr/bin/xdg-open: 869: elinks: not found. /usr/bin/xdg-open: 869: links: not found. /usr/bin/xdg-open: 869: lynx: not found
. /usr/bin/xdg-open: 869: w3m: not found
. xdg-open: no method available for opening '/home/vsts/work/1/s/pipelines/scripts/aks/artifacts/istio-1.7.3/bin/istioctl.exe
问题现在似乎已经解决了。代码没有问题。问题在于管道中的池 vmimage。我错误地使用了 ububtu 图像而不是 windows。
不正确:-
vmImage: 'ubuntu-latest'
正确:-
vmImage: 'windows-latest'
我需要通过 Azure DevOps YAML 管道在 AKS 集群上部署 Istio(版本 - 1.7.3)?我怎样才能做到这一点 ?我目前收到错误。下面给出了我使用的代码。
$artifactsLocation = "$PSScriptRoot/artifacts"
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -URI "https://github.com/istio/istio/releases/download/$IstioVersion/istio-$IstioVersion-win.zip" -OutFile "$artifactsLocation/istio-$IstioVersion.zip"
Expand-Archive -Path "$artifactsLocation/istio-$IstioVersion.zip" -DestinationPath $artifactsLocation
kubectl create namespace istio-system --save-config
$istioctl = "$PSScriptRoot/artifacts/istio-$IstioVersion/bin/istioctl.exe
Invoke-Expression "$istioctl install -f $kubernetesInfrastructurePath/aks/yaml/istio.servicemesh.yaml"
我的管道任务没有给我任何错误(我正在使用脚本调用 powershell 文件,该脚本作为 Azure CLI 任务添加到管道中),但我猜,错误可能出现在上面代码的最后一行。由于我对错误完全一无所知,因此我缺少任何其他要添加的内容。
在使用“kubectl get all -n istio-operator”时,我得到的输出是“在 istio-operator 命名空间中找不到资源”。
更新:-
$istioctl = "$PSScriptRoot/artifacts/istio-$IstioVersion/bin/istioctl
当使用上一行时,错误是-
The term '/home/vsts/work/1/s/pipelines/scripts/aks/artifacts/istio-1.7.3/bin/istioctl' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
$istioctl = "$PSScriptRoot/artifacts/istio-$IstioVersion/bin/istioctl.exe
但是当使用上一行时(.exe added),错误是-
Error: no "view" mailcap rules found for type "application/x-msdos-program. /usr/bin/xdg-open: 869: www-browser: not found. /usr/bin/xdg-open: 869: links2: not found. /usr/bin/xdg-open: 869: elinks: not found. /usr/bin/xdg-open: 869: links: not found. /usr/bin/xdg-open: 869: lynx: not found . /usr/bin/xdg-open: 869: w3m: not found . xdg-open: no method available for opening '/home/vsts/work/1/s/pipelines/scripts/aks/artifacts/istio-1.7.3/bin/istioctl.exe
问题现在似乎已经解决了。代码没有问题。问题在于管道中的池 vmimage。我错误地使用了 ububtu 图像而不是 windows。
不正确:- vmImage: 'ubuntu-latest'
正确:- vmImage: 'windows-latest'