Skip to content

Commit 361d3b1

Browse files
committed
first edits to CSI Drivers article
1 parent d313440 commit 361d3b1

File tree

1 file changed

+14
-53
lines changed

1 file changed

+14
-53
lines changed

articles/aks/csi-storage-drivers.md

Lines changed: 14 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,36 @@ title: Enable Container Storage Interface (CSI) drivers on Azure Kubernetes Serv
33
description: Learn how to enable the Container Storage Interface (CSI) drivers for Azure disks and Azure Files in an Azure Kubernetes Service (AKS) cluster.
44
services: container-service
55
ms.topic: article
6-
ms.date: 03/11/2022
6+
ms.date: 05/06/2022
77
author: palma21
88

99
---
1010

11-
# Enable Container Storage Interface (CSI) drivers for Azure disks and Azure Files on Azure Kubernetes Service (AKS)
11+
# Enable Container Storage Interface (CSI) drivers on Azure Kubernetes Service (AKS)
1212

1313
The Container Storage Interface (CSI) is a standard for exposing arbitrary block and file storage systems to containerized workloads on Kubernetes. By adopting and using CSI, Azure Kubernetes Service (AKS) can write, deploy, and iterate plug-ins to expose new or improve existing storage systems in Kubernetes without having to touch the core Kubernetes code and wait for its release cycles.
1414

1515
The CSI storage driver support on AKS allows you to natively use:
16-
- [*Azure disks*](azure-disk-csi.md), which can be used to create a Kubernetes *DataDisk* resource. Disks can use Azure Premium Storage, backed by high-performance SSDs, or Azure Standard Storage, backed by regular HDDs or Standard SSDs. For most production and development workloads, use Premium Storage. Azure disks are mounted as *ReadWriteOnce*, so are only available to a single pod. For storage volumes that can be accessed by multiple pods simultaneously, use Azure Files.
17-
- [*Azure Files*](azure-files-csi.md), which can be used to mount an SMB 3.0/3.1 share backed by an Azure Storage account to pods. With Azure Files, you can share data across multiple nodes and pods. Azure Files can use Azure Standard Storage backed by regular HDDs or Azure Premium Storage backed by high-performance SSDs.
1816

19-
> [!IMPORTANT]
20-
> Starting in Kubernetes version 1.21, AKS will use CSI drivers only and by default. CSI migration is also turned on starting from AKS 1.21, existing in-tree persistent volumes continue to function as they always have; however, behind the scenes Kubernetes hands control of all storage management operations (previously targeting in-tree drivers) to CSI drivers.
21-
>
22-
> Please remove manual installed open source Azure Disk and Azure File CSI drivers before upgrading to AKS 1.21.
23-
>
24-
> *In-tree drivers* refers to the current storage drivers that are part of the core Kubernetes code versus the new CSI drivers, which are plug-ins.
25-
26-
## Install CSI storage drivers on a new cluster with version < 1.21
27-
28-
Create a new cluster that can use CSI storage drivers for Azure disks and Azure Files by using the following CLI commands. Use the `--aks-custom-headers` flag to set the `EnableAzureDiskFileCSIDriver` feature.
29-
30-
Create an Azure resource group:
31-
32-
```azurecli-interactive
33-
# Create an Azure resource group
34-
az group create --name myResourceGroup --location canadacentral
35-
```
36-
37-
Create the AKS cluster with support for CSI storage drivers:
38-
39-
```azurecli-interactive
40-
# Create an AKS-managed Azure AD cluster
41-
az aks create -g MyResourceGroup -n MyManagedCluster --network-plugin azure --aks-custom-headers EnableAzureDiskFileCSIDriver=true
42-
```
17+
- [**Azure disks**](azure-disk-csi.md) can be used to create a Kubernetes *DataDisk* resource. Disks can use Azure Premium Storage, backed by high-performance SSDs, or Azure Standard Storage, backed by regular HDDs or Standard SSDs. For most production and development workloads, use Premium Storage. Azure disks are mounted as *ReadWriteOnce* and are only available to a single pod. For storage volumes that can be accessed by multiple pods simultaneously, use Azure Files.
18+
- [**Azure Files**](azure-files-csi.md) can be used to mount an SMB 3.0/3.1 share backed by an Azure storage account to pods. With Azure Files, you can share data across multiple nodes and pods. Azure Files can use Azure Standard storage backed by regular HDDs or Azure Premium storage backed by high-performance SSDs.
4319

