summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas
diff options
context:
space:
mode:
Diffstat (limited to 'roles/ands_kaas')
-rw-r--r--roles/ands_kaas/tasks/do_project.yml1
-rw-r--r--roles/ands_kaas/tasks/file.yml2
-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
4 files changed, 16 insertions, 16 deletions
diff --git a/roles/ands_kaas/tasks/do_project.yml b/roles/ands_kaas/tasks/do_project.yml
index 61b91d2..a876d94 100644
--- a/roles/ands_kaas/tasks/do_project.yml
+++ b/roles/ands_kaas/tasks/do_project.yml
@@ -59,4 +59,3 @@
- kaas_project_config.oc is undefined
- kaas_project_config.pods != {}
-
diff --git a/roles/ands_kaas/tasks/file.yml b/roles/ands_kaas/tasks/file.yml
index 479ec68..e6b2e8d 100644
--- a/roles/ands_kaas/tasks/file.yml
+++ b/roles/ands_kaas/tasks/file.yml
@@ -16,7 +16,7 @@
- name: "Setting up files in {{ path }}"
file:
path: "{{ path }}"
- recurse: "{{ file.recurse | default(true) }}"
+ recurse: "{{ file.recurse | default(false) }}"
mode: "{{ file.mode | default( ((file.state | default('directory')) == 'directory') | ternary('0755', '0644') ) }}"
owner: "{{ owner }}"
group: "{{ group }}"
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 }}: