Hyunsun Moon | 97e111d | 2022-05-13 17:56:56 -0700 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright 2022-present Open Networking Foundation |
| 3 | |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | */}} |
Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 6 | |
| 7 | apiVersion: apps/v1 |
| 8 | kind: Deployment |
| 9 | metadata: |
| 10 | name: {{ include "person-detection-app.fullname" . }} |
| 11 | labels: |
| 12 | {{- include "person-detection-app.labels" . | nindent 4 }} |
| 13 | spec: |
| 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 Moon | ead8e40 | 2022-05-16 17:45:47 -0700 | [diff] [blame] | 36 | hostNetwork: true |
| 37 | dnsPolicy: ClusterFirstWithHostNet |
Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 38 | 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 Moon | ead8e40 | 2022-05-16 17:45:47 -0700 | [diff] [blame] | 52 | name: {{ .Values.rocSecret }} |
Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 53 | key: username |
| 54 | - name: ROCPASSWORD |
| 55 | valueFrom: |
| 56 | secretKeyRef: |
Hyunsun Moon | ead8e40 | 2022-05-16 17:45:47 -0700 | [diff] [blame] | 57 | name: {{ .Values.rocSecret }} |
Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame] | 58 | 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 }} |