title: Adding allowVolumeExpansion: true to default storage classes in AKS
body: <p>The <a href="https://docs.microsoft.com/en-us/azure/aks/azure-disks-dynamic-pv#built-in-storage-classes" rel="nofollow noreferrer">documentation</a> says the following:</p>
  
  <blockquote>
    <p>These default storage classes don't allow you to update the volume size once created. To enable this ability, add the <code>allowVolumeExpansion: true</code> line to one of the default storage classes, or create you own custom storage class. You can edit an existing storage class using the <code>kubectl edit sc</code> command. For more information on storage classes and creating your own, see Storage options for applications in AKS.</p>
  </blockquote>
  
  <p>I've tried editing the the <code>default</code> YAML (which just looks like JSON and not YAML) in the Kubernetes dashboard:</p>
  
  <pre><code>{
    "kind": "StorageClass",
    "apiVersion": "storage.k8s.io/v1",
    "metadata": {
      "name": "default",
      "selfLink": "/apis/storage.k8s.io/v1/storageclasses/default",
      "uid": "&lt;uid&gt;",
      "resourceVersion": "3891497",
      "creationTimestamp": "2020-02-14T01:34:03Z",
      "labels": {
        "kubernetes.io/cluster-service": "true"
      },
      "annotations": {
        "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"storage.k8s.io/v1beta1\",\"kind\":\"StorageClass\",\"metadata\":{\"annotations\":{\"storageclass.beta.kubernetes.io/is-default-class\":\"true\"},\"labels\":{\"kubernetes.io/cluster-service\":\"true\"},\"name\":\"default\"},\"parameters\":{\"cachingmode\":\"ReadOnly\",\"kind\":\"Managed\",\"storageaccounttype\":\"Standard_LRS\"},\"provisioner\":\"kubernetes.io/azure-disk\"}\n",
        "storageclass.beta.kubernetes.io/is-default-class": "true"
      }
    },
    "provisioner": "kubernetes.io/azure-disk",
    "parameters": {
      "cachingmode": "ReadOnly",
      "kind": "Managed",
      "storageaccounttype": "Standard_LRS"
    },
    "reclaimPolicy": "Delete",
    "volumeBindingMode": "Immediate",
    "allowVolumeExpansion": "true"
  }
  </code></pre>
  
  <p>Which results in:</p>
  
  <pre><code>StorageClass in version "v1" cannot be handled as a StorageClass: v1.StorageClass.AllowVolumeExpansion: ReadBool: expect t or f, but found ", error found in #10 byte of ...|ansion": "true" }|..., bigger context ...|ingMode": "Immediate", "allowVolumeExpansion": "true" }|...
  </code></pre>
  
  <p>Also:</p>
  
  <pre><code>{
    "kind": "StorageClass",
    "apiVersion": "storage.k8s.io/v1",
    "metadata": {
      "name": "default",
      "selfLink": "/apis/storage.k8s.io/v1/storageclasses/default",
      "uid": "&lt;uid&gt;",
      "resourceVersion": "3891497",
      "creationTimestamp": "2020-02-14T01:34:03Z",
      "labels": {
        "kubernetes.io/cluster-service": "true"
      },
      "annotations": {
        "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"storage.k8s.io/v1beta1\",\"kind\":\"StorageClass\",\"metadata\":{\"annotations\":{\"storageclass.beta.kubernetes.io/is-default-class\":\"true\"},\"labels\":{\"kubernetes.io/cluster-service\":\"true\"},\"name\":\"default\"},\"parameters\":{\"cachingmode\":\"ReadOnly\",\"kind\":\"Managed\",\"storageaccounttype\":\"Standard_LRS\"},\"provisioner\":\"kubernetes.io/azure-disk\"}\n",
        "storageclass.beta.kubernetes.io/is-default-class": "true"
      }
    },
    "provisioner": "kubernetes.io/azure-disk",
    "parameters": {
      "cachingmode": "ReadOnly",
      "kind": "Managed",
      "storageaccounttype": "Standard_LRS",
      "allowVolumeExpansion": "true"
    },
    "reclaimPolicy": "Delete",
    "volumeBindingMode": "Immediate"
  }
  </code></pre>
  
  <p>Which results in:</p>
  
  <pre><code>StorageClass.storage.k8s.io "default" is invalid: parameters: Forbidden: updates to parameters are forbidden.
  </code></pre>
  
  <p>Also tried all of the following with <code>kubectl edit sc</code>:</p>
  
  <pre><code>$ kubectl edit sc default allowVolumeExpansion: true          
  Error from server (NotFound): storageclasses.storage.k8s.io "allowVolumeExpansion:" not found
  Error from server (NotFound): storageclasses.storage.k8s.io "true" not found
  
  $ kubectl edit sc default "allowVolumeExpansion: true"
  Error from server (NotFound): storageclasses.storage.k8s.io "allowVolumeExpansion: true" not found
  
  $ kubectl edit sc/default allowVolumeExpansion: true
  error: there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. 'kubectl get resource/&lt;resource_name&gt;' instead of 'kubectl get resource resource/&lt;resource_name&gt;'
  
  $ kubectl edit sc/default "allowVolumeExpansion: true"
  error: there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. 'kubectl get resource/&lt;resource_name&gt;' instead of 'kubectl get resource resource/&lt;resource_name&gt;'
  </code></pre>
  
  <p>What is the correct way of accomplishing this? Would be helpful if an example was in the documentation.</p>