mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 13:54:37 +03:00
Enable configuring mountOptions, reclaimPolicy and volumeBindingMode … (#10450)
* Enable configuring mountOptions, reclaimPolicy and volumeBindingMode for cinder-csi StorageClasses * Check if class.mount_options is defined at all, before generating the option list
This commit is contained in:
@@ -48,3 +48,13 @@
|
|||||||
## Make sure to source in the openstack credentials
|
## Make sure to source in the openstack credentials
|
||||||
# cinder_csi_enabled: true
|
# cinder_csi_enabled: true
|
||||||
# cinder_csi_controller_replicas: 1
|
# cinder_csi_controller_replicas: 1
|
||||||
|
# storage_classes:
|
||||||
|
# - name: "cinder-csi"
|
||||||
|
# provisioner: "kubernetes.io/cinder"
|
||||||
|
# mount_options:
|
||||||
|
# - "discard"
|
||||||
|
# parameters:
|
||||||
|
# type: "thin"
|
||||||
|
# availability: "nova"
|
||||||
|
# reclaim_policy: "Delete"
|
||||||
|
# volume_binding_mode: "WaitForFirstConsumer"
|
||||||
|
|||||||
@@ -7,9 +7,21 @@ metadata:
|
|||||||
annotations:
|
annotations:
|
||||||
storageclass.kubernetes.io/is-default-class: "{{ class.is_default | default(false) | ternary("true","false") }}"
|
storageclass.kubernetes.io/is-default-class: "{{ class.is_default | default(false) | ternary("true","false") }}"
|
||||||
provisioner: kubernetes.io/cinder
|
provisioner: kubernetes.io/cinder
|
||||||
|
{% if class.mount_options is defined %}
|
||||||
|
mountOptions:
|
||||||
|
{% for option in class.mount_options | default([]) %}
|
||||||
|
- "{{ option }}"
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
parameters:
|
parameters:
|
||||||
{% for key, value in (class.parameters | default({})).items() %}
|
{% for key, value in (class.parameters | default({})).items() %}
|
||||||
"{{ key }}": "{{ value }}"
|
"{{ key }}": "{{ value }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if class.reclaim_policy is defined %}
|
||||||
|
reclaimPolicy: "{{ class.reclaim_policy }}"
|
||||||
|
{% endif %}
|
||||||
|
{% if class.volume_binding_mode is defined %}
|
||||||
|
volumeBindingMode: "{{ class.volume_binding_mode }}"
|
||||||
|
{% endif %}
|
||||||
allowVolumeExpansion: {{ expand_persistent_volumes }}
|
allowVolumeExpansion: {{ expand_persistent_volumes }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user