From 034c7929e2a20930a37f176447f1d78db3643032 Mon Sep 17 00:00:00 2001 From: Michelle Au Date: Thu, 22 Jun 2017 15:06:05 -0700 Subject: [PATCH] Add local volume documentation (#4050) * Add local volume documentation * Add PV local volume example --- docs/concepts/storage/volumes.md | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/docs/concepts/storage/volumes.md b/docs/concepts/storage/volumes.md index f924684be4..a575881637 100644 --- a/docs/concepts/storage/volumes.md +++ b/docs/concepts/storage/volumes.md @@ -91,6 +91,7 @@ Kubernetes supports several types of Volumes: * `PortworxVolume` * `ScaleIO` * `StorageOS` + * `local` We welcome additional contributions. @@ -738,6 +739,55 @@ spec: For more information including Dynamic Provisioning and Persistent Volume Claims, please see the [StorageOS examples](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/storageos). +### local + +This volume type is alpha in 1.7. + +A `local` volume represents a mounted local storage device such as a disk, +partition or directory. + +Local volumes can only be used as a statically created PersistentVolume. + +Compared to HostPath volumes, local volumes can be used in a durable manner +without manually scheduling pods to nodes, as the system is aware of the volume's +node constraints. + +However, local volumes are still subject to the availability of the underlying +node and are not suitable for all applications. + +The following is an example PersistentVolume spec using a `local` volume: + +``` yaml +apiVersion: v1 +kind: PersistentVolume +metadata: + name: example-pv + annotations: + "volume.alpha.kubernetes.io/node-affinity": '{ + "requiredDuringSchedulingIgnoredDuringExecution": { + "nodeSelectorTerms": [ + { "matchExpressions": [ + { "key": "kubernetes.io/hostname", + "operator": "In", + "values": ["example-node"] + } + ]} + ]} + }' +spec: + capacity: + storage: 100Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Delete + storageClassName: local-storage + local: + path: /mnt/disks/ssd1 +``` + +For details on the `local` volume type, see the [Local Persistent Storage +user guide](https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume) + ## Using subPath Sometimes, it is useful to share one volume for multiple uses in a single pod. The `volumeMounts.subPath`