You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/container-storage/use-container-storage-with-managed-disks.md
+45-12Lines changed: 45 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.custom: references_regions
11
11
12
12
# Use Azure Container Storage with Azure managed disks
13
13
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.
15
15
16
16
## Prerequisites
17
17
@@ -87,7 +87,7 @@ Follow these steps to create a dynamic storage pool for Azure Disks.
87
87
kubectl apply -f acstor-storagepool.yaml
88
88
```
89
89
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:
91
91
92
92
```output
93
93
storagepool.containerstorage.azure.com/azuredisk created
@@ -99,12 +99,45 @@ Follow these steps to create a dynamic storage pool for Azure Disks.
99
99
kubectl describe sp <storage-pool-name> -n acstor
100
100
```
101
101
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).
103
103
104
104
#### Create a pre-provisioned storage pool
105
105
106
106
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.
107
107
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
+
108
141
Follow these steps to create a pre-provisioned storage pool for Azure Disks.
109
142
110
143
1. Sign in to the Azure portal.
@@ -125,8 +158,8 @@ Follow these steps to create a pre-provisioned storage pool for Azure Disks.
125
158
poolType:
126
159
azureDisk:
127
160
disks:
128
-
- reference <resource-id1>
129
-
- reference <resource-id2>
161
+
- reference: <resource-id1>
162
+
- reference: <resource-id2>
130
163
```
131
164
132
165
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.
135
168
kubectl apply -f acstor-storagepool.yaml
136
169
```
137
170
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:
139
172
140
173
```output
141
174
storagepool.containerstorage.azure.com/sp-preprovisioned created
@@ -147,7 +180,7 @@ Follow these steps to create a pre-provisioned storage pool for Azure Disks.
147
180
kubectl describe sp <storage-pool-name> -n acstor
148
181
```
149
182
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).
151
184
152
185
#### Create a dynamic storage pool using your own encryption key (optional)
153
186
@@ -162,7 +195,7 @@ When creating your storage pool, you must define the CMK parameters. The require
162
195
- **keyVaultUri** is the uniform resource identifier of the Azure Key Vault, for example `https://user.vault.azure.net`
163
196
- **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`
164
197
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.
166
199
167
200
1. Use your favorite text editor to create a YAML manifest file such as `code acstor-storagepool-cmk.yaml`.
168
201
@@ -195,7 +228,7 @@ Follow these steps to create a storage pool using your own encryption key. All p
195
228
kubectl apply -f acstor-storagepool-cmk.yaml
196
229
```
197
230
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:
199
232
200
233
```output
201
234
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
207
240
kubectl describe sp <storage-pool-name> -n acstor
208
241
```
209
242
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>`.
211
244
212
245
### 2. Display the available storage classes
213
246
@@ -216,7 +249,7 @@ When the storage pool is ready to use, you must select a storage class to define
216
249
Run `kubectl get sc` to display the available storage classes. You should see a storage class called `acstor-<storage-pool-name>`.
217
250
218
251
> [!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.
220
253
221
254
### 3. Create a persistent volume claim
222
255
@@ -359,7 +392,7 @@ Follow these instructions to expand an existing storage pool for Azure Disks.
359
392
```
360
393
361
394
> [!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.
363
396
364
397
1. Apply the YAML manifest file to expand the storage pool.
0 commit comments