blob: 5bb82dd7bc0f8459af90f8e02140f43a736a5087 [file] [log] [blame]
Osman Amjadca078812021-12-15 14:31:54 -06001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.dbtestapp.deploy }}
8{{ tuple "dbtestapp" . | include "5g-test-apps.service_account" }}
9---
10apiVersion: apps/v1
11kind: Deployment
12metadata:
13 name: dbtestapp
14 labels:
15{{ tuple "dbtestapp" . | include "5g-test-apps.metadata_labels" | indent 4 }}
16spec:
17 replicas: {{ .Values.config.dbtestapp.replica }}
18 #serviceName: dbtestapp-headless
19 selector:
20 matchLabels:
21{{ tuple "dbtestapp" . | include "5g-test-apps.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "dbtestapp" . | include "5g-test-apps.metadata_labels" | indent 8 }}
26 {{- with .Values.config.dbtestapp.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: dbtestapp
34 {{- if hasKey .Values.images "pullSecrets" }}
35 imagePullSecrets:
36{{ toYaml .Values.images.pullSecrets | indent 8 }}
37 {{- end }}
38 containers:
39 - name: dbtestapp
40 image: {{ .Values.images.tags.dbtestapp }}
41 imagePullPolicy: {{ .Values.images.pullPolicy }}
42 {{- if .Values.config.coreDump.enabled }}
43 securityContext:
44 runAsUser: 0
45 {{- end }}
46 stdin: true
47 tty: true
48 command: ["/dbtestapp/script/dbtestapp-run.sh"]
49 env:
50 - name: POD_IP
51 valueFrom:
52 fieldRef:
53 fieldPath: status.podIP
54 {{- if .Values.resources.enabled }}
55 resources:
56{{ toYaml .Values.resources.dbtestapp | indent 10 }}
57 {{- end }}
58 volumeMounts:
59 - name: run-script
60 mountPath: /dbtestapp/script/dbtestapp-run.sh
61 subPath: dbtestapp-run.sh
62 - name: nf-config
63 mountPath: /dbtestapp/config
64 {{- if .Values.config.coreDump.enabled }}
65 - name: coredump
66 mountPath: /tmp/coredump
67 {{- end }}
68 volumes:
69 - name: run-script
70 configMap:
71 name: dbtestapp
72 defaultMode: 493
73 - name: nf-config
74 configMap:
75 name: dbtestapp
76 defaultMode: 493
77 {{- if .Values.config.coreDump.enabled }}
78 - name: host-rootfs
79 hostPath:
80 path: /
81 - name: coredump
82 hostPath:
83 path: {{ .Values.config.coreDump.path }}
84 {{- end }}
85{{- end }}