-
Notifications
You must be signed in to change notification settings - Fork 1
PersistentVolumeClaim
Gregory Nickonov edited this page Mar 12, 2019
·
3 revisions
R.persistent_volume_claim :database do
access_mode :ReadWriteOnce
storage_class_name :ssd
storage_request '2Gi'
endThis will create PersistentVolumeClaim requesting 2 Gigabytes of storage with the storage class ssd.
| Sunstone property | Kubernetes property | Type |
|---|---|---|
| metadata | metadata | Kubernetes Object Metadata |
| spec | spec | PersistentVolumeClaimSpec |
Shortcut to add specified values to spec.access_modes array. For aesthetic purposes access_mode alias is available:
R.persistent_volume_claim :storage do
access_mode :ReadWriteMany
endSee Persistent Volumes Access Modes in Kubernetes documentation for the list available values and their meaning.
Adds specified sets of labels to spec.selector:
R.persistent_volume_claim :storage do
match_labels speed: :fast, region: :west
endShortcut to spec.storage_class_name:
R.persistent_volume_claim :storage do
storage_class_name :ssd
endShortcut to spec.storage_limit:
R.persistent_volume_claim :storage do
storage_limit '8Gi'
endShortcut to spec.storage_request:
R.persistent_volume_claim :storage do
storage_request '2Gi'
end| Sunstone property | Kubernetes property | Type |
|---|---|---|
| access_modes | accessModes | Array of String |
| data_source | dataSource | TypedLocalObjectReference |
| selector | selector | LabelSelector |
| storage_class_name | storageClassName | String |
| resources | resources | ResourceRequirements |
| volume_mode | volumeMode | String |
| volume_name | volumeName | String |
Sets the value of resources.limits.storage:
R.persistent_volume_claim :database do
spec.storage_limit '8Gi'
endSets the value of resources.requests.storage:
R.persistent_volume_claim :database do
spec.storage_request '2Gi'
end