blob: 87911bda192da076874489c58faed4847da1a723 [file] [log] [blame]
badhri854c028b32021-11-03 18:24:05 -05001{{/*
2# Copyright 2020-present Open Networking Foundation
3
Ajay Lotan Thakur03189d22022-02-10 14:06:03 -06004# SPDX-License-Identifier: Apache-2.0
badhri854c028b32021-11-03 18:24:05 -05005*/}}
6
7{{- if .Values.config.simapp.deploy }}
8{{ tuple "simapp" . | include "omec-sub-provision.service_account" }}
9---
10apiVersion: apps/v1
11kind: Deployment
12metadata:
13 name: simapp
14 labels:
15{{ tuple "simapp" . | include "omec-sub-provision.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 #serviceName: simapp-headless
19 selector:
20 matchLabels:
21{{ tuple "simapp" . | include "omec-sub-provision.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "simapp" . | include "omec-sub-provision.metadata_labels" | indent 8 }}
26 {{- with .Values.config.simapp.podAnnotations }}
27 annotations:
28 helm.sh/hook: pre-install
29 helm.sh/hook-weight: "5"
30 {{- toYaml . | nindent 8 }}
31 {{- end }}
32 spec:
33 serviceAccountName: simapp
34 {{- if hasKey .Values.images "pullSecrets" }}
35 imagePullSecrets:
36{{ toYaml .Values.images.pullSecrets | indent 8 }}
37 {{- end }}
Ajay Lotan Thakurd9252122022-08-30 22:35:59 +000038 initContainers:
Ajay Lotan Thakureadf7702022-09-30 00:02:58 -060039 - name: wait-simapp-module2
40 image: {{ .Values.images.repository }}{{ .Values.images.tags.init }}
41 imagePullPolicy: {{ .Values.images.pullPolicy }}
42 command: ['sh', '-c', 'until nslookup simapp; do echo waiting for simapp; sleep 4; done;']
43 {{- if .Values.config.coreDump.enabled }}
Ajay Lotan Thakurd9252122022-08-30 22:35:59 +000044 {{ tuple "simapp" . | include "omec-sub-provision.coredump_init" | indent 6 }}
badhri854c028b32021-11-03 18:24:05 -050045 {{- end }}
46 containers:
47 - name: simapp
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -070048 image: {{ .Values.images.repository }}{{ .Values.images.tags.simapp }}
badhri854c028b32021-11-03 18:24:05 -050049 imagePullPolicy: {{ .Values.images.pullPolicy }}
50 {{- if .Values.config.coreDump.enabled }}
51 securityContext:
52 runAsUser: 0
53 {{- end }}
54 stdin: true
55 tty: true
56 command: ["/simapp/script/simapp-run.sh"]
57 env:
58 - name: POD_IP
59 valueFrom:
60 fieldRef:
61 fieldPath: status.podIP
62 {{- if .Values.resources.enabled }}
63 resources:
64{{ toYaml .Values.resources.simapp | indent 10 }}
65 {{- end }}
66 volumeMounts:
67 - name: run-script
68 mountPath: /simapp/script/simapp-run.sh
69 subPath: simapp-run.sh
70 - name: nf-config
71 mountPath: /simapp/config
72 {{- if .Values.config.coreDump.enabled }}
73 - name: coredump
74 mountPath: /tmp/coredump
75 {{- end }}
76 volumes:
77 - name: run-script
78 configMap:
79 name: simapp
80 defaultMode: 493
81 - name: nf-config
82 configMap:
83 name: simapp
84 defaultMode: 493
85 {{- if .Values.config.coreDump.enabled }}
86 - name: host-rootfs
87 hostPath:
88 path: /
89 - name: coredump
90 hostPath:
91 path: {{ .Values.config.coreDump.path }}
92 {{- end }}
93{{- end }}