---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: glusterfs-{{ glusterfs_name }}
{% if glusterfs_storageclass_default is defined and glusterfs_storageclass_default %}
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
{% endif %}
provisioner: kubernetes.io/glusterfs
parameters:
  resturl: "http://{% if glusterfs_heketi_is_native %}heketi-{{ glusterfs_name }}.{{ glusterfs_namespace }}.svc:8080{% else %}{{ glusterfs_heketi_url }}:{{ glusterfs_heketi_port }}{% endif %}"
  restuser: "admin"
{% if glusterfs_heketi_admin_key is defined %}
  secretNamespace: "{{ glusterfs_namespace }}"
  secretName: "heketi-{{ glusterfs_name }}-admin-secret"
{% endif %}
{% if openshift_storage_glusterfs_storageclass_volume_options is defined %}
  volumeoptions: "{{ openshift_storage_glusterfs_storageclass_volume_options }}"
{% endif %}
{% if openshift_storage_glusterfs_storageclass_volume_name_prefix is defined %}
  volumenameprefix: "{{ openshift_storage_glusterfs_storageclass_volume_name_prefix }}"
{% endif %}
{% if openshift_storage_glusterfs_storageclass_volume_type is defined %}
  volumetype: "{{ openshift_storage_glusterfs_storageclass_volume_type }}"
{% endif %}
{% if openshift_storage_glusterfs_storageclass_allow_volume_expansion is defined %}
allowVolumeExpansion: {{ openshift_storage_glusterfs_storageclass_allow_volume_expansion | bool }}
{% endif %}
