blob: 71a7f8ddd35e9af50132edcba7a639285c4a753b [file] [log] [blame]
Hyunsun Moon97e111d2022-05-13 17:56:56 -07001{{/*
2# Copyright 2022-present Open Networking Foundation
3
4# SPDX-License-Identifier: Apache-2.0
5*/}}
Shad Ansari0a4637a2022-05-11 12:20:59 -07006
7apiVersion: apps/v1
8kind: Deployment
9metadata:
10 name: {{ include "person-detection-app.fullname" . }}
11 labels:
12 {{- include "person-detection-app.labels" . | nindent 4 }}
13spec:
14 {{- if not .Values.autoscaling.enabled }}
15 replicas: {{ .Values.replicaCount }}
16 {{- end }}
17 selector:
18 matchLabels:
19 {{- include "person-detection-app.selectorLabels" . | nindent 6 }}
20 template:
21 metadata:
22 {{- with .Values.podAnnotations }}
23 annotations:
24 {{- toYaml . | nindent 8 }}
25 {{- end }}
26 labels:
27 {{- include "person-detection-app.selectorLabels" . | nindent 8 }}
28 spec:
29 {{- with .Values.imagePullSecrets }}
30 imagePullSecrets:
31 {{- toYaml . | nindent 8 }}
32 {{- end }}
33 serviceAccountName: {{ include "person-detection-app.serviceAccountName" . }}
34 securityContext:
35 {{- toYaml .Values.podSecurityContext | nindent 8 }}
Hyunsun Moonead8e402022-05-16 17:45:47 -070036 hostNetwork: true
37 dnsPolicy: ClusterFirstWithHostNet
Shad Ansari0a4637a2022-05-11 12:20:59 -070038 containers:
39 - name: {{ .Chart.Name }}
40 securityContext:
41 {{- toYaml .Values.securityContext | nindent 12 }}
42 image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
43 imagePullPolicy: {{ .Values.image.pullPolicy }}
44 ports:
45 - name: http
46 containerPort: 5000
47 protocol: TCP
48 env:
49 - name: ROCUSER
50 valueFrom:
51 secretKeyRef:
Hyunsun Moonead8e402022-05-16 17:45:47 -070052 name: {{ .Values.rocSecret }}
Shad Ansari0a4637a2022-05-11 12:20:59 -070053 key: username
54 - name: ROCPASSWORD
55 valueFrom:
56 secretKeyRef:
Hyunsun Moonead8e402022-05-16 17:45:47 -070057 name: {{ .Values.rocSecret }}
Shad Ansari0a4637a2022-05-11 12:20:59 -070058 key: password
59 - name: ROCURL
60 value: {{ .Values.rocUrl }}
61 - name: KEYCLOAKURL
62 value: {{ .Values.keycloakUrl }}
63 - name: ENTERPRISE
64 value: {{ .Values.enterprise }}
65 - name: SITE
66 value: {{ .Values.site }}
67 - name: DEVICEGROUP
68 value: {{ .Values.deviceGroup }}
69 - name: NUMDEVICES
70 value: "{{ .Values.numDevices }}"
71 - name: MQTTIP
72 value: "{{ .Values.mqttIp }}"
73 livenessProbe:
74 httpGet:
75 path: /
76 port: http
77 readinessProbe:
78 httpGet:
79 path: /
80 port: http
81 resources:
82 {{- toYaml .Values.resources | nindent 12 }}
83 {{- with .Values.nodeSelector }}
84 nodeSelector:
85 {{- toYaml . | nindent 8 }}
86 {{- end }}
87 {{- with .Values.affinity }}
88 affinity:
89 {{- toYaml . | nindent 8 }}
90 {{- end }}
91 {{- with .Values.tolerations }}
92 tolerations:
93 {{- toYaml . | nindent 8 }}
94 {{- end }}