You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user creates, or has already created in the case of dynamic provisioning, a `PersistentVolumeClaim` with a specific amount of storage requested and with certain access modes. A control loop in the master watches for new PVCs, finds a matching PV (if possible), and binds them together. If a PV was dynamically provisioned for a new PVC, the loop will always bind that PV to the PVC. Otherwise, the user will always get at least what they asked for, but the volume may be in excess of what was requested. Once bound, `PersistentVolumeClaim` binds are exclusive, regardless of the mode used to bind them.
69
+
A user creates, or has already created in the case of dynamic provisioning, a `PersistentVolumeClaim` with a specific amount of storage requested and with certain access modes. A control loop in the master watches for new PVCs, finds a matching PV (if possible), and binds them together. If a PV was dynamically provisioned for a new PVC, the loop will always bind that PV to the PVC. Otherwise, the user will always get at least what they asked for, but the volume may be in excess of what was requested. Once bound, `PersistentVolumeClaim` binds are exclusive, regardless of how they were bound. A PVC to PV binding is a one-to-one mapping.
70
70
71
71
Claims will remain unbound indefinitely if a matching volume does not exist. Claims will be bound as matching volumes become available. For example, a cluster provisioned with many 50Gi PVs would not match a PVC requesting 100Gi. The PVC can be bound when a 100Gi PV is added to the cluster.
72
72
73
+
Alpha support for volume binding during pod scheduling is available in 1.9.
74
+
Normally, volume binding occurs immediately upon PVC creation.
75
+
However, for PVs that specify NodeAffinity, it may be beneficial to delay
76
+
binding until there is a pod consumer that references the PVC. This ensures
77
+
that the volume binding decision will also be evaluated with any other node
78
+
constraints the pod may have, such as node resource requirements, node
79
+
selectors, pod affinity, and pod anti-affinity. This new mode of binding is
80
+
controlled through the `VolumeBindingMode` parameter in the
81
+
[StorageClass](#StorageClasses).
82
+
83
+
**Note:** Dynamic provisioning is not supported yet with this alpha feature.
84
+
{: .note}
85
+
73
86
### Using
74
87
75
88
Pods use claims as volumes. The cluster inspects the claim to find the bound volume and mounts that volume for a pod. For volumes which support multiple access modes, the user specifies which mode desired when using their claim as a volume in a pod.
@@ -437,6 +450,15 @@ request any particular class to bind to: see the
Secrets used for dynamically provisioned volumes may be created in any namespace and referenced with the `adminSecretNamespace` parameter. Secrets used by pre-provisioned volumes must be created in the same namespace as the PVC that references it.
877
900
901
+
#### Local
902
+
903
+
```yaml
904
+
kind: StorageClass
905
+
apiVersion: storage.k8s.io/v1
906
+
metadata:
907
+
name: local-fast
908
+
provisioner: kubernetes.io/no-provisioner
909
+
volumeBindingMode: WaitForFirstConsumer
910
+
parameters:
911
+
```
912
+
913
+
Local volumes do not support dynamic provisioning yet, however a StorageClass
914
+
should still be created to delay volume binding until pod scheduling. This is
915
+
specified by the `WaitForFirstConsumer` volume binding mode.
916
+
917
+
**Note:** Local volumes are an alpha feature in 1.7. Volume binding during pod
918
+
scheduling is an alpha feature in 1.9.
919
+
878
920
## Writing Portable Configuration
879
921
880
922
If you're writing configuration templates or examples that run on a wide range of clusters
0 commit comments