summaryrefslogtreecommitdiffstats
path: root/setup/projects/kaas/templates/40-kaas-manager.yml.j2
diff options
context:
space:
mode:
Diffstat (limited to 'setup/projects/kaas/templates/40-kaas-manager.yml.j2')
-rw-r--r--setup/projects/kaas/templates/40-kaas-manager.yml.j291
1 files changed, 91 insertions, 0 deletions
diff --git a/setup/projects/kaas/templates/40-kaas-manager.yml.j2 b/setup/projects/kaas/templates/40-kaas-manager.yml.j2
new file mode 100644
index 0000000..e181737
--- /dev/null
+++ b/setup/projects/kaas/templates/40-kaas-manager.yml.j2
@@ -0,0 +1,91 @@
+#jinja2: trim_blocks: "true", lstrip_blocks: "false"
+---
+{% set gid_range = kaas_openshift_gid_ranges[kaas_project].split("/") %}
+apiVersion: v1
+kind: Template
+metadata:
+ name: kaas-manager
+ annotations:
+ descriptions: KaaS Data Management Service
+objects:
+ - apiVersion: v1
+ kind: DeploymentConfig
+ metadata:
+ name: kaas-manager
+ spec:
+ replicas: 1
+ revisionHistoryLimit: {{ kaas_pod_history_limit }}
+ strategy:
+ type: Rolling
+ triggers:
+ - type: ConfigChange
+ selector:
+ name: kaas-manager
+ triggers:
+ - type: ConfigChange
+ - type: ImageChange
+ imageChangeParams:
+ automatic: true
+ from:
+ kind: "ImageStreamTag"
+ name: "kaas-manager:latest"
+ namespace: "kaas"
+ containerNames:
+ - kaas-manager
+ template:
+ metadata:
+ name: kaas-manager
+ labels:
+ name: kaas-manager
+ spec:
+ securityContext:
+ supplementalGroups:
+{% for ofs in range(gid_range[1] | default(1) | int) %}
+ - {{ (gid_range[0] | int) + ofs }}
+{% endfor %}
+{% if (kaas_project_config.run_pods_as is defined) %}
+{% if ((kaas_project_config.uids | default(kaas_openshift_uids))[kaas_project_config.run_pods_as] is defined) %}
+ runAsUser: {{ (kaas_project_config.uids | default(kaas_openshift_uids))[kaas_project_config.run_pods_as].id }}
+{% else %}
+ runAsUser: {{ kaas_project_config.run_pods_as }}
+{% endif %}
+{% endif %}
+ volumes:
+{% for name, vol in kaas_project_volumes.iteritems() %}
+{% set oc_name = name | regex_replace('_','-') %}
+{% if (vol.write | default(false)) %}
+ - name: vol-{{ name }}
+ persistentVolumeClaim:
+ claimName: {{ oc_name }}
+{% endif %}
+{% endfor %}
+{% if ('data' not in kaas_project_volumes) %}
+ - name: home
+ emptyDir: {}
+{% endif %}
+ containers:
+ - name: kaas-manager
+ image: kaas-manager
+ command: [ "/docker-entrypoint.sh", "/bin/sx" ]
+ volumeMounts:
+{% for name, vol in kaas_project_volumes.iteritems() %}
+{% if (vol.write | default(false)) %}
+ - name: vol-{{ name }}
+ mountPath: /mnt/{{ name }}
+{% endif %}
+{% endfor %}
+{% if ('data' not in kaas_project_volumes) %}
+ - name: home
+ mountPath: /home
+{% endif %}
+ env:
+ - name: HOME
+{% if ('data' in kaas_project_volumes) %}
+ value: /mnt/data/home
+{% else %}
+ value: /tmp
+{% endif %}
+# lifecycle:
+# postStart:
+# exec:
+# command: [ "/bin/bash", "[ -d $HOME ] || mkdir -p $HOME" ]