From 6942806f880160e1b994ace3d45e9bb2e1d3d890 Mon Sep 17 00:00:00 2001 From: Li Yi Date: Tue, 20 Nov 2018 01:19:08 +0800 Subject: [PATCH] Add windows support --- README.md | 32 ++++++++++++++++++++++++++++++-- getLatestIstio.ps1 | 21 +++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 getLatestIstio.ps1 diff --git a/README.md b/README.md index 548d8b5..6c96821 100644 --- a/README.md +++ b/README.md @@ -103,17 +103,33 @@ http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-da 可以根据文档安装 helm https://github.com/helm/helm/blob/master/docs/install.md +在 Mac OS 上执行如下命令 + ``` # Use homebrew on Mac brew install kubernetes-helm # Install Tiller into your Kubernetes cluster -helm init --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.11.0 +helm init --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.11.0 --skip-refresh + +# update charts repo (Optional) +helm repo update +``` + +在Windows上执行如下命令 + +``` +# Use Chocolatey on Windows +choco install kubernetes-helm + +# Install Tiller into your Kubernetes cluster +helm init --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.11.0 --skip-refresh -# update charts repo +# update charts repo (Optional) helm repo update ``` + ### 安装 Istio 可以根据文档安装 Istio https://istio.io/docs/setup/kubernetes/ @@ -126,6 +142,14 @@ cd istio-1.0.3/ export PATH=$PWD/bin:$PATH ``` +在Windows上,您可以手工下载Istio安装包,或者把```getLatestIstio.ps1```拷贝到你希望下载 Istio 的目录,并执行 - 说明:根据社区提供的[安装脚本](https://gist.github.com/kameshsampath/796060a806da15b39aa9569c8f8e6bcf)修改而来 + +``` +.\getLatestIstio.ps1 +``` + + + 通过 Helm chart 安装 Istio ``` @@ -160,6 +184,10 @@ export GATEWAY_URL=localhost:80 curl -o /dev/null -s -w "%{http_code}\n" http://${GATEWAY_URL}/productpage ``` +可以通过浏览器访问 + +http://localhost/productpage + 卸载 Istio ``` diff --git a/getLatestIstio.ps1 b/getLatestIstio.ps1 new file mode 100644 index 0000000..ed54c7e --- /dev/null +++ b/getLatestIstio.ps1 @@ -0,0 +1,21 @@ +param( + [string] $IstioVersion = "1.0.3" +) + +$url = "https://github.com/istio/istio/releases/download/$($IstioVersion)/istio-$($IstioVersion)-win.zip" +$Path = Get-Location +$output = [IO.Path]::Combine($Path, "istio-$($IstioVersion)-win.zip) + +Write-Host "Downloading Istio from $url to path " $Path -ForegroundColor Green + +#Download file +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +(New-Object System.Net.WebClient).DownloadFile($url, $output) + +# Unzip the Archive +Expand-Archive $output -DestinationPath $Path + +#Set the environment variable +$IstioHome = [IO.Path]::Combine($Path, "istio-$($IstioVersion)") + +[Environment]::SetEnvironmentVariable("ISTIO_HOME", "$IstioHome", "User") \ No newline at end of file