update pod persistent volume example storage class (#3979)

* update pod persistent volume example storage class

When binding to a manually created PersistentVolume, the claim must
disable dynamic provisioning by specifying an empty storage class.

Fixes #2803

* use specific storageclass

* revert gibibytes -> gigabytes change
reviewable/pr3988/r5^2
Adnan Abdulhussein 2017-06-14 08:55:58 +02:00 committed by Andrew Chen
parent eb71492f88
commit 1088bca024
3 changed files with 13 additions and 10 deletions

View File

@ -68,7 +68,9 @@ Here is the configuration file for the hostPath PersistentVolume:
The configuration file specifies that the volume is at `/tmp/data` on the
the cluster's Node. The configuration also specifies a size of 10 gibibytes and
an access mode of `ReadWriteOnce`, which means the volume can be mounted as
read-write by a single Node.
read-write by a single Node. It defines the [StorageClass name](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class)
`manual` for the PersistentVolume, which will be used to bind
PersistentVolumeClaim requests to this PersistentVolume.
Create the PersistentVolume:
@ -81,9 +83,8 @@ View information about the PersistentVolume:
The output shows that the PersistentVolume has a `STATUS` of `Available`. This
means it has not yet been bound to a PersistentVolumeClaim.
NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM REASON AGE
task-pv-volume 10Gi RWO Retain Available 17s
NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE
task-pv-volume 10Gi RWO Retain Available manual 4s
## Create a PersistentVolumeClaim
@ -102,7 +103,8 @@ Create the PersistentVolumeClaim:
After you create the PersistentVolumeClaim, the Kubernetes control plane looks
for a PersistentVolume that satisfies the claim's requirements. If the control
plane finds a suitable PersistentVolume, it binds the claim to the volume.
plane finds a suitable PersistentVolume with the same StorageClass, it binds the
claim to the volume.
Look again at the PersistentVolume:
@ -110,9 +112,8 @@ Look again at the PersistentVolume:
Now the output shows a `STATUS` of `Bound`.
kubectl get pv task-pv-volume
NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM REASON AGE
task-pv-volume 10Gi RWO Retain Bound default/task-pv-claim 8m
NAME CAPACITY ACCESSMODES RECLAIMPOLICY STATUS CLAIM STORAGECLASS REASON AGE
task-pv-volume 10Gi RWO Retain Bound default/task-pv-claim manual 2m
Look at the PersistentVolumeClaim:
@ -121,8 +122,8 @@ Look at the PersistentVolumeClaim:
The output shows that the PersistentVolumeClaim is bound to your PersistentVolume,
`task-pv-volume`.
NAME STATUS VOLUME CAPACITY ACCESSMODES AGE
task-pv-claim Bound task-pv-volume 10Gi RWO 5s
NAME STATUS VOLUME CAPACITY ACCESSMODES STORAGECLASS AGE
task-pv-claim Bound task-pv-volume 10Gi RWO manual 30s
## Create a Pod

View File

@ -3,6 +3,7 @@ apiVersion: v1
metadata:
name: task-pv-claim
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:

View File

@ -5,6 +5,7 @@ metadata:
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 10Gi
accessModes: