---
kind: Template
apiVersion: v1
metadata:
  name: gluster-s3-pvcs
  labels:
    glusterfs: s3-pvcs-template
    gluster-s3: pvcs-template
  annotations:
    description: Gluster S3 service template
    tags: glusterfs,heketi,gluster-s3
objects:
- kind: PersistentVolumeClaim
  apiVersion: v1
  metadata:
    name: "${PVC}"
    labels:
      glusterfs: s3-${CLUSTER_NAME}-${S3_ACCOUNT}-storage
      gluster-s3: ${CLUSTER_NAME}-${S3_ACCOUNT}-pvc
    annotations:
      volume.beta.kubernetes.io/storage-class: "glusterfs-${CLUSTER_NAME}-s3"
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: "${PVC_SIZE}"
- kind: PersistentVolumeClaim
  apiVersion: v1
  metadata:
    name: "${META_PVC}"
    labels:
      glusterfs: s3-${CLUSTER_NAME}-${S3_ACCOUNT}-storage
      gluster-s3: ${CLUSTER_NAME}-${S3_ACCOUNT}-meta-pvc
    annotations:
      volume.beta.kubernetes.io/storage-class: "glusterfs-${CLUSTER_NAME}-s3"
  spec:
    accessModes:
    - ReadWriteMany
    resources:
      requests:
        storage: "${META_PVC_SIZE}"
parameters:
- name: S3_ACCOUNT
  displayName: S3 Account Name
  description: S3 storage account which will provide storage on GlusterFS volumes
  required: true
- name: PVC
  displayName: Primary GlusterFS-backed PVC
  description: GlusterFS-backed PVC for object storage
  required: true
- name: PVC_SIZE
  displayName: Primary GlusterFS-backed PVC capacity
  description: Capacity for GlusterFS-backed PVC for object storage
  value: 2Gi
- name: META_PVC
  displayName: Metadata GlusterFS-backed PVC
  description: GlusterFS-backed PVC for object storage metadata
  required: true
- name: META_PVC_SIZE
  displayName: Metadata GlusterFS-backed PVC capacity
  description: Capacity for GlusterFS-backed PVC for object storage metadata
  value: 1Gi
- name: CLUSTER_NAME
  displayName: GlusterFS cluster name
  description: A unique name to identify which heketi service manages this cluster, useful for running multiple heketi instances
  value: storage
