如何通过azure模板将其他磁盘添加到AKS节点?

如何通过azure模板将其他磁盘添加到AKS节点?,azure,kubernetes,azure-aks,Azure,Kubernetes,Azure Aks,启动AKS群集时,我的每个节点在/dev/sdb处都有一个主磁盘,在/dev/sda处有一个较小的临时磁盘。如何将显示为/dev/sdc的附加未格式化磁盘附加到模板中的每个AKS节点。我当前的模板如下: { "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": {

启动AKS群集时,我的每个节点在
/dev/sdb
处都有一个主磁盘,在
/dev/sda
处有一个较小的临时磁盘。如何将显示为
/dev/sdc
的附加未格式化磁盘附加到模板中的每个AKS节点。我当前的模板如下:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "resourceGroupName": {
      "type": "string",
      "metadata": {
        "description": "The resource group name."
      }
    },
    "subscriptionId": {
      "type": "string",
      "metadata": {
        "description": "The subscription id."
      }
    },
    "region": {
      "type": "string",
      "metadata": {
        "description": "The region of AKS resource."
      }
    },
    "gbPerNode": {
      "type": "int",
      "defaultValue": 20,
      "metadata": {
        "description": "Disk size (in GB) to provision for each of the agent pool nodes. This value ranges from 0 to 1023. Specifying 0 will apply the default disk size for that agentVMSize."
      },
      "minValue": 1,
      "maxValue": 1023
    },
    "numNodes": {
      "type": "int",
      "defaultValue": 3,
      "metadata": {
        "description": "The number of agent nodes for the cluster."
      },
      "minValue": 1,
      "maxValue": 50
    },
    "machineType": {
      "type": "string",
      "defaultValue": "Standard_D2_v2",
      "metadata": {
        "description": "The size of the Virtual Machine."
      }
    },
    "servicePrincipalClientId": {
      "metadata": {
        "description": "Client ID (used by cloudprovider)"
      },
      "type": "securestring"
    },
    "servicePrincipalClientSecret": {
      "metadata": {
        "description": "The Service Principal Client Secret."
      },
      "type": "securestring"
    },
    "osType": {
      "type": "string",
      "defaultValue": "Linux",
      "allowedValues": [
        "Linux"
      ],
      "metadata": {
        "description": "The type of operating system."
      }
    },
    "kubernetesVersion": {
      "type": "string",
      "defaultValue": "1.11.4",
      "metadata": {
        "description": "The version of Kubernetes."
      }
    },
    "maxPods": {
      "type": "int",
      "defaultValue": 30,
      "metadata": {
        "description": "Maximum number of pods that can run on a node."
      }
    }
  },
  "variables": {
    "deploymentEventTopic": "deploymenteventtopic",
    "resourceGroupName": "[parameters('resourceGroupName')]",
    "omswsName": "[concat('omsws-', parameters('resourceGroupName'))]",
    "clustername": "cluster"
  },
  "resources": [
    {
      "apiVersion": "2018-03-31",
      "type": "Microsoft.ContainerService/managedClusters",
      "location": "[parameters('region')]",
      "name": "[variables('clustername')]",
      "properties": {
        "kubernetesVersion": "[parameters('kubernetesVersion')]",
        "enableRBAC": true,
        "dnsPrefix": "clust",
        "addonProfiles": {
          "httpApplicationRouting": {
            "enabled": true
          },
          "omsagent": {
            "enabled": false
          }
        },
        "agentPoolProfiles": [
          {
            "name": "agentpool",
            "osDiskSizeGB": "[parameters('gbPerNode')]",
            "count": "[parameters('numNodes')]",
            "vmSize": "[parameters('machineType')]",
            "osType": "[parameters('osType')]",
            "storageProfile": "ManagedDisks"
          }
        ],
        "servicePrincipalProfile": {
          "ClientId": "[parameters('servicePrincipalClientId')]",
          "Secret": "[parameters('servicePrincipalClientSecret')]"
        },
        "networkProfile": {
          "networkPlugin": "kubenet"
        }
      }
    }
  ]
}

不幸的是,似乎无法将磁盘添加到模板中的AKS节点。查看中的所有属性,没有可执行此操作的属性

如果您真的想向节点添加磁盘,也许可以手动将磁盘连接到AKS集群中的VM。看见实际上,集群中的节点是Azure虚拟机。所以你可以像在Azure虚拟机中那样做


但在我看来,如果需要更多的磁盘空间,最好在创建AKS集群时为节点更改更大的大小。请参阅模板中有关
osDiskSizeGB
vmSize
的属性。您可以根据需要向Pod添加持久卷。请看,我认为以这种方式使用磁盘更灵活、更高效。

不幸的是,您似乎无法将磁盘添加到模板中的AKS节点。查看中的所有属性,没有可执行此操作的属性

如果您真的想向节点添加磁盘,也许可以手动将磁盘连接到AKS集群中的VM。看见实际上,集群中的节点是Azure虚拟机。所以你可以像在Azure虚拟机中那样做


但在我看来,如果需要更多的磁盘空间,最好在创建AKS集群时为节点更改更大的大小。请参阅模板中有关
osDiskSizeGB
vmSize
的属性。您可以根据需要向Pod添加持久卷。请看,我认为这样使用磁盘更灵活、更高效。

对于具有更多磁盘的节点,模板应该是这样的:

{
    "name": "nodepool1",
    "count": 3,
    "vmSize": "Standard_B2ms",
    "osType": "Linux",
    "osDiskSizeGB": 64,
    "diskSizesGB": [
        10,
        10,
        10,
        10
    ]
}

不幸的是,尽管这是AKS的有效资源定义,但它还不起作用,但至少当它开始起作用时,您将只使用此代码段;)

对于具有更多磁盘的节点,模板应该是这样的:

{
    "name": "nodepool1",
    "count": 3,
    "vmSize": "Standard_B2ms",
    "osType": "Linux",
    "osDiskSizeGB": 64,
    "diskSizesGB": [
        10,
        10,
        10,
        10
    ]
}

不幸的是,尽管这是AKS的有效资源定义,但它还不起作用,但至少当它开始起作用时,您将只使用此代码段;)

嗯??更大的尺寸更多的磁盘?对不起?我是说更大的osDiskSizeGB,嗯?更大的尺寸更多的磁盘?对不起?我的意思是更大的osDiskSizeGB。这是一个满足更多数据磁盘需求的伟大设置:-)希望这在未来能够实现。这是满足更多数据磁盘需求的伟大设置:-)希望这在未来能够实现。