From 4f509f9faad0e463cbc5dcac057c4da0fda3e969 Mon Sep 17 00:00:00 2001
From: "Suren A. Chilingaryan" <csa@suren.me>
Date: Sun, 6 Oct 2019 04:44:25 +0200
Subject: Support mounting configMaps and secrets in KaaS pods

---
 roles/ands_kaas/templates/50-kaas-app-pods.yml.j2 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/roles/ands_kaas/templates/50-kaas-app-pods.yml.j2 b/roles/ands_kaas/templates/50-kaas-app-pods.yml.j2
index 76ba6eb..7f82836 100644
--- a/roles/ands_kaas/templates/50-kaas-app-pods.yml.j2
+++ b/roles/ands_kaas/templates/50-kaas-app-pods.yml.j2
@@ -229,6 +229,16 @@ objects:
               hostPath:
                 path: {{ vol.path }}
         {% endfor %}
+        {% for vol in (img.configs | default([])) %}
+            - name: cfg-{{imgidx}}-{{loop.index}}
+          {% if (vol.secret | default(false)) | bool %}
+              secret:
+                secretName: {{vol.name}}
+          {% else %}
+              configMap:
+                name: {{vol.name}}
+          {% endif %}
+        {% endfor %}
       {% endfor %}
     {% endif %}
     {% if (pod.groups is defined) or (pod.run_as is defined) %}
@@ -327,6 +337,10 @@ objects:
                 - name: host-{{imgidx}}-{{loop.index}}
                   mountPath: {{ vol.mount }}
         {% endfor %}
+        {% for vol in (img.configs | default([])) %}
+                - name: cfg-{{imgidx}}-{{loop.index}}
+                  mountPath: {{ vol.mount }}
+        {% endfor %}
       {% endif %}
       {% if img.resources is defined %}
               resources:
@@ -364,6 +378,7 @@ objects:
               {{ type }}:
                 timeoutSeconds: {{ probe.timeout | default(1) }}
                 initialDelaySeconds: {{ probe.delay | default(10) }}
+                periodSeconds: {{ probe.period | default(60) }}
             {% if (probe.command is defined) %}
                 exec:
                   command: {{ probe.command | to_json }}
-- 
cgit v1.2.3