Add container storage to Kubernetes in Azure Stack Hub
As part of the Kubernetes community effort (Kubernetes in-tree to CSI volume migration) to move in-tree volume providers to Container Storage Interface CSI, you can find the following CSI driver in Azure Stack: Azure Disk.
Details | Azure Disk CSI Driver |
---|---|
Project Repository | azuredisk-csi-driver |
CSI Driver Version | v1.0.0+ |
Access Mode | ReadWriteOnce |
Windows Agent Node | Support |
Dynamic Provisioning | Support |
Considerations | Azure Disk CSI Driver Limitations |
Slack Support Channel | #provider-azure |
In AKSe versions v0.75.3 and above, Azure Disk CSI driver works for both Linux and Windows nodes, through azuredisk-csi-driver addon or helm charts. In disconnected environments, only azuredisk-csi-driver addon is supported.
Requirements
- Azure Stack build 2011 and later.
- AKS engine version v0.60.1 and later.
- Kubernetes version 1.18 and later.
- Since the Controller server of CSI Drivers requires two replicas, a single node master pool isn't recommended.
- Helm 3
Install and uninstall CSI drivers
In this section, follow the example commands to deploy a stateful set application consuming CSI Driver.
Azure disk CSI driver
Install CSI driver
DRIVER_VERSION=v1.10.0
helm repo add azuredisk-csi-driver https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/charts
helm install azuredisk-csi-driver azuredisk-csi-driver/azuredisk-csi-driver \
--namespace kube-system \
--set cloud=AzureStackCloud \
--set controller.runOnMaster=true \
--version ${DRIVER_VERSION}
Deploy storage class
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/deploy/example/storageclass-azuredisk-csi-azurestack.yaml
Deploy example stateful set application
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/deploy/example/statefulset.yaml
Validate volumes and applications
You should see a sequence of timestamps are persisted in the volume.
kubectl exec statefulset-azuredisk-0 -- tail /mnt/azuredisk/outfile
Delete example stateful set application
kubectl delete -f https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/deploy/example/statefulset.yaml
Delete storage class
Before you delete the Storage Class, make sure Pods that consume the Storage Class have been terminated.
kubectl delete -f https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/deploy/example/storageclass-azuredisk-csi-azurestack.yaml
Uninstall CSI driver
helm uninstall azuredisk-csi-driver --namespace kube-system
helm repo remove azuredisk-csi-driver
Azure Disk CSI Driver limitations on Azure Stack Hub
- Azure Disk IOPS is capped at 2300. For details, see VM sizes supported in Azure Stack Hub.
- Azure Stack Hub doesn't support shared disks, so a
maxShares
value greater than 1 isn't valid in a StorageClass. - Azure Stack Hub only supports standard locally redundant (Standard_LRS) and Premium Locally redundant (Premium_LRS) Storage Account types, so only
Standard_LRS
andPremium_LRS
are valid for theskuName
parameter in aStorageClass
. - Azure Stack Hub doesn't support incremental disk snapshot, so only false is valid for parameter
incremental
in aVolumeSnapshotClass
. - For Windows agent nodes, you need to install Windows CSI Proxy. For details, see Windows CSI Proxy. To enable the proxy via AKS engine API model, see CSI Proxy for Windows.
Next steps
- Read about AKS engine on Azure Stack Hub
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for