dynamic pv cinder

Change-Id: Ibfcce0b8b335e3a89f31ef21f00cbc850ca69012
This commit is contained in:
Dimitris Theoharis
2017-09-30 00:29:46 +03:00
committed by Dimitris (DimGR) Theoharis
parent 732b45ccb3
commit fa5912b687

View File

@@ -2379,6 +2379,40 @@ You can start a shell in the container to check that the mountPath exists,
and on an OpenStack client you can run the command 'cinder list' to verify
that the cinder volume status is 'in-use'.
Using Dynamic PVs in Cinder
+++++++++++++++++++++++++++
1. Create a storage class using "cinder" as the provisioner
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: gold
provisioner: kubernetes.io/cinder
parameters:
availability: nova
2. Based on the storage-class name, add the volumeClaimTemplates parameter
volumeClaimTemplates:
- metadata:
name: <desired_cinder_volume_name>
annotations:
volume.beta.kubernetes.io/storage-class: "gold"
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 9Gi
"volumeClaimTemplates" parameter can only be used with 'kind: statefulSet'
Scaling the statefulSet manually will create a persistent volume in cinder
Manual change of the reclaim policy of a dynamically created persistentVolumeClaim
kubectl patch pv <pv-name> -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
Using Cinder in Swarm
+++++++++++++++++++++