--- title: Configuring Azure Disk Storage for Kubernetes description: Learn how to add persistent storage to your Docker Enterprise clusters running on Azure with Azure Disk. keywords: Universal Control Plane, UCP, Docker EE, Kubernetes, storage, volume redirect_from: --- >{% include enterprise_label_shortform.md %} Platform operators can provide persistent storage for workloads running on Docker Enterprise and Microsoft Azure by using Azure Disk. Platform operators can either pre-provision Azure Disks to be consumed by Kubernetes Pods, or can use the Azure Kubernetes integration to dynamically provision Azure Disks on demand. ## Prerequisites This guide assumes you have already provisioned a UCP environment on Microsoft Azure. The Cluster must be provisioned after meeting all of the prerequisites listed in [Install UCP on Azure](/ee/ucp/admin/install/cloudproviders/install-on-azure.md). Additionally, this guide uses the Kubernetes Command Line tool `$ kubectl` to provision Kubernetes objects within a UCP cluster. Therefore, this tool must be downloaded, along with a UCP client bundle. For more information on configuring CLI access for UCP, see [CLI Based Access](/ee/ucp/user-access/cli.md). ## Manually provision Azure Disks An operator can use existing Azure Disks or manually provision new ones to provide persistent storage for Kubernetes Pods. Azure Disks can be manually provisioned in the Azure Portal, using ARM Templates or the Azure CLI. The following example uses the Azure CLI to manually provision an Azure Disk. ```bash $ RG=myresourcegroup $ az disk create \ --resource-group $RG \ --name k8s_volume_1 \ --size-gb 20 \ --query id \ --output tsv ``` Using the Azure CLI command in the previous example should return the Azure ID of the Azure Disk Object. If you are provisioning Azure resources using an alternative method, make sure you retrieve the Azure ID of the Azure Disk, because it is needed for another step. ``` /subscriptions//resourceGroups//providers/Microsoft.Compute/disks/ ``` You can now create Kubernetes Objects that refer to this Azure Disk. The following example uses a Kubernetes Pod. However, the same Azure Disk syntax can be used for DaemonSets, Deployments, and StatefulSets. In the following example, the Azure Disk Name and ID reflect the manually created Azure Disk. ```bash $ cat </resourceGroups//providers/Microsoft.Compute/disks/ EOF ``` ## Dynamically provision Azure Disks ### Define the Azure Disk Storage Class Kubernetes can dynamically provision Azure Disks using the Azure Kubernetes integration, which was configured when UCP was installed. For Kubernetes to determine which APIs to use when provisioning storage, you must create Kubernetes Storage Classes specific to each storage backend. For more information on Kubernetes Storage Classes, see [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/). In Azure there are 2 different Azure Disk types that can be consumed by Kubernetes: Azure Disk Standard Volumes and Azure Disk Premium Volumes. For more information on their differences, see [Azure Disks](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-types). Depending on your use case, you can deploy one or both of the Azure Disk storage Classes (Standard and Advanced). To create a Standard Storage Class: ```bash $ cat < Warning FailedAttachVolume 7s (x11 over 6m) attachdetach-controller AttachVolume.Attach failed for volume "pvc-6b09dae3-6ad6-11e9-9509-0242ac11000b" : Attach volume "kubernetes-dynamic-pvc-6b09dae3-6ad6-11e9-9509-0242ac11000b" to instance "/subscriptions//resourceGroups//providers/Microsoft.Compute/virtualMachines/worker-03" failed with compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=409 -- Original Error: failed request: autorest/azure: Service returned an error. Status= Code="OperationNotAllowed" Message="The maximum number of data disks allowed to be attached to a VM of this size is 4." Target="dataDisks" ``` ## Where to go next - [Deploy an Ingress Controller on Kubernetes](/ee/ucp/kubernetes/layer-7-routing/) - [Discover Network Encryption on Kubernetes](/ee/ucp/kubernetes/kubernetes-network-encryption/)