Azure
跟随这些指令来为 Istio 准备一个 Azure 集群。
你可以通过完全支持 Istio 的 AKS 或者 AKS-Engine,部署一个 Kubernetes 集群到 Azure 上。
AKS
你可以通过 the az cli 或者 the Azure portal 创建一个 AKS 集群。
对于 az cli 的选项,完成 az login 认证或者使用 cloud shell,然后运行下面的命令。
确定支持 AKS 的期望 region 名
$ az provider list --query "[?namespace=='Microsoft.ContainerService'].resourceTypes[] | [?resourceType=='managedClusters'].locations[]" -o tsv
证实对于期望的 region 有支持的 Kubernetes 版本
使用从上面步骤中期望的 region 值替换
my location,然后执行:$ az aks get-versions --location "my location" --query "orchestrators[].orchestratorVersion"
确保最小值
1.10.5被列出。创建 resource group 和部署 AKS 集群
使用期望的名字替换
myResourceGroup和myAKSCluster,使用第一步中的名字替换mylocation,替换1.10.5如果其在 region 中不被支持,然后执行:$ az group create --name myResourceGroup --location "my location"$ az aks create --resource-group myResourceGroup --name myAKSCluster --node-count 3 --kubernetes-version 1.10.5 --generate-ssh-keys
取得 AKS
kubeconfig证书使用从之前步骤中获得的名字替换
myResourceGroup和myAKSCluster并且执行:$ az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
AKS-Engine
跟随这些命令来获取和安装
aks-engine的二进制版本。下载支持部署 Istio 的
aks-engineAPI 模型定义:$ wget https://raw.githubusercontent.com/Azure/aks-engine/master/examples/service-mesh/istio.json
注意:可能使用其他可以和 Istio 一起工作的 api 模型定义。MutatingAdmissionWebhook 和 ValidatingAdmissionWebhook 准入控制标识和 RBAC 被默认打开。从 aks-engine api 模型默认值获取更多信息。
使用
istio.json模板来部署你的集群。你能发现对于参数的参考在 官方文档中。参数 期望值 subscription_idAzure Subscription Id dns_prefix集群 DNS 前缀 location集群位置 $ aks-engine deploy --subscription-id <subscription_id> \--dns-prefix <dns_prefix> --location <location> --auto-suffix \--api-model istio.json
几分钟之后,你能发现你的集群在你的 Azure subscription 上的 resource group 里被叫做
<dns_prefix>-<id>。假设dns_prefix有这样的值myclustername,一个带着唯一集群 IDmycluster-5adfba82的有效的 resource group。aks-engine在_output文件夹中生成你的kubeconfig文件。使用
<dns_prefix>-<id>集群 ID,为了从_output文件夹复制你的kubeconfig到你的机器:$ cp _output/<dns_prefix>-<id>/kubeconfig/kubeconfig.<location>.json \~/.kube/config
比如:
$ cp _output/mycluster-5adfba82/kubeconfig/kubeconfig.westus2.json \~/.kube/config