0

尝试在 GKE 博客文章上为我的 MongoDB做一个等效的,用于 Azure 容器服务,但在第一个障碍中失败了。我的博客文章基于使用每个云提供商的免费层/帐户中可用的配额,以帮助新用户在继续使用付费层之前评估选项。但是,在创建了一个 Azure 免费帐户后,我似乎无法创建一个保持在“核心限制”以下的 k8s 集群(在这种情况下,我假设这意味着保持在相当于“vCPUs”的免费阈值以下)。

当我运行以下内容时:

az acs create --orchestrator-type kubernetes --resource-group MongoResourceGroup --name MongoK8sCluster --generate-ssh-keys

结果是:

Deployment failed. { "code": "BadRequest", "message": "An error has occurred in subscription 0657d162-d822-48f5-bbe9-4bcaac4f40e4, zesourceGroup: MongoResourceGroup request: Provisioning of resource(s) for container service MongoK8sCluster in resource group MongoResourceGroup failed. Message: {\n  \"code\": \"QuotaExceeded\",\n  \"message\": \"Provisioning of resource(s) for container service MongoK8sCluster in resource group MongoResourceGroup failed. Message: Operation results in exceeding quota limits of Core. Maximum allowed: 4, Current in use: 0, Additional requested: 8.. Details: \"\n }. Details: <no value>."

我试图指定一种较小类型的虚拟机,但我似乎不太明白:

az acs create --orchestrator-type kubernetes --resource-group MongoResourceGroup --name MongoK8sCluster --agent-vm-size Standard_A0 --generate-ssh-keys

Deployment failed. { "code": "BadRequest", "message": "An error has occurred in subscription 0657d162-d822-48f5-bbe9-4bcaac4f40e4, resourceGroup: MongoResourceGroup request: Provisioning of resource(s) for container service MongoK8sCluster in resource group MongoResourceGroup failed. Message: {\n  \"code\": \"QuotaExceeded\",\n  \"message\": \"Provisioning of resource(s) for container service MongoK8sCluster in resource group MongoResourceGroup failed. Message: Operation results in exceeding quota limits of Core. Maximum allowed: 4, Current in use: 0, Additional requested: 5.. Details: \"\n }. Details: <no value>.

有什么建议可以让 k8s 示例项目核心数量减少到足以在免费帐户阈值内?

4

2 回答 2

3

根据此处的文档https://docs.microsoft.com/en-us/cli/azure/acs#create默认代理计数为 3,默认 master-vm-size 为标准 D2_v2。这使得核心要求是

3(agents)*1(core) + 1(master)*2(core) = 5

由于您有 4 个内核可用,您应该尝试设置:

 1. agent-count to be 3
 2. agent-vm-size to be Standard_A0

或者

 1. agent-count to be 1
 2. agent-vm-size to be Standard_D11_v2

我更喜欢选项 (2),因为这将在代理节点上提供足够的内存和 IOPS。保持 master-vm-size 默认值,Standard D2_v2因为 etcd 和 kubenetes 容器需要足够的内存才能运行。

于 2017-08-16T02:35:22.377 回答
0

使用以下配置会有所帮助。

  • --master-count 1 => Standard_A2 (2 cpu) => 2 cpu
  • --agent-count 2 => Standard_A1 (1 cpu x 2) => 2 cpu

此配置将创建一个具有免费帐户限制的集群

az acs create -n "your-kubernetes-cluster" -g your-resource-group --master-vm-size Standard_A2 --agent-count 2 --agent-vm-size Standard_A1 --dns-prefix kube --orchestrator-type kubernetes --debug
于 2017-09-26T09:36:27.563 回答