Skip to content

Commit bec197f

Browse files
committed
Update local storage docs for beta
1 parent 68c57ff commit bec197f

File tree

2 files changed

+51
-46
lines changed

2 files changed

+51
-46
lines changed

docs/concepts/storage/storage-classes.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -638,19 +638,21 @@ references it.
638638

639639
#### Local
640640

641-
{% assign for_k8s_version="v1.9" %}{% include feature-state-alpha.md %}
642-
643-
This feature requires the `VolumeScheduling` feature gate to be enabled.
641+
{% assign for_k8s_version="v1.10" %}{% include feature-state-beta.md %}
644642

645643
```yaml
646644
kind: StorageClass
647645
apiVersion: storage.k8s.io/v1
648646
metadata:
649-
name: local-fast
647+
name: local-storage
650648
provisioner: kubernetes.io/no-provisioner
651649
volumeBindingMode: WaitForFirstConsumer
652650
```
653651

654652
Local volumes do not support dynamic provisioning yet, however a StorageClass
655653
should still be created to delay volume binding until pod scheduling. This is
656654
specified by the `WaitForFirstConsumer` volume binding mode.
655+
656+
Delaying volume binding allows the scheduler to consider all of a pod's
657+
scheduling constraints when choosing an appropriate PersistentVolume for a
658+
PersistentVolumeClaim.

docs/concepts/storage/volumes.md

+45-42
Original file line numberDiff line numberDiff line change
@@ -507,68 +507,71 @@ See the [iSCSI example](https://github.com/kubernetes/examples/tree/{{page.githu
507507

508508
### local
509509

510-
{% assign for_k8s_version="v1.7" %}{% include feature-state-alpha.md %}
511-
512-
This alpha feature requires the `PersistentLocalVolumes` feature gate to be
513-
enabled.
514-
515-
**Note:** Starting in 1.9, the `VolumeScheduling` feature gate must also be enabled.
516-
{: .note}
510+
{% assign for_k8s_version="v1.10" %}{% include feature-state-beta.md %}
517511

518512
A `local` volume represents a mounted local storage device such as a disk,
519513
partition or directory.
520514

521-
Local volumes can only be used as a statically created PersistentVolume.
515+
Local volumes can only be used as a statically created PersistentVolume. Dynamic
516+
provisioning is not supported yet.
522517

523-
Compared to `hostPath` volumes, local volumes can be used in a durable manner
524-
without manually scheduling pods to nodes, as the system is aware of the volume's
525-
node constraints by looking at the node affinity on the PersistentVolume.
518+
Compared to `hostPath` volumes, local volumes can be used in a durable and
519+
portable manner without manually scheduling pods to nodes, as the system is aware
520+
of the volume's node constraints by looking at the node affinity on the PersistentVolume.
526521

527522
However, local volumes are still subject to the availability of the underlying
528-
node and are not suitable for all applications.
523+
node and are not suitable for all applications. If a node becomes unhealthy,
524+
then the local volume will also become inaccessible, and a pod using it will not
525+
be able to run. Applications using local volumes must be able to tolerate this
526+
reduced availability, as well as potential data loss, depending on the
527+
durability characteristics of the underlying disk.
529528

530-
The following is an example PersistentVolume spec using a `local` volume:
529+
The following is an example PersistentVolume spec using a `local` volume and
530+
`nodeAffinity`:
531531

532532
``` yaml
533533
apiVersion: v1
534534
kind: PersistentVolume
535535
metadata:
536536
name: example-pv
537-
annotations:
538-
"volume.alpha.kubernetes.io/node-affinity": '{
539-
"requiredDuringSchedulingIgnoredDuringExecution": {
540-
"nodeSelectorTerms": [
541-
{ "matchExpressions": [
542-
{ "key": "kubernetes.io/hostname",
543-
"operator": "In",
544-
"values": ["example-node"]
545-
}
546-
]}
547-
]}
548-
}'
549537
spec:
550-
capacity:
551-
storage: 100Gi
552-
accessModes:
553-
- ReadWriteOnce
554-
persistentVolumeReclaimPolicy: Delete
555-
storageClassName: local-storage
556-
local:
557-
path: /mnt/disks/ssd1
538+
capacity:
539+
storage: 100Gi
540+
accessModes:
541+
- ReadWriteOnce
542+
persistentVolumeReclaimPolicy: Delete
543+
storageClassName: local-storage
544+
local:
545+
path: /mnt/disks/ssd1
546+
nodeAffinity:
547+
required:
548+
nodeSelectorTerms:
549+
- matchExpressions:
550+
- key: kubernetes.io/hostname
551+
operator: In
552+
values:
553+
- example-node
558554
```
559555

560-
**Note:** The local PersistentVolume cleanup and deletion requires manual intervention without the external provisioner.
561-
{: .note}
556+
PersistentVolume `nodeAffinity` is required when using local volumes. It enables
557+
the Kubernetes scheduler to correctly schedule pods using local volumes to the
558+
correct node.
562559

563-
Starting in 1.9, local volume binding can be delayed until pod scheduling by
564-
creating a StorageClass with `volumeBindingMode` set to `WaitForFirstConsumer`.
565-
See the [example](storage-classes.md#local). Delaying volume binding ensures
566-
that the volume binding decision will also be evaluated with any other node
567-
constraints the pod may have, such as node resource requirements, node
560+
When using local volumes, it is recommended to create a StorageClass with
561+
`volumeBindingMode` set to `WaitForFirstConsumer`. See the
562+
[example](storage-classes.md#local). Delaying volume binding ensures
563+
that the PersistentVolumeClaim binding decision will also be evaluated with any
564+
other node constraints the pod may have, such as node resource requirements, node
568565
selectors, pod affinity, and pod anti-affinity.
569566

570-
For details on the `local` volume type, see the [Local Persistent Storage
571-
user guide](https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume).
567+
An external static provisioner can be run separately for improved management of
568+
the local volume lifecycle. Note that this provisioner does not support dynamic
569+
provisioning yet. For an example on how to run an external local provisioner,
570+
see the [local volume provisioner user guide](https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume).
571+
572+
**Note:** The local PersistentVolume requires manual cleanup and deletion by the
573+
user if the external static provisioner is not used to manage the volumes.
574+
{: .note}
572575

573576
### nfs
574577

0 commit comments

Comments
 (0)