• Kubernetes Submit Queue's avatar
    Merge pull request #66553 from feiskyer/azure-disk-availablity-zone · 14bcbb94
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
    
    Add availability zones support to Azure managed disks
    
    **What this PR does / why we need it**:
    
    Continue of [Azure Availability Zone feature](https://github.com/kubernetes/features/issues/586).
    
    This PR adds availability zone support for Azure managed disks and its storage class. Zoned managed disks is enabled by default if there are zoned nodes in the cluster.
    
    The zone could also be customized by `zone` or `zones` parameter, e.g.
    
    ```yaml
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      annotations:
      name: managed-disk-zone-1
    parameters:
      zone: "southeastasia-1"
      # zones: "southeastasia-1,"southeastasia-2"
      cachingmode: None
      kind: Managed
      storageaccounttype: Standard_LRS
    provisioner: kubernetes.io/azure-disk
    reclaimPolicy: Delete
    volumeBindingMode: Immediate
    ```
    
    All zoned AzureDisk PV will also be labeled with its availability zone, e.g.
    
    ```sh
    $ kubectl get pvc pvc-azuredisk-az-1
    NAME                 STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS          AGE
    pvc-azuredisk-az-1   Bound     pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c   5Gi        RWO            managed-disk-zone-1   2h
    
    $ kubectl get pv pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c --show-labels
    NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS    CLAIM                        STORAGECLASS          REASON    AGE       LABELS
    pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c   5Gi        RWO            Delete           Bound     default/pvc-azuredisk-az-1   managed-disk-zone-1             2h        failure-domain.beta.kubernetes.io/region=southeastasia,failure-domain.beta.kubernetes.io/zone=southeastasia-1
    ```
    
    **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
    Fixes #
    
    **Special notes for your reviewer**:
    
    See also the [KEP](https://github.com/kubernetes/community/pull/2364).
    
    DynamicProvisioningScheduling feature would be added in a following PR.
    
    **Release note**:
    
    ```release-note
    Azure managed disks now support availability zones and new parameters `zoned`, `zone` and `zones` are added for AzureDisk storage class.
    ```
    
    /kind feature
    /sig azure
    /assign @brendandburns @khenidak @andyzhangx
    14bcbb94
Name
Last commit
Last update
..
providers Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
README.md Loading commit data...
cloud.go Loading commit data...
doc.go Loading commit data...
plugins.go Loading commit data...