Skip to content

Commit 09dbc93

Browse files
authored
Merge pull request #311461 from eh8/main
Fix ACStor Terraform
2 parents 6414b56 + ae44880 commit 09dbc93

5 files changed

Lines changed: 80 additions & 82 deletions

File tree

articles/storage/container-storage/container-storage-faq.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Azure Container Storage is a cloud-based volume management, deployment, and orch
2727
| Azure Container Storage version | Storage types supported | Installer present | Driver installation trigger |
2828
|---|---|---|---|
2929
| 2.0.x | Local NVMe | No | Installed during `--enable-azure-container-storage` |
30-
| 2.1.x and later | Local NVMe and Elastic SAN | Yes | Via storage type selection during enable or by creating a StorageClass (installer-only flow) |
30+
| 2.1.x and later | Local NVMe and Elastic SAN | Yes | Via storage type selection during enable or by creating a storage class (installer-only flow) |
3131

3232
* <a id="azure-container-storage-install-models"></a>
3333
**What installation models are available in version 2.1.x and later?**
@@ -43,7 +43,7 @@ Azure Container Storage is a cloud-based volume management, deployment, and orch
4343
**Behavior:**
4444
- Installs only the installer.
4545
- No storage-specific driver or node agent is installed initially.
46-
- Creating a StorageClass later triggers the correct CSI driver installation.
46+
- Creating a storage class later triggers the correct CSI driver installation.
4747

4848
**Installer + storage type(s)**
4949
Use this option when you know the backend(s) required.
@@ -60,7 +60,7 @@ Azure Container Storage is a cloud-based volume management, deployment, and orch
6060

6161
**Behavior:**
6262
- Installs the installer plus the selected CSI driver(s).
63-
- Creates default StorageClass objects if none exists.
63+
- Creates default storage class objects if none exists.
6464
- Supports comma-separated storage types.
6565

6666
Supported storage types for version 2.1.0 and later: `ephemeralDisk` (local NVMe) and `elasticSan` (Azure Elastic SAN).
@@ -69,27 +69,27 @@ Azure Container Storage is a cloud-based volume management, deployment, and orch
6969
**How do installation models work with Terraform?**
7070
The extension configuration supports the same flows as Azure CLI:
7171

72-
- **Installer-only (choose storage later):** Set `enable-azure-container-storage` to `true`. Create a StorageClass later to trigger driver installation.
72+
- **Installer-only (choose storage later):** Set `enable-azure-container-storage` to `true`. Create a storage class later to trigger driver installation.
7373
- **Installer + storage type(s):** Set `enable-azure-container-storage` to a storage type value such as `ephemeralDisk`, `elasticSan`, or a comma-separated list like `ephemeralDisk,elasticSan`. This installs the installer and the selected CSI drivers.
7474

7575
Supported storage types for version 2.1.0 and later: `ephemeralDisk` (local NVMe) and `elasticSan` (Azure Elastic SAN).
7676

7777
* <a id="azure-container-storage-components"></a>
7878
**What components are installed in installer-only mode?**
79-
Installer-only mode creates the installer and telemetry deployments in the `kube-system` namespace, but doesn't install any CSI drivers or node agents until you enable a storage type or create a StorageClass.
79+
Installer-only mode creates the installer and telemetry deployments in the `kube-system` namespace, but doesn't install any CSI drivers or node agents until you enable a storage type or create a storage class.
8080

8181
| Component | Resource type | Name | Description |
8282
|---|---|---|---|
83-
| Installer | Deployment | acstor-cluster-manager | Core controller that watches StorageClass objects and orchestrates CSI driver lifecycle |
83+
| Installer | Deployment | acstor-cluster-manager | Core controller that watches storage class objects and orchestrates CSI driver lifecycle |
8484
| Telemetry | Deployment | acstor-geneva | Internal monitoring and telemetry containers |
8585

