1
+ apiVersion : storage.k8s.io/v1
2
+ kind : StorageClass
3
+ metadata :
4
+ name : managed-premium-retain-sc
5
+ provisioner : kubernetes.io/azure-disk
6
+ reclaimPolicy : Retain # Default is Delete, recommended is retain
7
+ volumeBindingMode : WaitForFirstConsumer # Default is Immediate, recommended is WaitForFirstConsumer
8
+ allowVolumeExpansion : true
9
+ parameters :
10
+ storageaccounttype : Premium_LRS # or we can use Standard_LRS
11
+ kind : managed # Default is shared (Other two are managed and dedicated)
12
+
13
+
14
+ # #############################################################################
15
+ # Note-1:
16
+ # volumeBindingMode: Immediate - This setting implies that the PersistentVolumecreation,
17
+ # followed with the storage medium (Azure Disk in this case) provisioning is triggered as
18
+ # soon as the PersistentVolumeClaim is created.
19
+
20
+ # Note-2:
21
+ # volumeBindingMode: WaitForFirstConsumer
22
+ # By default, the Immediate mode indicates that volume binding and dynamic provisioning
23
+ # occurs once the PersistentVolumeClaim is created. For storage backends that are
24
+ # topology-constrained and not globally accessible from all Nodes in the cluster,
25
+ # PersistentVolumes will be bound or provisioned without knowledge of the Pod's scheduling
26
+ # requirements. This may result in unschedulable Pods.
27
+ # A cluster administrator can address this issue by specifying the WaitForFirstConsumer
28
+ # mode which will delay the binding and provisioning of a PersistentVolume until a
29
+ # Pod using the PersistentVolumeClaim is created. PersistentVolumes will be selected or
30
+ # provisioned conforming to the topology that is specified by the Pod's scheduling
31
+ # constraints.
32
+ # #############################################################################
33
+ # Note-3:
34
+ # reclaimPolicy: Delete - With this setting, as soon as a PersistentVolumeClaim is deleted,
35
+ # it also triggers the removal of the corresponding PersistentVolume along with the
36
+ # Azure Disk.
37
+ # We will be surprised provided if we intended to retain that data as backup.
38
+ # reclaimPolicy: retain - Disk is retained even when PVC is deleted - Recommended Option
39
+
40
+ # Note-4:
41
+ # Both reclaimPolicy: Delete and volumeBindingMode: Immediate are default settings
42
+ # #############################################################################
43
+ # Note-5:
44
+ # Additional Reference
45
+ # https://kubernetes.io/docs/concepts/storage/storage-classes/#azure-disk
46
+ # Managed: When managed used, that disk is persisted for the Lifecycle of the cluster.
47
+ # If we delete cluster, it will delete the disk
48
+ # #############################################################################
0 commit comments