Skip to content

Commit e0e8b4f

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

File tree

2 files changed

+56
-44
lines changed

2 files changed

+56
-44
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

+50-40
Original file line numberDiff line numberDiff line change
@@ -507,68 +507,78 @@ 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 %}
510+
{% assign for_k8s_version="v1.10" %}{% include feature-state-beta.md %}
511511

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.
512+
**Note:** The alpha PersistentVolume NodeAffinity annotation has been deprecated
513+
and will be removed in a future release. Existing PersistentVolumes using this
514+
annotation must be updated by the user to use the new PersistentVolume
515+
`NodeAffinity` field.
516516
{: .note}
517517

518518
A `local` volume represents a mounted local storage device such as a disk,
519519
partition or directory.
520520

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

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.
524+
Compared to `hostPath` volumes, local volumes can be used in a durable and
525+
portable manner without manually scheduling pods to nodes, as the system is aware
526+
of the volume's node constraints by looking at the node affinity on the PersistentVolume.
526527

527528
However, local volumes are still subject to the availability of the underlying
528-
node and are not suitable for all applications.
529+
node and are not suitable for all applications. If a node becomes unhealthy,
530+
then the local volume will also become inaccessible, and a pod using it will not
531+
be able to run. Applications using local volumes must be able to tolerate this
532+
reduced availability, as well as potential data loss, depending on the
533+
durability characteristics of the underlying disk.
529534

530-
The following is an example PersistentVolume spec using a `local` volume:
535+
The following is an example PersistentVolume spec using a `local` volume and
536+
`nodeAffinity`:
531537

532538
``` yaml
533539
apiVersion: v1
534540
kind: PersistentVolume
535541
metadata:
536542
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-
}'
549543
spec:
550-
capacity:
551-
storage: 100Gi
552-
accessModes:
553-
- ReadWriteOnce
554-
persistentVolumeReclaimPolicy: Delete
555-
storageClassName: local-storage
556-
local:
557-
path: /mnt/disks/ssd1
544+
capacity:
545+
storage: 100Gi
546+
accessModes:
547+
- ReadWriteOnce
548+
persistentVolumeReclaimPolicy: Delete
549+
storageClassName: local-storage
550+
local:
551+
path: /mnt/disks/ssd1
552+
nodeAffinity:
553+
required:
554+
nodeSelectorTerms:
555+
- matchExpressions:
556+
- key: kubernetes.io/hostname
557+
operator: In
558+
values:
559+
- example-node
558560
```
559561

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

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
566+
When using local volumes, it is recommended to create a StorageClass with
567+
`volumeBindingMode` set to `WaitForFirstConsumer`. See the
568+
[example](storage-classes.md#local). Delaying volume binding ensures
569+
that the PersistentVolumeClaim binding decision will also be evaluated with any
570+
other node constraints the pod may have, such as node resource requirements, node
568571
selectors, pod affinity, and pod anti-affinity.
569572

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).
573+
An external static provisioner can be run separately for improved management of
574+
the local volume lifecycle. Note that this provisioner does not support dynamic
575+
provisioning yet. For an example on how to run an external local provisioner,
576+
see the [local volume provisioner user guide](https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume).
577+
578+
**Note:** The local PersistentVolume requires manual cleanup and deletion by the
579+
user if the external static provisioner is not used to manage the volume
580+
lifecycle.
581+
{: .note}
572582

573583
### nfs
574584

0 commit comments

Comments
 (0)