pvc.j2 556 B

123456789101112131415161718192021222324252627
  1. apiVersion: v1
  2. kind: PersistentVolumeClaim
  3. metadata:
  4. name: {{obj_name}}
  5. {% if annotations is defined %}
  6. annotations:
  7. {% for key,value in annotations.iteritems() %}
  8. {{key}}: {{value}}
  9. {% endfor %}
  10. {% endif %}
  11. spec:
  12. {% if pv_selector is defined and pv_selector is mapping %}
  13. selector:
  14. matchLabels:
  15. {% for key,value in pv_selector.iteritems() %}
  16. {{key}}: {{value}}
  17. {% endfor %}
  18. {% endif %}
  19. accessModes:
  20. {% for mode in access_modes %}
  21. - {{mode}}
  22. {% endfor %}
  23. resources:
  24. requests:
  25. storage: {{size}}
  26. storageClassName: ""