简体   繁体   中英

How to deploy Istio on AKS Cluster through Azure DevOps pipeline?

I need to deploy Istio (version- 1.7.3) on AKS cluster through Azure DevOps YAML pipeline? How can I do that? I am getting error currently. Code used by me is given below.

$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"

My pipeline task does not give me any error (I am calling powershell file with script which is added in pipeline as Azure CLI task) but I guess, the error might at the last line of code above. I am missing anything else to add here as I am totally clueless about the error.

On using "kubectl get all -n istio-operator" the output I get is "No resources found in istio-operator namespace."

Update:-

$istioctl = "$PSScriptRoot/artifacts/istio-$IstioVersion/bin/istioctl

When above line is used, the error is-

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

But when above line is used ( .exe added ), the error is-

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

The issue seems resolved now. No problem in code. The issue was with pool vmimage in pipeline. By mistake, I was using ububtu image instead of windows.

Incorrect:- vmImage: 'ubuntu-latest'

Correct:- vmImage: 'windows-latest'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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