123456789101112131415161718192021 |
- ---
- apiVersion: v1
- kind: List
- items:
- {% for volume in persistent_volumes %}
- - apiVersion: v1
- kind: PersistentVolume
- metadata:
- name: "{{ volume.name }}"
- {% if volume.labels is defined and volume.labels is mapping %}
- labels:
- {% for key,value in volume.labels.items() %}
- {{ key }}: {{ value }}
- {% endfor %}
- {% endif %}
- spec:
- capacity:
- storage: "{{ volume.capacity }}"
- accessModes: {{ volume.access_modes | to_padded_yaml(2, 2) }}
- {{ (volume.storage.keys() | list)[0] }}: {{ volume.storage[(volume.storage.keys() | list)[0]] | to_padded_yaml(3, 2) }}
- {% endfor %}
|