---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: "{{ ansible_operator_meta.name }}-file-storage"
  namespace: "{{ ansible_operator_meta.namespace }}"
  labels:
    app.kubernetes.io/name: '{{ deployment_type }}-storage'
    app.kubernetes.io/instance: '{{ deployment_type }}-storage-{{ ansible_operator_meta.name }}'
    app.kubernetes.io/component: storage
    app.kubernetes.io/part-of: '{{ deployment_type }}'
    app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
spec:
{% if file_storage_size is defined %}
  resources:
    requests:
      storage: "{{ file_storage_size }}"
{% endif %}
  accessModes:
    - "{{ file_storage_access_mode }}"
{% if file_storage_storage_class is defined %}
  storageClassName: '{{ file_storage_storage_class }}'
{% endif %}