44-
If you want to create clusters in tree storage drivers instead of CSI storage drivers, you can do so by omitting the custom `--aks-custom-headers` parameter. Starting in Kubernetes version 1.21, Kubernetes will use CSI drivers only and by default.
45-
46-
47-
Check how many Azure disk-based volumes you can attach to this node by running:
48-
49-
```console
50-
$ kubectl get nodes
51-
aks-nodepool1-25371499-vmss000000
52-
aks-nodepool1-25371499-vmss000001
53-
aks-nodepool1-25371499-vmss000002
54-
55-
$ echo $(kubectl get CSINode <NODE NAME> -o jsonpath="{.spec.drivers[1].allocatable.count}")
56-
8
57-
```
58-
59-
## Install CSI storage drivers on an existing cluster with version < 1.21
60-
- [Set up Azure Disk CSI driver on AKS cluster](https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/master/docs/install-driver-on-aks.md)
61-
- [Set up Azure File CSI driver on AKS cluster](https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/install-driver-on-aks.md)
20+
> [!IMPORTANT]
21+
> Starting with Kubernetes version 1.21, AKS only uses CSI drivers by default. CSI migration is also turned on starting with AKS 1.21, and existing in-tree persistent volumes continue to function. However, internally Kubernetes hands control of all storage management operations (previously targeting in-tree drivers) to CSI drivers.
22+
>
23+
> *In-tree drivers* refers to the current storage drivers that are part of the core Kubernetes code opposed to the new CSI drivers, which are plug-ins.
6224
6325
## Migrating custom in-tree storage classes to CSI
64-
If you have created in-tree driver storage classes, those storage classes will continue to work since CSI migration is turned on after upgrading your cluster to 1.21.x, while if you want to use CSI features (snapshotting etc.) you will need to carry out the migration.
6526

66-
Migration of these storage classes will involve deleting the existing storage classes, and re-creating them with the provisioner set to **disk.csi.azure.com** if using Azure Disks, and **files.csi.azure.com** if using Azure Files.
27+
If you created in-tree driver storage classes, those storage classes continue to work since CSI migration is turned on after upgrading your cluster to 1.21.x. If you want to use CSI features you'll need to perform the migration.
28+
29+
Migrating these storage classes involves deleting the existing ones, and re-creating them with the provisioner set to **disk.csi.azure.com** if using Azure disk storage, and **files.csi.azure.com** if using Azure Files.
6730

6831
### Migrating Storage Class provisioner
6932

70-
As an example for Azure disks:
33+
The following example shows how to migrate to Azure disk. The CSI storage system supports the same features as the in-tree drivers, so the only change needed would be the provisioner.
7134

72-
#### Original In-tree storage class definition
35+
#### Original in-tree storage class definition
7336

7437
```yaml
7538
kind: StorageClass
@@ -95,12 +58,10 @@ parameters:
9558
storageAccountType: Premium_LRS
9659
```
9760
98-
The CSI storage system supports the same features as the In-tree drivers, so the only change needed would be the provisioner.
99-
10061
## Migrating in-tree persistent volumes
10162
10263
> [!IMPORTANT]
103-
> If your in-tree Persistent Volume reclaimPolicy is set to Delete you will need to change the Persistent Volume to Retain to persist your data. This can be achieved via a [patch operation on the PV](https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/). For example:
64+
> If your in-tree persistent volume reclaimPolicy is set to **Delete**, you need to change the Persistent Volume to Retain to persist your data. This can be achieved via a [patch operation on the PV](https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/). For example:
10465
> ```console
10566
> $ kubectl patch pv pv-azuredisk --type merge --patch '{"spec": {"persistentVolumeReclaimPolicy": "Retain"}}'
10667
> ```

0 commit comments

Comments
 (0)