summaryrefslogtreecommitdiffstats
path: root/roles/ands_kaas
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-03-11 19:56:38 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-03-11 19:56:38 +0100
commitf3c41dd13a0a86382b80d564e9de0d6b06fb1dbf (patch)
tree3522ce77203da92bb2b6f7cfa2b0999bf6cc132c /roles/ands_kaas
parent6bc3a3ac71e11fb6459df715536fec373c123a97 (diff)
downloadands-f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf.tar.gz
ands-f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf.tar.bz2
ands-f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf.tar.xz
ands-f3c41dd13a0a86382b80d564e9de0d6b06fb1dbf.zip
Various fixes before moving to hardware installation
Diffstat (limited to 'roles/ands_kaas')
-rw-r--r--roles/ands_kaas/templates/50-kaas-pods.yml.j216
1 files changed, 8 insertions, 8 deletions
diff --git a/roles/ands_kaas/templates/50-kaas-pods.yml.j2 b/roles/ands_kaas/templates/50-kaas-pods.yml.j2
index 216dc01..ad1fc58 100644
--- a/roles/ands_kaas/templates/50-kaas-pods.yml.j2
+++ b/roles/ands_kaas/templates/50-kaas-pods.yml.j2
@@ -5,7 +5,7 @@ kind: Template
metadata:
name: {{ kaas_project }}-pods
annotations:
- descriptions: {{ kaas_project_config.description | default(kaas_project ~ "auto-generated pod template") }}
+ descriptions: {{ kaas_project_config.description | default(kaas_project ~ " auto-generated pod template") }}
objects:
{% for name, pod in kaas_project_pods.iteritems() %}
{% set pubkey = "kaas_" ~ name ~ "_pubkey" %}
@@ -14,6 +14,9 @@ objects:
{% if pod.variant is defined %}
{% set pod = pod[pod.variant] %}
{% endif %}
+ {% set sched = pod.sched | default({}) %}
+ {% set node_selector = (sched.selector is defined) | ternary(sched.selector, ands_default_node_selector | combine(sched.restrict | default({}))) %}
+
{% if pod.service is defined %}
- apiVersion: v1
kind: Service
@@ -68,10 +71,10 @@ objects:
metadata:
name: {{ pod.name | default(name) }}
spec:
- replicas: {{ ( pod.sched | default({})).replicas | default(1) }}
+ replicas: {{ ( sched | default({})).replicas | default(1) }}
revisionHistoryLimit: 2
strategy:
- type: {{ (pod.sched | default({})).strategy | default('Rolling') }}
+ type: {{ (sched | default({})).strategy | default('Rolling') }}
triggers:
- type: ConfigChange
selector:
@@ -82,11 +85,8 @@ objects:
labels:
name: {{ pod.name | default(name) }}
spec:
- {% if pod.selector is defined %}
- nodeSelector:
- {% for skey, sval in pod.selector.iteritems() %}
- {{ skey }}: "{{ sval }}"
- {% endfor %}
+ {% if node_selector | length > 0 %}
+ nodeSelector: {{ node_selector | to_json }}
{% endif %}
{% set mappings = (pod.images | json_query('[*].mappings') | length) %}
{% if mappings > 0 %}