Update volumes.md (#5214)

* Update volumes.md

Fix the formats.

* Convert important and note into callouts
This commit is contained in:
Stewart-YU
2017-08-29 03:28:11 +08:00
committed by Andrew Chen
parent 3cfaa2ad44
commit e7384f280e
+46 -42
View File
@@ -99,9 +99,10 @@ exists as long as that Pod is running on that node. As the name says, it is
initially empty. Containers in the pod can all read and write the same initially empty. Containers in the pod can all read and write the same
files in the `emptyDir` volume, though that volume can be mounted at the same files in the `emptyDir` volume, though that volume can be mounted at the same
or different paths in each container. When a Pod is removed from a node for or different paths in each container. When a Pod is removed from a node for
any reason, the data in the `emptyDir` is deleted forever. NOTE: a container any reason, the data in the `emptyDir` is deleted forever.
crashing does *NOT* remove a pod from a node, so the data in an `emptyDir`
volume is safe across container crashes. **Note:** a container crashing does *NOT* remove a pod from a node, so the data in an `emptyDir` volume is safe across container crashes.
{: .note}
Some uses for an `emptyDir` are: Some uses for an `emptyDir` are:
@@ -189,8 +190,8 @@ Disk](http://cloud.google.com/compute/docs/disks) into your pod. Unlike
preserved and the volume is merely unmounted. This means that a PD can be preserved and the volume is merely unmounted. This means that a PD can be
pre-populated with data, and that data can be "handed off" between pods. pre-populated with data, and that data can be "handed off" between pods.
__Important: You must create a PD using `gcloud` or the GCE API or UI **Important:** You must create a PD using `gcloud` or the GCE API or UI before you can use it.
before you can use it__ {: .caution}
There are some restrictions when using a `gcePersistentDisk`: There are some restrictions when using a `gcePersistentDisk`:
@@ -245,8 +246,8 @@ volume are preserved and the volume is merely unmounted. This means that an
EBS volume can be pre-populated with data, and that data can be "handed off" EBS volume can be pre-populated with data, and that data can be "handed off"
between pods. between pods.
__Important: You must create an EBS volume using `aws ec2 create-volume` or **Important:** You must create an EBS volume using `aws ec2 create-volume` or the AWS API before you can use it.
the AWS API before you can use it__ {: .caution}
There are some restrictions when using an awsElasticBlockStore volume: There are some restrictions when using an awsElasticBlockStore volume:
@@ -259,7 +260,7 @@ There are some restrictions when using an awsElasticBlockStore volume:
Before you can use an EBS volume with a pod, you need to create it. Before you can use an EBS volume with a pod, you need to create it.
```shell ```shell
aws ec2 create-volume --availability-zone eu-west-1a --size 10 --volume-type gp2 aws ec2 create-volume --availability-zone=eu-west-1a --size=10 --volume-type=gp2
``` ```
Make sure the zone matches the zone you brought up your cluster in. (And also check that the size and EBS volume Make sure the zone matches the zone you brought up your cluster in. (And also check that the size and EBS volume
@@ -296,8 +297,8 @@ unmounted. This means that an NFS volume can be pre-populated with data, and
that data can be "handed off" between pods. NFS can be mounted by multiple that data can be "handed off" between pods. NFS can be mounted by multiple
writers simultaneously. writers simultaneously.
__Important: You must have your own NFS server running with the share exported **Important:** You must have your own NFS server running with the share exported before you can use it.
before you can use it__ {: .caution}
See the [NFS example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/nfs) for more details. See the [NFS example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/nfs) for more details.
@@ -309,8 +310,8 @@ contents of an `iscsi` volume are preserved and the volume is merely
unmounted. This means that an iscsi volume can be pre-populated with data, and unmounted. This means that an iscsi volume can be pre-populated with data, and
that data can be "handed off" between pods. that data can be "handed off" between pods.
__Important: You must have your own iSCSI server running with the volume **Important:** You must have your own iSCSI server running with the volume created before you can use it.
created before you can use it__ {: .caution}
A feature of iSCSI is that it can be mounted as read-only by multiple consumers A feature of iSCSI is that it can be mounted as read-only by multiple consumers
simultaneously. This means that you can pre-populate a volume with your dataset simultaneously. This means that you can pre-populate a volume with your dataset
@@ -327,9 +328,8 @@ You can specify single or multiple target World Wide Names using the parameter
`targetWWNs` in your volume configuration. If multiple WWNs are specified, `targetWWNs` in your volume configuration. If multiple WWNs are specified,
targetWWNs expect that those WWNs are from multi-path connections. targetWWNs expect that those WWNs are from multi-path connections.
__Important: You must configure FC SAN Zoning to allocate and mask those **Important:** You must configure FC SAN Zoning to allocate and mask those LUNs (volumes) to the target WWNs beforehand so that Kubernetes hosts can access them.
LUNs (volumes) to the target WWNs beforehand so that Kubernetes hosts {: .caution}
can access them__
See the [FC example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/fibre_channel) for more details. See the [FC example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/fibre_channel) for more details.
@@ -344,7 +344,8 @@ CLI or by using the Flocker API. If the dataset already exists it will be
reattached by Flocker to the node that the pod is scheduled. This means data reattached by Flocker to the node that the pod is scheduled. This means data
can be "handed off" between pods as required. can be "handed off" between pods as required.
__Important: You must have your own Flocker installation running before you can use it__ **Important:** You must have your own Flocker installation running before you can use it.
{: .caution}
See the [Flocker example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/flocker) for more details. See the [Flocker example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/flocker) for more details.
@@ -358,8 +359,8 @@ means that a glusterfs volume can be pre-populated with data, and that data can
be "handed off" between pods. GlusterFS can be mounted by multiple writers be "handed off" between pods. GlusterFS can be mounted by multiple writers
simultaneously. simultaneously.
__Important: You must have your own GlusterFS installation running before you **Important:** You must have your own GlusterFS installation running before you can use it.
can use it__ {: .caution}
See the [GlusterFS example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/glusterfs) for more details. See the [GlusterFS example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/glusterfs) for more details.
@@ -372,8 +373,8 @@ a `rbd` volume are preserved and the volume is merely unmounted. This
means that a RBD volume can be pre-populated with data, and that data can means that a RBD volume can be pre-populated with data, and that data can
be "handed off" between pods. be "handed off" between pods.
__Important: You must have your own Ceph installation running before you **Important:** You must have your own Ceph installation running before you can use RBD.
can use RBD__ {: .caution}
A feature of RBD is that it can be mounted as read-only by multiple consumers A feature of RBD is that it can be mounted as read-only by multiple consumers
simultaneously. This means that you can pre-populate a volume with your dataset simultaneously. This means that you can pre-populate a volume with your dataset
@@ -392,8 +393,8 @@ unmounted. This means that a CephFS volume can be pre-populated with data, and
that data can be "handed off" between pods. CephFS can be mounted by multiple that data can be "handed off" between pods. CephFS can be mounted by multiple
writers simultaneously. writers simultaneously.
__Important: You must have your own Ceph server running with the share exported **Important:** You must have your own Ceph server running with the share exported before you can use it.
before you can use it__ {: .caution}
See the [CephFS example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/cephfs/) for more details. See the [CephFS example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/cephfs/) for more details.
@@ -433,8 +434,8 @@ use by pods without coupling to Kubernetes directly. `secret` volumes are
backed by tmpfs (a RAM-backed filesystem) so they are never written to backed by tmpfs (a RAM-backed filesystem) so they are never written to
non-volatile storage. non-volatile storage.
__Important: You must create a secret in the Kubernetes API before you can use **Important:** You must create a secret in the Kubernetes API before you can use it.
it__ {: .caution}
Secrets are described in more detail [here](/docs/user-guide/secrets). Secrets are described in more detail [here](/docs/user-guide/secrets).
@@ -467,7 +468,7 @@ Currently, the following types of volume sources can be projected:
All sources are required to be in the same namespace as the pod. For more details, see the [all-in-one volume design document](https://github.com/kubernetes/community/blob/{{page.githubbranch}}/contributors/design-proposals/all-in-one-volume.md). All sources are required to be in the same namespace as the pod. For more details, see the [all-in-one volume design document](https://github.com/kubernetes/community/blob/{{page.githubbranch}}/contributors/design-proposals/all-in-one-volume.md).
#### Example pod with a secret, a downward API, and a configmap #### Example pod with a secret, a downward API, and a configmap.
```yaml ```yaml
apiVersion: v1 apiVersion: v1
@@ -507,7 +508,7 @@ spec:
path: my-group/my-config path: my-group/my-config
``` ```
#### Example pod with multiple secrets with a non-default permission mode set #### Example pod with multiple secrets with a non-default permission mode set.
```yaml ```yaml
apiVersion: v1 apiVersion: v1
@@ -554,30 +555,31 @@ A `FlexVolume` enables users to mount vendor volumes into a pod. It expects vend
drivers are installed in the volume plugin path on each kubelet node. This is drivers are installed in the volume plugin path on each kubelet node. This is
an alpha feature and may change in future. an alpha feature and may change in future.
More details are in [here](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/flexvolume/README.md) More details are in [here](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/flexvolume/README.md).
### AzureFileVolume ### AzureFileVolume
A `AzureFileVolume` is used to mount a Microsoft Azure File Volume (SMB 2.1 and 3.0) A `AzureFileVolume` is used to mount a Microsoft Azure File Volume (SMB 2.1 and 3.0)
into a Pod. into a Pod.
More details can be found [here](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/azure_file/README.md) More details can be found [here](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/azure_file/README.md).
### AzureDiskVolume ### AzureDiskVolume
A `AzureDiskVolume` is used to mount a Microsoft Azure [Data Disk](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-about-disks-vhds/) into a Pod. A `AzureDiskVolume` is used to mount a Microsoft Azure [Data Disk](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-about-disks-vhds/) into a Pod.
More details can be found [here](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/azure_disk/README.md) More details can be found [here](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/azure_disk/README.md).
### vsphereVolume ### vsphereVolume
__Prerequisite: Kubernetes with vSphere Cloud Provider configured. **Prerequisite:** Kubernetes with vSphere Cloud Provider configured. For cloudprovider configuration please refer [vSphere getting started guide](/docs/getting-started-guides/vsphere/).
For cloudprovider configuration please refer [vSphere getting started guide](/docs/getting-started-guides/vsphere/).__ {: .note}
A `vsphereVolume` is used to mount a vSphere VMDK Volume into your Pod. The contents A `vsphereVolume` is used to mount a vSphere VMDK Volume into your Pod. The contents
of a volume are preserved when it is unmounted. It supports both VMFS and VSAN datastore. of a volume are preserved when it is unmounted. It supports both VMFS and VSAN datastore.
__Important: You must create VMDK using one of the following method before using with POD.__ **Important:** You must create VMDK using one of the following method before using with POD.
{: .caution}
#### Creating a VMDK volume #### Creating a VMDK volume
@@ -631,8 +633,8 @@ More examples can be found [here](https://git.k8s.io/kubernetes/examples/volumes
A `Quobyte` volume allows an existing [Quobyte](http://www.quobyte.com) volume to be mounted into your pod. A `Quobyte` volume allows an existing [Quobyte](http://www.quobyte.com) volume to be mounted into your pod.
__Important: You must have your own Quobyte setup running with the volumes created **Important:** You must have your own Quobyte setup running with the volumes created before you can use it.
before you can use it__ {: .caution}
See the [Quobyte example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/quobyte) for more details. See the [Quobyte example](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/quobyte) for more details.
@@ -664,9 +666,10 @@ spec:
fsType: "<fs-type>" fsType: "<fs-type>"
``` ```
__Important: Make sure you have an existing PortworxVolume with name `pxvol` before using it in the pod__ **Important:** Make sure you have an existing PortworxVolume with name `pxvol` before using it in the pod.
{: .caution}
More details and examples can be found [here](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/portworx/README.md) More details and examples can be found [here](https://github.com/kubernetes/kubernetes/tree/{{page.githubbranch}}/examples/volumes/portworx/README.md).
### ScaleIO ### ScaleIO
ScaleIO is a software-based storage platform that can use existing hardware to create clusters of scalable ScaleIO is a software-based storage platform that can use existing hardware to create clusters of scalable
@@ -674,8 +677,8 @@ shared block networked storage. The ScaleIO volume plugin allows deployed pods
volumes (or it can dynamically provision new volumes for persistent volume claims, see volumes (or it can dynamically provision new volumes for persistent volume claims, see
[ScaleIO Persistent Volumes](/docs/user-guide/persistent-volumes/#scaleio)). [ScaleIO Persistent Volumes](/docs/user-guide/persistent-volumes/#scaleio)).
__Important: You must have an existing ScaleIO cluster already setup and running with the volumes created **Important:** You must have an existing ScaleIO cluster already setup and running with the volumes created before you can use them.
before you can use them__ {: .caution}
The following is an example pod configuration with ScaleIO: The following is an example pod configuration with ScaleIO:
@@ -713,7 +716,8 @@ At its core, StorageOS provides block storage to containers, accessible via a fi
The StorageOS container requires 64-bit Linux and has no additional dependencies. A free developer licence is available. The StorageOS container requires 64-bit Linux and has no additional dependencies. A free developer licence is available.
__Important: You must run the StorageOS container on each node that wants to access StorageOS volumes or that will contribute storage capacity to the pool. For installation instructions, consult the [StorageOS documentation](https://docs.storageos.com)__ **Important:** You must run the StorageOS container on each node that wants to access StorageOS volumes or that will contribute storage capacity to the pool. For installation instructions, consult the [StorageOS documentation](https://docs.storageos.com).
{: .caution}
```yaml ```yaml
apiVersion: v1 apiVersion: v1
@@ -791,11 +795,11 @@ spec:
path: /mnt/disks/ssd1 path: /mnt/disks/ssd1
``` ```
Note that local PersistentVolume cleanup and deletion requires manual **Note:** The local PersistentVolume cleanup and deletion requires manual intervention without the external provisioner.
intervention without the external provisioner. {: .note}
For details on the `local` volume type, see the [Local Persistent Storage 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) user guide](https://github.com/kubernetes-incubator/external-storage/tree/master/local-volume).
## Using subPath ## Using subPath