无法更改代理VM计数

时间:2017-03-24 07:01:33

标签: azure kubernetes azure-container-service

我有一个ACS Kubernetes集群,它是在代理计数为1的情况下创建的。我去了门户网站,将代理计数增加到2,并收到一个通用错误,指出为容器服务配置资源失败。 / p>

error!

查看活动日志,可以获得更多信息。

  

Write ContainerServices - PreconditionFailed - 为容器服务'xxxxxxx'提供资源   资源组'xxxxxxxx'失败。

  

验证 - InvalidTemplate - 部署模板验证失败:'资源'Microsoft.Network/networkSecurityGroups/k8s-master-3E4D5818-nsg'未在模板中定义。有关使用详情,请参阅https://aka.ms/arm-template。'。

尝试通过Azure CLI 2.0进行更改也会返回相同的错误。

更新:根据quickstart templates repo中的示例,使用具有单个容器服务资源的ARM模板启动群集。

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "dnsNamePrefix": {
      "type": "string",
      "metadata": {
        "description": "Sets the Domain name prefix for the cluster.  The concatenation of the domain name and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address."
      }
    },
    "agentCount": {
      "type": "int",
      "defaultValue": 1,
      "metadata": {
        "description": "The number of agents for the cluster.  This value can be from 1 to 100 (note, for Kubernetes clusters you will also get 1 or 2 public agents in addition to these seleted masters)"
      },
      "minValue":1,
      "maxValue":100
    },
    "agentVMSize": {
      "type": "string",
      "defaultValue": "Standard_D2_v2",
      "allowedValues": [
            "Standard_A0", "Standard_A1", "Standard_A2", "Standard_A3", "Standard_A4", "Standard_A5",
            "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A9", "Standard_A10", "Standard_A11",
            "Standard_D1", "Standard_D2", "Standard_D3", "Standard_D4",
            "Standard_D11", "Standard_D12", "Standard_D13", "Standard_D14",
            "Standard_D1_v2", "Standard_D2_v2", "Standard_D3_v2", "Standard_D4_v2", "Standard_D5_v2",
            "Standard_D11_v2", "Standard_D12_v2", "Standard_D13_v2", "Standard_D14_v2",
            "Standard_G1", "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5",
            "Standard_DS1", "Standard_DS2", "Standard_DS3", "Standard_DS4",
            "Standard_DS11", "Standard_DS12", "Standard_DS13", "Standard_DS14",
            "Standard_GS1", "Standard_GS2", "Standard_GS3", "Standard_GS4", "Standard_GS5"
      ],
      "metadata": {
        "description": "The size of the Virtual Machine."
      }
    },
    "linuxAdminUsername": {
      "type": "string",
      "defaultValue": "azureuser",
      "metadata": {
        "description": "User name for the Linux Virtual Machines."
      }
    },
    "orchestratorType": {
      "type": "string",
      "defaultValue": "Kubernetes",
      "allowedValues": [
        "Kubernetes",
        "DCOS",
        "Swarm"
      ],
      "metadata": {
        "description": "The type of orchestrator used to manage the applications on the cluster."
      }
    },
    "masterCount": {
      "type": "int",
      "defaultValue": 1,
      "allowedValues": [
        1
      ],
      "metadata": {
        "description": "The number of Kubernetes masters for the cluster."
      }
    },
    "sshRSAPublicKey": {
      "type": "string",
      "metadata": {
        "description": "Configure all linux machines with the SSH RSA public key string.  Your key should include three parts, for example 'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm'"
      }
    },
    "servicePrincipalClientId": {
      "metadata": {
        "description": "Client ID (used by cloudprovider)"
      },
      "type": "securestring",
      "defaultValue": "n/a"
    },
    "servicePrincipalClientSecret": {
      "metadata": {
        "description": "The Service Principal Client Secret."
      },
      "type": "securestring",
      "defaultValue": "n/a"
    }
  },
  "variables": {
    "adminUsername":"[parameters('linuxAdminUsername')]",
    "agentCount":"[parameters('agentCount')]",
    "agentsEndpointDNSNamePrefix":"[concat(parameters('dnsNamePrefix'),'agents')]",
    "agentVMSize":"[parameters('agentVMSize')]",
    "masterCount":"[parameters('masterCount')]",
    "mastersEndpointDNSNamePrefix":"[concat(parameters('dnsNamePrefix'),'mgmt')]",
    "orchestratorType":"[parameters('orchestratorType')]",
    "sshRSAPublicKey":"[parameters('sshRSAPublicKey')]",
    "servicePrincipalClientId": "[parameters('servicePrincipalClientId')]",
    "servicePrincipalClientSecret": "[parameters('servicePrincipalClientSecret')]",
    "useServicePrincipalDictionary": {
      "DCOS": 0,
      "Swarm": 0,
      "Kubernetes": 1
    },
    "useServicePrincipal": "[variables('useServicePrincipalDictionary')[variables('orchestratorType')]]",
    "servicePrincipalFields": [
      null,
      {
        "ClientId": "[parameters('servicePrincipalClientId')]",
        "Secret": "[parameters('servicePrincipalClientSecret')]"
      }
    ]
  },
  "resources": [
    {
      "apiVersion": "2016-09-30",
      "type": "Microsoft.ContainerService/containerServices",
      "location": "[resourceGroup().location]",
      "name":"[resourceGroup().name]",
      "properties": {
        "orchestratorProfile": {
          "orchestratorType": "[variables('orchestratorType')]"
        },
        "masterProfile": {
          "count": "[variables('masterCount')]",
          "dnsPrefix": "[variables('mastersEndpointDNSNamePrefix')]"
        },
        "agentPoolProfiles": [
          {
            "name": "agentpools",
            "count": "[variables('agentCount')]",
            "vmSize": "[variables('agentVMSize')]",
            "dnsPrefix": "[variables('agentsEndpointDNSNamePrefix')]"
          }
        ],
        "linuxProfile": {
          "adminUsername": "[variables('adminUsername')]",
          "ssh": {
            "publicKeys": [
              {
                "keyData": "[variables('sshRSAPublicKey')]"
              }
            ]
          }
        },
        "servicePrincipalProfile": "[variables('servicePrincipalFields')[variables('useServicePrincipal')]]"
      }
    }
  ],
  "outputs": {
    "masterFQDN": {
      "type": "string",
      "value": "[reference(concat('Microsoft.ContainerService/containerServices/', resourceGroup().name)).masterProfile.fqdn]"
    },
    "sshMaster0": {
      "type": "string",
      "value": "[concat('ssh ', variables('adminUsername'), '@', reference(concat('Microsoft.ContainerService/containerServices/', resourceGroup().name)).masterProfile.fqdn, ' -A -p 22')]"
    },
    "agentFQDN": {
      "type": "string",
      "value": "[reference(concat('Microsoft.ContainerService/containerServices/', resourceGroup().name)).agentPoolProfiles[0].fqdn]"
    }
  }
}

2 个答案:

答案 0 :(得分:2)

这是旧群集的已知服务问题。目前正在推出修复程序,并在此github问题https://github.com/Azure/ACS/issues/16

中进行跟踪

杰克(ACS团队的开发人员)

答案 1 :(得分:0)

我在我的实验室中使用此模板进行了测试,但我无法重现您的错误。 请尝试使用azure resource explorer编辑代理池的计数:

enter image description here