summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas/templates
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ands_kaas/templates')
-rw-r--r--roles/ands_kaas/templates/00-gfs-volumes.yml.j2 (renamed from roles/ands_kaas/templates/0-gfs-volumes.yml.j2)4
-rw-r--r--roles/ands_kaas/templates/50-kaas-pods.yml.j2 (renamed from roles/ands_kaas/templates/6-kaas-pods.yml.j2)25
2 files changed, 15 insertions, 14 deletions
diff --git a/roles/ands_kaas/templates/0-gfs-volumes.yml.j2 b/roles/ands_kaas/templates/00-gfs-volumes.yml.j2
index 8e5842a..c90c610 100644
--- a/roles/ands_kaas/templates/0-gfs-volumes.yml.j2
+++ b/roles/ands_kaas/templates/00-gfs-volumes.yml.j2
@@ -16,10 +16,10 @@ objects:
persistentVolumeReclaimPolicy: Retain
glusterfs:
endpoints: {{ kaas_glusterfs_endpoints }}
- path: {{ vol.volume }}
+ path: "{{ vol.volume }}{{vol.path}}"
readOnly: {{ not (vol.write | default(false)) }}
accessModes:
- - {{ vol.access | default('ReadWriteMany') }}
+ - {{ vol.access | default(vol.write | default(false) | ternary('ReadWriteMany', 'ReadOnlyMany')) }}
capacity:
storage: {{ vol.capacity | default(kaas_default_volume_capacity) }}
claimRef:
diff --git a/roles/ands_kaas/templates/6-kaas-pods.yml.j2 b/roles/ands_kaas/templates/50-kaas-pods.yml.j2
index d5418d3..49dab3f 100644
--- a/roles/ands_kaas/templates/6-kaas-pods.yml.j2
+++ b/roles/ands_kaas/templates/50-kaas-pods.yml.j2
@@ -32,7 +32,7 @@ objects:
{% endfor %}
{% endif %}
{% if (pod.service.ports is defined) and (pod.service.host is defined) %}
- {% set first_port = (pod.service.ports[0] | string).split('/')[0] %}
+ {% set first_port = (pod.service.ports[0] | string).split('/') %}
- apiVersion: v1
kind: Route
metadata:
@@ -43,8 +43,8 @@ objects:
kind: Service
name: {{ pod.name | default(name) }}
port:
- targetPort: {{ first_port }}
- {% if (first_port == "80") %}
+ targetPort: {{ (first_port[1] is defined) | ternary(first_port[1], first_port[0]) }}
+ {% if (first_port[0] == "80") %}
tls:
termination: edge
insecureEdgeTerminationPolicy: Allow
@@ -69,6 +69,11 @@ objects:
name: {{ pod.name | default(name) }}
spec:
replicas: {{ pod.sched.replicas | default(1) }}
+ revisionHistoryLimit: 2
+ strategy:
+ type: {{ pod.sched.strategy | default('Rolling') }}
+ triggers:
+ - type: ConfigChange
selector:
name: {{ pod.name | default(name) }}
template:
@@ -76,10 +81,6 @@ objects:
name: {{ pod.name | default(name) }}
labels:
name: {{ pod.name | default(name) }}
- strategy:
- type: {{ pod.sched.strategy | default('Rolling') }}
- triggers:
- - type: ConfigChange
spec:
{% if pod.selector is defined %}
nodeSelector:
@@ -106,7 +107,7 @@ objects:
{% if (kaas_project_config.uids | default(kaas_openshift_uids))[pod.run_as] is defined %}
- {{ (kaas_project_config.uids | default(kaas_openshift_uids))[pod.run_as].id }}
{% else %}
- - pod.run_as
+ - {{ pod.run_as }}
{% endif %}
{% endif %}
{% if (pod.groups is defined) %}
@@ -115,7 +116,7 @@ objects:
{% if (kaas_project_config.gids | default(kaas_openshift_gids))[group] is defined %}
- {{ (kaas_project_config.gids | default(kaas_openshift_gids))[group].id }}
{% else %}
- - group
+ - {{ group }}
{% endif %}
{% endfor %}
{% endif %}
@@ -165,18 +166,18 @@ objects:
volumeMounts:
{% for vol in img.mappings %}
- name: vol-{{imgidx}}-{{loop.index}}
- subPath: {{ (((kaas_project_config.volumes | default(kaas_openshift_volumes))[vol.name].path | default("")) ~ "/") | regex_replace('^/','') }}{{ vol.path | default("") }}
+ subPath: {{ vol.path | default("") }}
mountPath: {{ vol.mount }}
{% endfor %}
{% endif %}
{% if img.probes is defined %}
{% for probe in img.probes %}
{% if (probe.type is undefined) %}
- {% set seq = ['livenessProbe', 'readynessProbe'] %}
+ {% set seq = ['livenessProbe', 'readinessProbe'] %}
{% elif (probe.type == "liveness") %}
{% set seq = ['livenessProbe'] %}
{% else %}
- {% set seq = ['readynessProbe'] %}
+ {% set seq = ['readinessProbe'] %}
{% endif %}
{% for type in seq %}
{{ type }}: