badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright 2020-present Open Networking Foundation |
| 3 | |
Ajay Lotan Thakur | 03189d2 | 2022-02-10 14:06:03 -0600 | [diff] [blame] | 4 | # SPDX-License-Identifier: Apache-2.0 |
badhri85 | 4c028b3 | 2021-11-03 18:24:05 -0500 | [diff] [blame] | 5 | */}} |
| 6 | |
| 7 | {{- if .Values.config.simapp.deploy }} |
| 8 | {{ tuple "simapp" . | include "omec-sub-provision.service_account" }} |
| 9 | --- |
| 10 | apiVersion: apps/v1 |
| 11 | kind: Deployment |
| 12 | metadata: |
| 13 | name: simapp |
| 14 | labels: |
| 15 | {{ tuple "simapp" . | include "omec-sub-provision.metadata_labels" | indent 4 }} |
| 16 | spec: |
| 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 }} |