8686
* <a id="azure-container-storage-driver-install"></a>
8787
**When are CSI drivers installed?**
88-
If you enable a storage type during installation, the driver installs immediately and default StorageClass objects are created if missing. If you choose installer-only, the driver installs when you create a StorageClass (or if a StorageClass already exists).
88+
If you enable a storage type during installation, the driver installs immediately and default storage class objects are created if missing. If you choose installer-only, the driver installs when you create a storage class (or if a storage class already exists).
8989

9090
* <a id="azure-container-storage-driver-components"></a>
9191
**What gets installed when a CSI driver is enabled?**
92-
When you enable a storage type or create a StorageClass, Azure Container Storage installs the storage-specific CSI driver plus supporting components.
92+
When you enable a storage type or create a storage class, Azure Container Storage installs the storage-specific CSI driver plus supporting components.
9393

9494
| Component | Resource type | Name | Description |
9595
|---|---|---|---|
@@ -117,7 +117,7 @@ Azure Container Storage is a cloud-based volume management, deployment, and orch
117117

118118
* <a id="azure-container-storage-node-scheduling"></a>
119119
**How are Azure Container Storage components scheduled?**
120-
CSI drivers run according to StorageClass affinity. The node agent runs wherever a driver is present, and the installer prefers system node pools.
120+
CSI drivers run according to storage class affinity. The node agent runs wherever a driver is present, and the installer prefers system node pools.
121121

122122
* <a id="azure-container-storage-vs-csi-drivers"></a>
123123
**What's the difference between Azure Container Storage and Azure CSI (Container Storage Interface) drivers?**

articles/storage/container-storage/install-container-storage-aks.md

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ Run the following command to create a new AKS cluster and install Azure Containe
104104
az aks create -n <cluster-name> -g <resource-group> --node-vm-size Standard_L8s_v3 --enable-azure-container-storage --generate-ssh-keys
105105
```
106106

107-
The deployment can take up to 5 minutes. CSI driver installation is deferred until you create a StorageClass or enable a storage type later.
107+
The deployment can take up to 5 minutes. CSI driver installation is deferred until you create a storage class or enable a storage type later.
108108

109-
Follow the instructions for creating a [local NVMe](use-container-storage-with-local-disk.md) StorageClass or [Elastic SAN](use-container-storage-with-elastic-san.md) StorageClass.
109+
Follow the instructions for creating a [local NVMe](use-container-storage-with-local-disk.md) storage class or [Elastic SAN](use-container-storage-with-elastic-san.md) storage class.
110110

111111
### Installer + storage type installation
112112

@@ -116,7 +116,7 @@ Run the following command to create a new AKS cluster and install Azure Containe
116116
az aks create -n <cluster-name> -g <resource-group> --node-vm-size Standard_L8s_v3 --enable-azure-container-storage ephemeralDisk --generate-ssh-keys
117117
```
118118

119-
This command installs the installer, deploys the `ephemeralDisk` driver, and creates a default StorageClass. You can install and use both local NVMe and Elastic SAN by providing comma-separated values such as `ephemeralDisk,elasticSan`.
119+
This command installs the installer, deploys the `ephemeralDisk` driver, and creates a default storage class. You can install and use both local NVMe and Elastic SAN by providing comma-separated values such as `ephemeralDisk,elasticSan`.
120120

121121
## Install Azure Container Storage on an existing AKS cluster
122122

@@ -128,7 +128,7 @@ Run the following command to enable Azure Container Storage on an existing AKS c
128128
az aks update -n <cluster-name> -g <resource-group> --enable-azure-container-storage
129129
```
130130

131-
The deployment can take up to 5 minutes. When it completes, the cluster has the Azure Container Storage installer component installed. CSI driver installation is deferred until you create a StorageClass or enable a storage type later. Follow the instructions for creating a [local NVMe](use-container-storage-with-local-disk.md) StorageClass or [Elastic SAN](use-container-storage-with-elastic-san.md) StorageClass.
131+
The deployment can take up to 5 minutes. When it completes, the cluster has the Azure Container Storage installer component installed. CSI driver installation is deferred until you create a storage class or enable a storage type later. Follow the instructions for creating a [local NVMe](use-container-storage-with-local-disk.md) storage class or [Elastic SAN](use-container-storage-with-elastic-san.md) storage class.
132132

133133
### Installer + storage type installation
134134

@@ -138,7 +138,7 @@ Run the following command to enable Azure Container Storage on an existing AKS c
138138
az aks update -n <cluster-name> -g <resource-group> --enable-azure-container-storage elasticSan
139139
```
140140

