pvc.j2 827 B

12345678910111213141516171819202122232425262728293031323334353637
  1. apiVersion: v1
  2. kind: PersistentVolumeClaim
  3. metadata:
  4. name: "{{obj_name}}"
  5. {% if labels is not defined %}
  6. labels:
  7. metrics-infra: support
  8. {% elif labels %}
  9. labels:
  10. {% for key, value in labels.items() %}
  11. {{ key }}: {{ value }}
  12. {% endfor %}
  13. {% endif %}
  14. {% if annotations is defined and annotations %}
  15. annotations:
  16. {% for key,value in annotations.items() %}
  17. {{key}}: {{value}}
  18. {% endfor %}
  19. {% endif %}
  20. spec:
  21. {% if pv_selector is defined and pv_selector is mapping %}
  22. selector:
  23. matchLabels:
  24. {% for key,value in pv_selector.items() %}
  25. {{key}}: {{value}}
  26. {% endfor %}
  27. {% endif %}
  28. accessModes:
  29. {% for mode in access_modes %}
  30. - {{ mode }}
  31. {% endfor %}
  32. resources:
  33. requests:
  34. storage: {{size}}
  35. {% if storage_class_name is defined %}
  36. storageClassName: {{ storage_class_name }}
  37. {% endif %}