0

I create Azure Kubernetes Service by Bicep like below.

param clusterName string = 'kubernetes'
param location string = resourceGroup().location

resource aksCluster 'Microsoft.ContainerService/managedClusters@2022-02-01' = {
  name: clusterName
  location: location
  sku: {
    name: 'Basic'
    tier: 'Free'
  }
  identity: {
    type: 'SystemAssigned'
  }
  properties: {
    kubernetesVersion: '1.23.5'
    enableRBAC: true
    agentPoolProfiles: [
      {
        name: 'agentpool'
        mode: 'System'
        type:'VirtualMachineScaleSets'
        orchestratorVersion: '1.23.5'
        enableAutoScaling: false
        enableFIPS: false
        maxPods: 110
        count: 1
        vmSize: 'Standard_B2s'
        osType:'Linux'
        osSKU:'Ubuntu'
        osDiskType: 'Managed'
        osDiskSizeGB: 0
        enableUltraSSD: false
        enableNodePublicIP: false
      }
    ]
    dnsPrefix: 'kubernetes-cluster-dns'
    networkProfile: {
      loadBalancerSku: 'basic'
      networkPlugin: 'kubenet'
    }
  }
}

Azure Kubernetes Service (AKS) create Virtual Machine Scale Set like below.

VMSS

I do not want to use Premium SSD LRS OS disk. It is too expensive for me while learning kubernetes. I want to change it to Standard SSD LRS.

What should I do?


2022.05.30 Update

I create an issue at Azure/bicep.

ibocon
  • 1,352
  • 3
  • 17
  • 40
  • I see you set the `rolling upgrade` status to `manual`. Have you tried this? – harshavmb May 11 '22 at 05:48
  • @harshavmb where can I set `rolling upgrade` to `manual`? I can not find `rolling update` related template parameter in [ARM Templates for AKS](https://learn.microsoft.com/en-us/azure/templates/microsoft.containerservice/managedclusters?tabs=bicep). – ibocon May 11 '22 at 06:07
  • It's already set to `manual` by default. I'm sorry it has to be `upgrade mode` rather `rolling upgrade` – harshavmb May 11 '22 at 06:16
  • you could change the `vmSize`. `Standard_B2s` only supports SSD disks – Thomas May 11 '22 at 07:10
  • @harshavmb I am little confused. How `upgarde mode` could related with **OS Disk SKU**? Should I change `ManagedClusterAutoUpgradeProfile` in ARM template to apply `rolling upgrade`? Or `AgentPoolUpgradeSettings`? – ibocon May 11 '22 at 07:44
  • @Thomas Then can I use **Standard SSD LRS** instead expensive Premium SSD LRS? – ibocon May 11 '22 at 07:46
  • Yeah you would need to check which vmSize support HDD only. – Thomas May 11 '22 at 08:46
  • I got an comment from [@Prrudram-MSFT at MS Q&A](https://learn.microsoft.com/en-us/answers/questions/844580/how-to-change-os-disk-sku-for-virtual-machine-scal.html). In short, there is no way to change AKS VMSS OS disk SKU (Premium SSD LRS). It is unchangeable for now. But It is strange because when creating VMSS, you can select Standard SSD LRS for OS disk SKU. – ibocon May 16 '22 at 00:17
  • 1
    hi @ibocon, not sure if you still need this, but if you create the cluster using Ephemeral osDisk, it will use standard HDD. – Steven.Xi Apr 26 '23 at 20:54
  • @Steven.Xi Thanks to letting me know that detail. – ibocon Apr 27 '23 at 04:42

1 Answers1

-1

Once an Azure resource is deployed, you cannot change its inherent hardware, i.e., disk storage, compute, and memory. Thus, as you have already deployed an AKS cluster with Linux VMs in ‘Standard_B2S’ format and not mentioned any configuration related to the type of disk storage to be used along with it, it usually goes with the default/top option available according to the Azure portal and underlying service fabric infrastructure.

Also, even if you check while creating a VM or VMSS in Azure, the first option for selecting the type of OS disk storage is always ‘Premium SSD (locally redundant storage)’ in the portal as shown below. Thus, due to which, you should have mentioned the ‘DiskSku: StandardSSD_LRS’ in your bicep template for you to deploy the AKS cluster VMs with standard HDDs.

Thus, now if you want to change the disk type after deploying the resources, it is not possible and you would need to redeploy the AKS cluster VMs for the disk type to be changed.

Disk Sku type

For more information, kindly refer to the documentation link below: -

https://learn.microsoft.com/en-us/azure/templates/microsoft.compute/disks?tabs=bicep#disksku

Kartik Bhiwapurkar
  • 4,550
  • 2
  • 4
  • 9
  • Then how can I connect new VMSS to **managedClusters(a.k.a AKS)**? When deploy AKS, it automatically creates VMSS, LB etc. And [managedCluster bicep template](https://learn.microsoft.com/en-us/azure/templates/microsoft.containerservice/managedclusters?tabs=bicep) does not give me an option to choose VM Disk SKU. Therefore I need to independently deploy VMSS first and connect that to AKS and remove previous VMSS. Is it possible? – ibocon May 24 '22 at 01:30
  • To configure the VMSS as a part of the AKS cluster, kindly refer to the link here as it explains the creation of an AKS cluster by using the VMSS/Container service feature of AKS. And as for choosing VM Disk SKU, kindly refer to the below documentation link that states the parameters necessary for VM Disk SKU: - https://learn.microsoft.com/en-us/azure/virtual-machines/using-managed-disks-template-deployments#standard-ssd-disks – Kartik Bhiwapurkar May 24 '22 at 11:17
  • Hi @ibocon, if the provided answer resolved your issue, you may mark it as answer or upvote it so that others who encounter the similar issue, it may be useful for them or community members. – Kartik Bhiwapurkar May 27 '22 at 05:31
  • The [link1](https://learn.microsoft.com/en-us/azure/templates/microsoft.compute/disks?tabs=bicep#disksku) and [link2](https://learn.microsoft.com/en-us/azure/virtual-machines/using-managed-disks-template-deployments#standard-ssd-disks), which you provide to me, does not mention AKS. It just tell me how to create and configure VM. What I asked in my question is Azure Kubernetes Service, not Virtual Machine. – ibocon May 30 '22 at 01:49
  • 1
    I understand your concern, but I provided link1 with perspective on how to change the existing default option of DiskSku in Bicep template and the link2 was inserted in there to show you the required parameters in the ARM template for the proper managed disk to be selected with regards to ‘Standard SSD’. In that comment, I forgot to include the link which explains the creation of AKS cluster. – Kartik Bhiwapurkar May 30 '22 at 04:31
  • Now I understand what your saying. But still AKS cluster template does not have property to configure `"osDisk"`. It has `osDiskSizeGB: int`, `osDiskType: string`, `osSKU: string`, `osType: string`. I cannot find `osDisk: {}` property in AKS template. `osSKU` does not related. `osSKU` property can only have `CBLMariner` and `Ubuntu`. – ibocon May 31 '22 at 05:10
  • This answer isn't actually correct. There's no osDiskType option in a AKS template at this moment. There's no way to change os disk's SKU for AKS compute scale set yet. – Steven.Xi Apr 26 '23 at 15:02