aboutsummaryrefslogtreecommitdiffstats
path: root/operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_deployment.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_deployment.tpl')
-rw-r--r--operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_deployment.tpl59
1 files changed, 59 insertions, 0 deletions
diff --git a/operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_deployment.tpl b/operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_deployment.tpl
new file mode 100644
index 0000000..1bfc3a9
--- /dev/null
+++ b/operations/a1-pe-sim-packages/resources/oran-sim-csar/o-ran-simulator/templates/_deployment.tpl
@@ -0,0 +1,59 @@
+{{/* vim: set filetype=mustache: */}}
+
+{{/*
+ Functions here are intended for Deployment resources use only
+*/}}
+
+
+{{/* Generate Deployment's container section */}}
+{{/* Input: Dict with "dot", "name" and "spec" keys */}}
+{{- define "handover-simulator.deployment.containers" -}}
+{{- $name := .name -}}
+{{- $spec := .spec -}}
+{{- $dot := . -}}
+{{- with .dot -}}
+{{- range $owner, $containerSpec := $spec.containers }}
+- name: {{ $owner }}
+ image: "{{ $containerSpec.image.repository }}:{{ $containerSpec.image.tag }}"
+ imagePullPolicy: {{ $containerSpec.image.pullPolicy }}
+ {{- with $containerSpec.env }}
+ env:
+ {{- range $containerSpec.env }}
+ {{/* This is ugly but helm's tpl required root object */}}
+ - name: {{ .name }}
+ value: {{ tpl .value $dot.dot | quote }}
+ {{- end }}
+ {{- end }}
+ {{- with $containerSpec.volumeMounts }}
+ volumeMounts:
+ {{- range $containerSpec.volumeMounts }}
+ - name: {{ .name }}
+ mountPath: {{ .mountPath }}
+ {{- end }}
+ {{- end }}
+ ports:
+ {{- range $spec.service.ports }}
+ {{- if eq $owner .owner }}
+ - name: {{ .name }}
+ containerPort: {{ .port }}
+ protocol: TCP
+ {{- end }}
+ {{- end }}
+ {{- with $containerSpec.volumes }}
+ volumes: {{ toYaml . | nindent 4 }}
+ {{- end }}
+ {{- with $spec.livenessProbe }}
+ livenessProbe:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ {{- with $spec.readinessProbe }}
+ readinessProbe:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+ {{- with $spec.resources }}
+ resources:
+ {{- toYaml . | nindent 4 }}
+ {{- end }}
+{{- end }}
+{{- end -}}
+{{- end -}}