summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/templates/00-gfs-volumes.yml.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ands_kaas/templates/00-gfs-volumes.yml.j2')
-rw-r--r--roles/ands_kaas/templates/00-gfs-volumes.yml.j239
1 files changed, 39 insertions, 0 deletions
diff --git a/roles/ands_kaas/templates/00-gfs-volumes.yml.j2 b/roles/ands_kaas/templates/00-gfs-volumes.yml.j2
new file mode 100644
index 0000000..c90c610
--- /dev/null
+++ b/roles/ands_kaas/templates/00-gfs-volumes.yml.j2
@@ -0,0 +1,39 @@
+---
+apiVersion: v1
+kind: Template
+metadata:
+ name:
+ annotations:
+ descriptions: "KATRIN Volumes"
+objects:
+{% for name, vol in (kaas_project_config.volumes | default(kaas_openshift_volumes)).iteritems() %}
+{% set oc_name = vol.name | default(name) | regex_replace('_','-') %}
+ - apiVersion: v1
+ kind: PersistentVolume
+ metadata:
+ name: {{ oc_name }}
+ spec:
+ persistentVolumeReclaimPolicy: Retain
+ glusterfs:
+ endpoints: {{ kaas_glusterfs_endpoints }}
+ path: "{{ vol.volume }}{{vol.path}}"
+ readOnly: {{ not (vol.write | default(false)) }}
+ accessModes:
+ - {{ vol.access | default(vol.write | default(false) | ternary('ReadWriteMany', 'ReadOnlyMany')) }}
+ capacity:
+ storage: {{ vol.capacity | default(kaas_default_volume_capacity) }}
+ claimRef:
+ name: {{ oc_name }}
+ namespace: {{ kaas_project }}
+ - apiVersion: v1
+ kind: PersistentVolumeClaim
+ metadata:
+ name: {{ oc_name }}
+ spec:
+ volumeName: {{ oc_name }}
+ accessModes:
+ - {{ vol.access | default('ReadWriteMany') }}
+ resources:
+ requests:
+ storage: {{ vol.capacity | default(kaas_default_volume_capacity) }}
+{% endfor %}