Skip to content

Commit f5c7bb5

Browse files
Merge pull request #255359 from khdownie/kendownie-acstor-cmk-disks
Adding CMK to ACStor Disks flow
2 parents a53c556 + daef92e commit f5c7bb5

File tree

1 file changed

+71
-2
lines changed

1 file changed

+71
-2
lines changed

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

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Configure Azure Container Storage Preview for use with Azure manage
44
author: khdownie
55
ms.service: azure-container-storage
66
ms.topic: how-to
7-
ms.date: 09/15/2023
7+
ms.date: 11/06/2023
88
ms.author: kendownie
99
ms.custom: references_regions
1010
---
@@ -27,7 +27,14 @@ ms.custom: references_regions
2727

2828
## Create a storage pool
2929

30-
First, create a storage pool, which is a logical grouping of storage for your Kubernetes cluster, by defining it in a YAML manifest file. Follow these steps to create a storage pool for Azure Disks.
30+
First, create a storage pool, which is a logical grouping of storage for your Kubernetes cluster, by defining it in a YAML manifest file.
31+
32+
If you enabled Azure Container Storage using `az aks create` or `az aks update` commands, you might already have a storage pool. Use `kubectl get sp -n acstor` to get the list of storage pools. If you have a storage pool already available that you want to use, you can skip this section and proceed to [Display the available storage classes](#display-the-available-storage-classes).
33+
34+
> [!IMPORTANT]
35+
> If you want to use your own keys to encrypt your volumes instead of using Microsoft-managed keys, don't create your storage pool using the steps in this section. Instead, go to [Enable server-side encryption with customer-managed keys](#enable-server-side-encryption-with-customer-managed-keys) and follow the steps there.
36+
37+
Follow these steps to create a storage pool for Azure Disks.
3138

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

@@ -68,6 +75,68 @@ First, create a storage pool, which is a logical grouping of storage for your Ku
6875

6976
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>`.
7077

78+
## Enable server-side encryption with customer-managed keys
79+
80+
If you already created a storage pool or you prefer to use the default Microsoft-managed encryption keys, skip this section and proceed to [Display the available storage classes](#display-the-available-storage-classes).
81+
82+
All data in an Azure storage account is encrypted at rest. By default, data is encrypted with Microsoft-managed keys. For more control over encryption keys, you can supply customer-managed keys (CMK) to encrypt the persistent volumes that you'll create from an Azure Disk storage pool.
83+
84+
To use your own key, you must have an [Azure Key Vault](../../key-vault/general/overview.md) with a key. The Key Vault should have purge protection enabled, and it must use the Azure RBAC permission model. Learn more about [customer-managed keys on Linux](../../virtual-machines/disk-encryption.md#customer-managed-keys).
85+
86+
When creating your storage pool, you must define the CMK parameters. The required CMK encryption parameters are:
87+
88+
- **keyVersion** specifies the version of the key to use
89+
- **keyName** is the name of your key
90+
- **keyVaultUri** is the uniform resource identifier of the Azure Key Vault, for example `https://user.vault.azure.net`
91+
- **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`
92+
93+
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.
94+
95+
1. Use your favorite text editor to create a YAML manifest file such as `code acstor-storagepool-cmk.yaml`.
96+
97+
1. Paste in the following code, supply the required parameters, and save the file. The storage pool **name** value can be whatever you want. For **skuName**, specify the level of performance and redundancy. Acceptable values are Premium_LRS, Standard_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, PremiumV2_LRS, and StandardSSD_ZRS. For **storage**, specify the amount of storage capacity for the pool in Gi or Ti. Be sure to supply the CMK encryption parameters.
98+
99+
```yml
100+
apiVersion: containerstorage.azure.com/v1beta1
101+
kind: StoragePool
102+
metadata:
103+
name: azuredisk
104+
namespace: acstor
105+
spec:
106+
poolType:
107+
azureDisk:
108+
skuName: Premium_LRS
109+
encryption: {
110+
keyVersion: "<key-version>",
111+
keyName: "<key-name>",
112+
keyVaultUri: "<key-vault-uri>",
113+
identity: "<identity>"
114+
}
115+
resources:
116+
requests:
117+
storage: 1Ti
118+
```
119+
120+
1. Apply the YAML manifest file to create the storage pool.
121+
122+
```azurecli-interactive
123+
kubectl apply -f acstor-storagepool-cmk.yaml
124+
```
125+
126+
When storage pool creation is complete, you'll see a message like:
127+
128+
```output
129+
storagepool.containerstorage.azure.com/azuredisk created
130+
```
131+
132+
You can also run this command to check the status of the storage pool. Replace `<storage-pool-name>` with your storage pool **name** value. For this example, the value would be **azuredisk**.
133+
134+
```azurecli-interactive
135+
kubectl describe sp <storage-pool-name> -n acstor
136+
```
137+
138+
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>`.
139+
71140
## Display the available storage classes
72141

73142
When the storage pool is ready to use, you must select a storage class to define how storage is dynamically created when creating persistent volume claims and deploying persistent volumes.

0 commit comments

Comments
 (0)