Skip to content

Commit e1b627e

Browse files
authored
Merge pull request #197417 from MGoedtel/task1946523
first edits to CSI Drivers article
2 parents 21942d7 + ec668d4 commit e1b627e

File tree

1 file changed

+23
-61
lines changed

1 file changed

+23
-61
lines changed

articles/aks/csi-storage-drivers.md

Lines changed: 23 additions & 61 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-
```
43-
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:
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.
4819

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-
```
20+
> [!IMPORTANT]
21+
> Starting with Kubernetes version 1.21, AKS only uses CSI drivers by default and CSI migration is enabled. Existing in-tree persistent volumes will 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.
5824
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)
25+
## Migrate custom in-tree storage classes to CSI
6226

63-
## 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.
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.
6528

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.
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

68-
### Migrating Storage Class provisioner
31+
### Migrate storage class provisioner
6932

70-
As an example for Azure disks:
33+
The following example YAML manifest shows the difference between the in-tree storage class definition configured to use Azure disks, and the equivalent using a CSI storage class definition. The CSI storage system supports the same features as the in-tree drivers, so the only change needed would be the value for `provisioner`.
7134

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

7437
```yaml
7538
kind: StorageClass
@@ -95,28 +58,27 @@ 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-
100-
## Migrating in-tree persistent volumes
61+
## Migrate 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 its policy to **Retain** to persist your data. This can be achieved using a [patch operation on the PV](https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/). For example:
65+
>
10466
> ```console
10567
> $ kubectl patch pv pv-azuredisk --type merge --patch '{"spec": {"persistentVolumeReclaimPolicy": "Retain"}}'
10668
> ```
10769

108-
### Migrating in-tree Azure Disk persistent volumes
70+
### Migrate in-tree Azure disk persistent volumes
10971

110-
If you have in-tree Azure Disk persistent volumes, get `diskURI` from in-tree persistent volumes and then follow this [guide][azure-disk-static-mount] to set up CSI driver persistent volumes
72+
If you have in-tree Azure disk persistent volumes, get `diskURI` from in-tree persistent volumes and then follow this [guide][azure-disk-static-mount] to set up CSI driver persistent volumes.
11173

112-
### Migrating in-tree Azure File persistent volumes
74+
### Migrate in-tree Azure File persistent volumes
11375

114-
If you have in-tree Azure File persistent volumes, get `secretName`, `shareName` from in-tree persistent volumes and then follow this [guide][azure-file-static-mount] to set up CSI driver persistent volumes
76+
If you have in-tree Azure File persistent volumes, get `secretName`, `shareName` from in-tree persistent volumes and then follow this [guide][azure-file-static-mount] to set up CSI driver persistent volumes.
11577

11678
## Next steps
11779

118-
- To use the CSI drive for Azure disks, see [Use Azure disks with CSI drivers](azure-disk-csi.md).
119-
- To use the CSI drive for Azure Files, see [Use Azure Files with CSI drivers](azure-files-csi.md).
80+
- To use the CSI driver for Azure disks, see [Use Azure disks with CSI drivers](azure-disk-csi.md).
81+
- To use the CSI driver for Azure Files, see [Use Azure Files with CSI drivers](azure-files-csi.md).
12082
- For more about storage best practices, see [Best practices for storage and backups in Azure Kubernetes Service][operator-best-practices-storage].
12183
- For more information on CSI migration, see [Kubernetes In-Tree to CSI Volume Migration][csi-migration-community].
12284

0 commit comments

Comments
 (0)