Notiz
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Iech unzemellen oder Verzeechnesser ze änneren.
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Verzeechnesser ze änneren.
This article shows how to remove Azure Container Storage components from your Azure Kubernetes Service (AKS) cluster. To clean up resources, you can also delete the AKS cluster or the entire resource group.
Important
This article applies to Azure Container Storage (version 2.x.x). If you have Azure Container Storage (version 1.x.x) installed on your AKS cluster, remove it by following these steps.
Remove Azure Container Storage
You can either remove the components for a specific storage type or remove Azure Container Storage entirely.
- CSI driver for specific storage types
- The entire Azure Container Storage installation (installer and CSI drivers)
Important
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.
Remove CSI driver for a specific storage type
Remove the CSI driver by running the following Azure CLI command. Replace <cluster-name> and <resource-group> with your own values.
az aks update -n <cluster-name> -g <resource-group> --disable-azure-container-storage <storage-type>
Supported storage type values:
ephemeralDisk- removes only the local CSI driverelasticSan- removes only the Elastic SAN CSI driverall- removes both Elastic SAN and local CSI drivers
You can also use comma-separated values to remove specific CSI drivers, such as ephemeralDisk,elasticSan.
This command removes the specified CSI driver(s), while the Azure Container Storage installer components remain installed.
Remove the entire Azure Container Storage installation (installer and CSI drivers)
Remove Azure Container Storage entirely by running the following Azure CLI command. Replace <cluster-name> and <resource-group> with your own values.
az aks update -n <cluster-name> -g <resource-group> --disable-azure-container-storage
Re-enable Azure Container Storage
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.
az aks update -n <cluster-name> -g <resource-group> --enable-azure-container-storage <storage-type>
Expected behavior:
- 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.
- 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.
Remove the extension with Terraform
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.
Delete the
azurerm_kubernetes_cluster_extensionblock (or setcount = 0) in your Terraform configuration and save the file.Review the plan to confirm Terraform destroys only the extension resource.
terraform planApply the plan to delete the extension. Terraform displays the same outcome as the CLI command: the extension resource is removed and AKS no longer reports Azure Container Storage as enabled.
terraform apply
Note
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.
Delete the AKS cluster
To delete an AKS cluster and all persistent volumes, run the following Azure CLI command. Replace <resource-group> and <cluster-name> with your own values.
az aks delete --resource-group <resource-group> --name <cluster-name>
If the AKS cluster was created with Terraform, you can also remove it by running the following command.
terraform destroy
This command deletes all resources that Terraform manages in the current working directory. This includes the cluster, the resource group, and the Azure Container Storage extension. Run this command only when you intend to remove the entire deployment.
Delete the resource group
You can also use the az group delete command to delete the resource group and all resources it contains. Replace <resource-group> with your resource group name.
az group delete --name <resource-group>