blob: 62c4547f3b45fed4b4432656bb9ad9010355d688 [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 }}
38 initContainers:
39 - name: wait-simapp-module2
40 image: {{ .Values.images.tags.init | quote }}
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 }}
44{{ tuple "simapp" . | include "omec-sub-provision.coredump_init" | indent 6 }}
45 {{- end }}
46 containers:
47 - name: simapp
48 image: {{ .Values.images.tags.simapp }}
49 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 }}