persistent-volume-claim.yml.j2 581 B

123456789101112131415161718192021222324
  1. ---
  2. apiVersion: "v1"
  3. kind: "List"
  4. items:
  5. {% for claim in persistent_volume_claims %}
  6. - apiVersion: "v1"
  7. kind: "PersistentVolumeClaim"
  8. metadata:
  9. name: "{{ claim.name }}"
  10. {% if claim.annotations %}
  11. annotations:
  12. {% for annotation in claim.annotations %}
  13. {{ annotation }}
  14. {% endfor %}
  15. {% endif %}
  16. spec:
  17. accessModes: {{ claim.access_modes | lib_utils_to_padded_yaml(2, 2) }}
  18. resources:
  19. requests:
  20. storage: "{{ claim.capacity }}"
  21. {% if claim.storageclass is not none %}
  22. storageClassName: "{{ claim.storageclass }}"
  23. {% endif %}
  24. {% endfor %}