Skip to content

Commit 3e9e70d

Browse files
Merge pull request #296554 from fhryo-msft/patch-51
Update use-container-storage-with-managed-disks.md
2 parents 737c4be + d8dfb7e commit 3e9e70d

File tree

1 file changed

+45
-12
lines changed

1 file changed

+45
-12
lines changed

articles/storage/container-storage/use-container-storage-with-managed-disks.md

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ms.custom: references_regions
1111

1212
# Use Azure Container Storage with Azure managed disks
1313

14-
[Azure Container Storage](container-storage-introduction.md) is a cloud-based volume management, deployment, and orchestration service built natively for containers. This article shows you how to configure Azure Container Storage to use Azure managed disks as back-end storage for your Kubernetes workloads. At the end, you'll have a pod that's using Azure managed disks as its storage.
14+
[Azure Container Storage](container-storage-introduction.md) is a cloud-based volume management, deployment, and orchestration service built natively for containers. This article shows you how to configure Azure Container Storage to use Azure managed disks as back-end storage for your Kubernetes workloads. At the end, you have a pod that's using Azure managed disks as its storage.
1515

1616
## Prerequisites
1717

@@ -87,7 +87,7 @@ Follow these steps to create a dynamic storage pool for Azure Disks.
8787
kubectl apply -f acstor-storagepool.yaml
8888
```
8989

90-
When storage pool creation is complete, you'll see a message like:
90+
When storage pool creation is complete, you see a message like:
9191

9292
```output
9393
storagepool.containerstorage.azure.com/azuredisk created
@@ -99,12 +99,45 @@ Follow these steps to create a dynamic storage pool for Azure Disks.
9999
kubectl describe sp <storage-pool-name> -n acstor
100100
```
101101

102-
When the storage pool is created, Azure Container Storage will create a storage class on your behalf, using the naming convention `acstor-<storage-pool-name>`. Now you can [display the available storage classes](#2-display-the-available-storage-classes) and [create a persistent volume claim](#3-create-a-persistent-volume-claim).
102+
When the storage pool is created, Azure Container Storage creates a storage class on your behalf, using the naming convention `acstor-<storage-pool-name>`. Now you can [display the available storage classes](#2-display-the-available-storage-classes) and [create a persistent volume claim](#3-create-a-persistent-volume-claim).
103103

104104
#### Create a pre-provisioned storage pool
105105

106106
If you have Azure managed disks that are already provisioned, you can create a pre-provisioned storage pool using those disks. Because the disks are already provisioned, you don't need to specify the skuName or storage capacity when creating the storage pool.
107107

108+
Follow these steps to prepare before creating a pre-provisioned storage pool for Azure Disks.
109+
110+
1. Pre-provisioned Azure managed disks need to be in the same zone of the system node pool. Follow these steps to check zones of disks and system node pool.
111+
112+
```bash
113+
114+
$ systemNodepoolName=$(az aks nodepool list -g <resourceGroup> --cluster-name <clusterName> --query "[?mode=='System'].name" -o tsv)
115+
$ az aks nodepool show --resource-group <resourceGroup> --cluster-name <clusterName> --name $systemNodepoolName --query "availabilityZones" -o tsv
116+
1
117+
$ az disk show --resource-group <resourceGroup> --name <diskName> --query "zones" -o tsv
118+
1
119+
```
120+
121+
1. Find cluster managed identity:
122+
123+
```bash
124+
$ az aks show --resource-group <resourceGroup> --name <clusterName> --query "identity" -o tsv
125+
a972fa43-1234-5678-1234-c040eb546ec5
126+
```
127+
128+
1. Grant **Contributor** role of the disk to the cluster managed identity. Sign in to the Azure portal and navigate to your disk. From the service menu, select **Access control (IAM)** > **Add role assignment**, and then select **Contributor** role and assign to the identity. If you created your disk under an AKS managed resource group (example: MC_myResourceGroup_myAKSCluster_eastus), you can skip this step.
129+
130+
1. Find the identity of the system node pool:
131+
132+
```bash
133+
$ nodeResourceGroup=$(az aks show --resource-group <resourceGroup> --name <clusterName> --query nodeResourceGroup -o tsv)
134+
$ agentPoolIdentityName="<clusterName>-agentpool"
135+
$ az identity show --resource-group $nodeResourceGroup --output tsv --subscription $subscriptionId --name $agentPoolIdentityName --query 'principalId'
136+
eb25d20f-1234-4ed5-1234-cef16f5bfe93
137+
```
138+
139+
1. Grant **Disk Pool Operator** role on your disk to the identity. Sign in to the Azure portal and navigate to your disk. From the service menu, select **Access control (IAM)** > **Add role assignment**, and then select **Disk Pool Operator** role and assign to the identity.
140+
108141
Follow these steps to create a pre-provisioned storage pool for Azure Disks.
109142

110143
1. Sign in to the Azure portal.
@@ -125,8 +158,8 @@ Follow these steps to create a pre-provisioned storage pool for Azure Disks.
125158
poolType:
126159
azureDisk:
127160
disks:
128-
- reference <resource-id1>
129-
- reference <resource-id2>
161+
- reference: <resource-id1>
162+
- reference: <resource-id2>
130163
```
131164

