-
Notifications
You must be signed in to change notification settings - Fork 4
/
response_configmap.yaml
42 lines (42 loc) · 1.67 KB
/
response_configmap.yaml
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
{{- if (and .Values.healthcheck.enabled (not .Values.healthcheck.responseConfigMap)) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: response-config-hc
namespace: {{.Release.Namespace}}
labels:
app: {{ .Values.healthcheck.app }}
{{ include "sd-cl.labels" . | indent 4 }}
data:
response.j2: |
{{- if (.Values.healthcheck.templateOutput.enabled) }}
{{ .Files.Get "template.config" | indent 4}}
{{- else }}
{
"appName": "{{"{{"}} name {{"}}"}}",
"appHealthstatus": "{{"{{"}} healthStatus {{"}}"}}",
"appDescription": "{{"{{"}} description {{"}}"}}",
"components": [{% for comp in capabilities %}
{
"Name": "{{"{{"}} comp.name {{"}}"}}",
"HealthStatus": "{{"{{"}} comp.healthStatus {{"}}"}}",
"Replicas": {{"{{"}} comp.replicas | int {{"}}"}},
"Type": "{{"{{"}} comp.type {{"}}"}}",
"pods": [{% for po in comp.pod %}
{
"podName": "{{"{{"}} po.name {{"}}"}}",
"podContainerRestarts": {{"{{"}} po.containersRestarts | int {{"}}"}},
"podStatus": "{{"{{"}} po.status {{"}}"}}",
"podContainersReady": "{{"{{"}} po.containersReady {{"}}"}}"
}{% if not loop.last %},{% endif %}{% endfor %}],
"podStats": {
"Running": {{"{{"}} comp.podStatus.running | int {{"}}"}},
"Waiting": {{"{{"}} comp.podStatus.waiting | int {{"}}"}},
"Failed": {{"{{"}} comp.podStatus.failed | int {{"}}"}},
"Succeeded": {{"{{"}} comp.podStatus.succeeded | int {{"}}"}}
}
}{% if not loop.last %},{% endif %}{% endfor %}
]
}
{{- end }}
{{- end }}