141-
This command installs the installer, deploys the Elastic SAN CSI driver, and creates a default StorageClass. You can install and use both local NVMe and Elastic SAN by providing comma-separated values such as `ephemeralDisk,elasticSan`.
141+
This command installs the installer, deploys the Elastic SAN CSI driver, and creates a default storage class. You can install and use both local NVMe and Elastic SAN by providing comma-separated values such as `ephemeralDisk,elasticSan`.
142142

143143
::: zone-end
144144

@@ -234,39 +234,29 @@ az account set --subscription <subscription-id>
234234
name = "acstor"
235235
cluster_id = azurerm_kubernetes_cluster.aks.id
236236
extension_type = "microsoft.azurecontainerstoragev2"
237-
238-
configuration_settings = {
239-
enable-azure-container-storage = "true"
240-
}
241-
}
242-
```
243-
244-
To install Elastic SAN during deployment, set `enable-azure-container-storage` to `elasticSan` or a comma-separated list:
245-
246-
```tf
247-
configuration_settings = {
248-
enable-azure-container-storage = "elasticSan"
249237
}
250238
```
251239
252-
2. Initialize the working directory to download the AzureRM provider.
240+
1. Initialize the working directory to download the AzureRM provider.
253241
254242
```bash
255243
terraform init
256244
```
257245
258-
3. Review the planned changes.
246+
1. Review the planned changes.
259247
260248
```bash
261249
terraform plan
262250
```
263251
264-
4. Apply the configuration to create the resource group, AKS cluster, and Azure Container Storage extension. Deployment typically takes 5 to 10 minutes.
252+
1. Apply the configuration to create the resource group, AKS cluster, and Azure Container Storage extension. Deployment typically takes 5 minutes.
265253
266254
```bash
267255
terraform apply
268256
```
269257
258+
When it completes, the cluster has the Azure Container Storage installer component installed. CSI driver installation is deferred until you create a storage class. Follow the instructions for creating a [local NVMe](use-container-storage-with-local-disk.md) storage class or [Elastic SAN](use-container-storage-with-elastic-san.md) storage class.
259+
270260
## Install Azure Container Storage on an existing AKS cluster
271261
272262
If your AKS cluster already exists and you manage it outside of Terraform, you can still enable Azure Container Storage by authoring only the extension resource. Use a data source to look up the cluster ID.
@@ -296,16 +286,12 @@ resource "azurerm_kubernetes_cluster_extension" "container_storage" {
296286
name = "acstor"
297287
cluster_id = data.azurerm_kubernetes_cluster.existing.id
298288
extension_type = "microsoft.azurecontainerstoragev2"
299-
300-
configuration_settings = {
301-
enable-azure-container-storage = "true"
302-
}
303289
}
304290
```
305291

306-
To install Elastic SAN or local NVMe during deployment, set `enable-azure-container-storage` to a storage type or comma-separated list (for example, `elasticSan` or `ephemeralDisk,elasticSan`).
292+
Run `terraform init` (if this is a new working directory) followed by `terraform apply` to install Azure Container Storage on the targeted cluster. Deployment typically takes 5 minutes.
307293

308-
Run `terraform init` (if this is a new working directory) followed by `terraform apply` to install Azure Container Storage on the targeted cluster.
294+
When it completes, the cluster has the Azure Container Storage installer component installed. CSI driver installation is deferred until you create a storage class. Follow the instructions for creating a [local NVMe](use-container-storage-with-local-disk.md) storage class or [Elastic SAN](use-container-storage-with-elastic-san.md) storage class.
309295