132165
1. Apply the YAML manifest file to create the storage pool.
@@ -135,7 +168,7 @@ Follow these steps to create a pre-provisioned storage pool for Azure Disks.
135168
kubectl apply -f acstor-storagepool.yaml
136169
```
137170

138-
When storage pool creation is complete, you'll see a message like:
171+
When storage pool creation is complete, you see a message like:
139172

140173
```output
141174
storagepool.containerstorage.azure.com/sp-preprovisioned created
@@ -147,7 +180,7 @@ Follow these steps to create a pre-provisioned storage pool for Azure Disks.
147180
kubectl describe sp <storage-pool-name> -n acstor
148181
```
149182

150-
When the storage pool is created, Azure Container Storage will create a storage class on your behalf, using the naming convention `acstor-<storage-pool-name>`. Now you can [display the available storage classes](#2-display-the-available-storage-classes) and [create a persistent volume claim](#3-create-a-persistent-volume-claim).
183+
When the storage pool is created, Azure Container Storage creates a storage class on your behalf, using the naming convention `acstor-<storage-pool-name>`. Now you can [display the available storage classes](#2-display-the-available-storage-classes) and [create a persistent volume claim](#3-create-a-persistent-volume-claim).
151184

152185
#### Create a dynamic storage pool using your own encryption key (optional)
153186

@@ -162,7 +195,7 @@ When creating your storage pool, you must define the CMK parameters. The require
162195
- **keyVaultUri** is the uniform resource identifier of the Azure Key Vault, for example `https://user.vault.azure.net`
163196
- **Identity** specifies a managed identity with access to the vault, for example `/subscriptions/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourcegroups/MC_user-acstor-westus2-rg_user-acstor-westus2_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-acstor-westus2-agentpool`
164197

165-
Follow these steps to create a storage pool using your own encryption key. All persistent volumes created from this storage pool will be encrypted using the same key.
198+
Follow these steps to create a storage pool using your own encryption key. All persistent volumes created from this storage pool are encrypted using the same key.
166199

167200
1. Use your favorite text editor to create a YAML manifest file such as `code acstor-storagepool-cmk.yaml`.
168201

@@ -195,7 +228,7 @@ Follow these steps to create a storage pool using your own encryption key. All p
195228
kubectl apply -f acstor-storagepool-cmk.yaml
196229
```
197230

198-
When storage pool creation is complete, you'll see a message like:
231+
When storage pool creation is complete, you see a message like:
199232

200233
```output
201234
storagepool.containerstorage.azure.com/azuredisk created
@@ -207,7 +240,7 @@ Follow these steps to create a storage pool using your own encryption key. All p
207240
kubectl describe sp <storage-pool-name> -n acstor
208241
```
209242

210-
When the storage pool is created, Azure Container Storage will create a storage class on your behalf, using the naming convention `acstor-<storage-pool-name>`.
243+
When the storage pool is created, Azure Container Storage creates a storage class on your behalf, using the naming convention `acstor-<storage-pool-name>`.
211244

212245
### 2. Display the available storage classes
213246

@@ -216,7 +249,7 @@ When the storage pool is ready to use, you must select a storage class to define
216249
Run `kubectl get sc` to display the available storage classes. You should see a storage class called `acstor-<storage-pool-name>`.
217250

218251
> [!IMPORTANT]
219-
> Don't use the storage class that's marked **internal**. It's an internal storage class that's needed for Azure Container Storage to work.
252+
> Make sure NOT to use the storage class marked as **internal**. It's an internal storage class that's needed for Azure Container Storage to work.
220253

221254
### 3. Create a persistent volume claim
222255

@@ -359,7 +392,7 @@ Follow these instructions to expand an existing storage pool for Azure Disks.
359392
```
360393

361394
> [!NOTE]
362-
> If you have two disks in a storage pool with a capacity of 1 TiB each, and you edit the YAML manifest file to read `storage: 4Ti`, both disks will be expanded to 2 TiB when the YAML is applied, giving you a new total capacity of 4 TiB.
395+
> If you have two disks in a storage pool with a capacity of 1 TiB each, and you edit the YAML manifest file to read `storage: 4Ti`, both disks are expanded to 2 TiB when the YAML is applied, giving you a new total capacity of 4 TiB.
363396

364397
1. Apply the YAML manifest file to expand the storage pool.
365398

0 commit comments

Comments
 (0)