blob: 08bc33605085add0ca5c8e10611efda79398da08 [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 }}
badhri854c028b32021-11-03 18:24:05 -050038 {{- if .Values.config.coreDump.enabled }}
Ajay Lotan Thakurd9252122022-08-30 22:35:59 +000039 initContainers:
40 {{ tuple "simapp" . | include "omec-sub-provision.coredump_init" | indent 6 }}
badhri854c028b32021-11-03 18:24:05 -050041 {{- end }}
42 containers:
43 - name: simapp
Ajay Lotan Thakur71115fe2022-03-03 22:26:08 -070044 image: {{ .Values.images.repository }}{{ .Values.images.tags.simapp }}
badhri854c028b32021-11-03 18:24:05 -050045 imagePullPolicy: {{ .Values.images.pullPolicy }}
46 {{- if .Values.config.coreDump.enabled }}
47 securityContext:
48 runAsUser: 0
49 {{- end }}
50 stdin: true
51 tty: true
52 command: ["/simapp/script/simapp-run.sh"]
53 env:
54 - name: POD_IP
55 valueFrom:
56 fieldRef:
57 fieldPath: status.podIP
58 {{- if .Values.resources.enabled }}
59 resources:
60{{ toYaml .Values.resources.simapp | indent 10 }}
61 {{- end }}
62 volumeMounts:
63 - name: run-script
64 mountPath: /simapp/script/simapp-run.sh
65 subPath: simapp-run.sh
66 - name: nf-config
67 mountPath: /simapp/config
68 {{- if .Values.config.coreDump.enabled }}
69 - name: coredump
70 mountPath: /tmp/coredump
71 {{- end }}
72 volumes:
73 - name: run-script
74 configMap:
75 name: simapp
76 defaultMode: 493
77 - name: nf-config
78 configMap:
79 name: simapp
80 defaultMode: 493
81 {{- if .Values.config.coreDump.enabled }}
82 - name: host-rootfs
83 hostPath:
84 path: /
85 - name: coredump
86 hostPath:
87 path: {{ .Values.config.coreDump.path }}
88 {{- end }}
89{{- end }}