blob: 09058d24e55f1dc57b9866dd73764640217e8c68 [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 }}
36 containers:
37 - name: {{ .Chart.Name }}
38 securityContext:
39 {{- toYaml .Values.securityContext | nindent 12 }}
40 image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
41 imagePullPolicy: {{ .Values.image.pullPolicy }}
42 ports:
43 - name: http
44 containerPort: 5000
45 protocol: TCP
46 env:
47 - name: ROCUSER
48 valueFrom:
49 secretKeyRef:
50 name: rocsecret
51 key: username
52 - name: ROCPASSWORD
53 valueFrom:
54 secretKeyRef:
55 name: rocsecret
56 key: password
57 - name: ROCURL
58 value: {{ .Values.rocUrl }}
59 - name: KEYCLOAKURL
60 value: {{ .Values.keycloakUrl }}
61 - name: ENTERPRISE
62 value: {{ .Values.enterprise }}
63 - name: SITE
64 value: {{ .Values.site }}
65 - name: DEVICEGROUP
66 value: {{ .Values.deviceGroup }}
67 - name: NUMDEVICES
68 value: "{{ .Values.numDevices }}"
69 - name: MQTTIP
70 value: "{{ .Values.mqttIp }}"
71 livenessProbe:
72 httpGet:
73 path: /
74 port: http
75 readinessProbe:
76 httpGet:
77 path: /
78 port: http
79 resources:
80 {{- toYaml .Values.resources | nindent 12 }}
81 {{- with .Values.nodeSelector }}
82 nodeSelector:
83 {{- toYaml . | nindent 8 }}
84 {{- end }}
85 {{- with .Values.affinity }}
86 affinity:
87 {{- toYaml . | nindent 8 }}
88 {{- end }}
89 {{- with .Values.tolerations }}
90 tolerations:
91 {{- toYaml . | nindent 8 }}
92 {{- end }}