-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy patheda-ui.deployment.yaml.j2
More file actions
105 lines (105 loc) · 3.86 KB
/
Copy patheda-ui.deployment.yaml.j2
File metadata and controls
105 lines (105 loc) · 3.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ ansible_operator_meta.name }}-ui"
namespace: "{{ ansible_operator_meta.namespace }}"
labels:
{{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=4) | trim }}
{{ lookup("template", "../common/templates/labels/version.yaml.j2") | indent(width=4) | trim }}
app.kubernetes.io/component: '{{ deployment_type }}-ui'
spec:
replicas: {{ combined_ui.replicas }}
{% if combined_ui.strategy is defined %}
strategy:
type: {{ combined_ui.strategy.type }}
{% if combined_ui.strategy.type == "Recreate" %}
rollingUpdate: null
{% elif combined_ui.strategy.type == "RollingUpdate" %}
rollingUpdate:
maxSurge: {{ combined_ui.strategy.rollingUpdate.maxSurge | default("25%")}}
maxUnavailable: {{ combined_ui.strategy.rollingUpdate.maxUnavailable | default("25%")}}
{% endif %}
{% endif %}
selector:
matchLabels:
app.kubernetes.io/name: '{{ ansible_operator_meta.name }}'
app.kubernetes.io/managed-by: '{{ deployment_type }}-operator'
app.kubernetes.io/component: '{{ deployment_type }}-ui'
template:
metadata:
labels:
{{ lookup("template", "../common/templates/labels/common.yaml.j2") | indent(width=8) | trim }}
{{ lookup("template", "../common/templates/labels/version.yaml.j2") | indent(width=8) | trim }}
app.kubernetes.io/component: '{{ deployment_type }}-ui'
annotations:
kubectl.kubernetes.io/default-container: 'eda-ui'
{% for template in [
"eda.configmap",
] %}
checksum-{{ template | replace('/', '-') }}: "{{ lookup('template', template + '.yaml.j2') | sha1 }}"
{% endfor %}
{% for secret in [
"secrets/db_fields_encryption",
] %}
checksum-secret-{{ secret }}: "{{ lookup('ansible.builtin.vars', secret, default='')["resources"][0]["data"] | default('') | sha1 }}"
{% endfor %}
spec:
{% if image_pull_secrets | length > 0 %}
imagePullSecrets:
{% for secret in image_pull_secrets %}
- name: {{ secret }}
{% endfor %}
{% endif %}
{% if combined_ui.node_selector is defined %}
nodeSelector:
{{ combined_ui.node_selector | to_nice_yaml | indent(width=8) }}
{% endif %}
{% if combined_ui.tolerations is defined %}
tolerations:
{{ combined_ui.tolerations | to_nice_yaml | indent(width=8) }}
{% endif %}
{% if combined_ui.topology_spread_constraints is defined %} %}
topologySpreadConstraints:
{{ combined_ui.topology_spread_constraints | indent(width=8) }}
{% endif %}
{% if combined_ui.affinity is defined and combined_ui.affinity | length > 0 %}
affinity:
{{ combined_ui.affinity | to_nice_yaml | indent(width=8) }}
{% endif %}
containers:
- name: eda-ui
image: {{ _image_web }}
imagePullPolicy: '{{ image_pull_policy }}'
envFrom:
- configMapRef:
name: '{{ ansible_operator_meta.name }}-{{ deployment_type }}-env-properties'
ports:
- containerPort: 8080
readinessProbe:
httpGet:
path: /
port: 8080
failureThreshold: 1
periodSeconds: 10
livenessProbe:
httpGet:
path: /
port: 8080
failureThreshold: 1
periodSeconds: 10
{% if combined_ui.resource_requirements is defined %}
resources: {{ combined_ui.resource_requirements }}
{% endif %}
volumeMounts:
- name: {{ ansible_operator_meta.name }}-nginx-default-conf-template
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
volumes:
- name: {{ ansible_operator_meta.name }}-nginx-default-conf-template
configMap:
name: '{{ ansible_operator_meta.name }}-{{ deployment_type }}-configmap'
items:
- key: nginx_default_conf_template
path: nginx.conf