310296
::: zone-end
311297

@@ -326,9 +312,9 @@ acstor-cluster-manager 2/2 2 2 4d9h
326312
acstor-geneva 2/2 2 2 4d9h
327313
```
328314

329-
### Verify StorageClass presence
315+
### Verify storage class presence
330316

331-
After you create a StorageClass or enable a storage type, verify the StorageClass:
317+
After you create a storage class or enable a storage type, verify the storage class:
332318

333319
```azurecli
334320
kubectl get sc
@@ -344,7 +330,7 @@ local localdisk.csi.acstor.io Delete WaitForFirstCo
344330

345331
### Verify driver installation
346332

347-
Verify the components expected after StorageClass creation or storage type installation:
333+
Verify the components expected after storage class creation or storage type installation:
348334

349335
```azurecli
350336
kubectl get pod -n kube-system | grep acstor

articles/storage/container-storage/remove-container-storage.md

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -16,60 +16,22 @@ This article shows how to remove Azure Container Storage components from your Az
1616
> [!IMPORTANT]
1717
> This article applies to [Azure Container Storage (version 2.x.x)](container-storage-introduction.md). If you have Azure Container Storage (version 1.x.x) installed on your AKS cluster, remove it by following [these steps](remove-container-storage-version-1.md).
1818
19-
## Remove Azure Container Storage
20-
21-
You can either remove the components for a specific storage type or remove Azure Container Storage entirely.
22-
23-
- CSI driver for specific storage types
24-
- The entire Azure Container Storage installation (installer and CSI drivers)
25-
26-
> [!IMPORTANT]
27-
> Delete all persistent volume claims (PVCs) and persistent volumes (PVs) before uninstalling the extension. Removing Azure Container Storage without cleaning up these resources can disrupt running workloads. Ensure no workloads or StorageClass objects rely on Azure Container Storage before you continue.
28-
29-
## Remove CSI driver for a specific storage type
30-
31-
Remove the CSI driver by running the following Azure CLI command. Replace `<cluster-name>` and `<resource-group>` with your own values.
32-
33-
```azurecli-interactive
34-
az aks update -n <cluster-name> -g <resource-group> --disable-azure-container-storage <storage-type>
35-
```
36-
37-
Supported storage type values:
38-
39-
- `ephemeralDisk` - removes only the local CSI driver
40-
- `elasticSan` - removes only the Elastic SAN CSI driver
41-
- `all` - removes both Elastic SAN and local CSI drivers
42-
43-
You can also use comma-separated values to remove specific CSI drivers, such as `ephemeralDisk,elasticSan`.
44-
45-
This command removes the specified CSI driver(s), while the Azure Container Storage installer components remain installed.
46-
4719
## Remove the entire Azure Container Storage installation (installer and CSI drivers)
4820

21+
Delete all persistent volume claims (PVCs) and persistent volumes (PVs) before uninstalling the extension. Removing Azure Container Storage without cleaning up these resources can disrupt running workloads. Ensure no workloads or StorageClass objects rely on Azure Container Storage before you continue.
22+
4923
Remove Azure Container Storage entirely by running the following Azure CLI command. Replace `<cluster-name>` and `<resource-group>` with your own values.
5024

5125
```azurecli
5226
az aks update -n <cluster-name> -g <resource-group> --disable-azure-container-storage
5327
```
5428

55-
## Re-enable Azure Container Storage
56-
57-
If you previously removed CSI drivers for one or more storage types, you can re-enable the storage type by running the following Azure CLI command.
58-
59-
```azurecli
60-
az aks update -n <cluster-name> -g <resource-group> --enable-azure-container-storage <storage-type>
61-
```
62-
63-
Expected behavior:
64-
65-
- Specifying a storage type is optional. When no storage type is provided, only the Azure Container Storage installer component is installed, if it isn't already present.
66-
- When a storage type is specified, the corresponding CSI driver is installed. If a StorageClass for that storage type already exists, only the driver is installed; otherwise, a default StorageClass is created as part of the installation.
67-
6829
### Remove the extension with Terraform
6930

7031
If you provisioned Azure Container Storage with Terraform, remove the corresponding extension resource from your configuration and apply the change so the result matches the CLI workflow.
7132

7233
1. Delete the `azurerm_kubernetes_cluster_extension` block (or set `count = 0`) in your Terraform configuration and save the file.
34+
7335
1. Review the plan to confirm Terraform destroys only the extension resource.
7436

7537
```bash
@@ -82,8 +44,18 @@ If you provisioned Azure Container Storage with Terraform, remove the correspond
8244
terraform apply
8345
```
8446

85-
> [!NOTE]
86-
> Terraform manages the extension resource. If you want to remove only a specific storage type (for example, Elastic SAN or local NVMe), use the Azure CLI workflow in this article. Terraform doesn't provide a separate disable flag per storage type.
47+
## Re-enable Azure Container Storage
48+
49+
If you previously removed CSI drivers for one or more storage types, you can re-enable the storage type by running the following Azure CLI command.
50+
51+
```azurecli
52+
az aks update -n <cluster-name> -g <resource-group> --enable-azure-container-storage <storage-type>
53+
```
54+
55+
Expected behavior:
56+
57+
- Specifying a storage type is optional. When no storage type is provided, only the Azure Container Storage installer component is installed, if it isn't already present.
58+
- When a storage type is specified, the corresponding CSI driver is installed. If a StorageClass for that storage type already exists, only the driver is installed; otherwise, a default StorageClass is created as part of the installation.
8759
8860
## Delete the AKS cluster
8961
@@ -112,3 +84,5 @@ az group delete --name <resource-group>
11284
## See also
11385
11486
- [What is Azure Container Storage?](container-storage-introduction.md)
87+
- [Use Azure Container Storage with local NVMe](use-container-storage-with-local-disk.md)
88+
- [Use Azure Container Storage with Elastic SAN](use-container-storage-with-elastic-san.md)

articles/storage/container-storage/use-container-storage-with-elastic-san.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,44 @@ allowVolumeExpansion: true
6262
6363
The default Elastic SAN capacity provisioned with this storage class is 1 TiB.
6464
65+
Alternatively, you can create the storage class using Terraform.
66+
67+
1. Use Terraform to manage the storage class by creating a configuration like the following `main.tf`. Update the provider version or kubeconfig path as needed for your environment.
68+
69+
```tf
70+
terraform {
71+
required_version = ">= 1.5.0"
72+
required_providers {
73+
kubernetes = {
74+
source = "hashicorp/kubernetes"
75+
version = "~> 3.0"
76+
}
77+
}
78+
}
79+
80+
provider "kubernetes" {
81+
config_path = "~/.kube/config"
82+
}
83+
84+
resource "kubernetes_storage_class_v1" "azuresan" {
85+
metadata {
86+
name = "azuresan"
87+
}
88+
89+
storage_provisioner = "san.csi.azure.com"
90+
reclaim_policy = "Delete"
91+
volume_binding_mode = "Immediate"
92+
allow_volume_expansion = true
93+
}
94+
```
95+
96+
1. Initialize and apply the configuration.
97+
98+
```bash
99+
terraform init
100+
terraform apply
101+
```
102+
65103
### Create a storage class with custom Elastic SAN capacity
66104

67105
If you need a different initial capacity than the default 1 TiB, set the `initialStorageTiB` parameter in the storage class.

articles/storage/container-storage/use-container-storage-with-local-disk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Alternatively, you can create the storage class using Terraform.
9999
required_providers {
100100
kubernetes = {
101101
source = "hashicorp/kubernetes"
102-
version = "~> 3.x"
102+
version = "~> 3.0"
103103
}
104104
}
105105
}

0 commit comments

Comments
 (0)