Shad Ansari | 0a4637a | 2022-05-11 12:20:59 -0700 | [diff] [blame^] | 1 | # Copyright 2020-present Open Networking Foundation |
| 2 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 3 | |
| 4 | apiVersion: apps/v1 |
| 5 | kind: Deployment |
| 6 | metadata: |
| 7 | name: {{ include "person-detection-app.fullname" . }} |
| 8 | labels: |
| 9 | {{- include "person-detection-app.labels" . | nindent 4 }} |
| 10 | spec: |
| 11 | {{- if not .Values.autoscaling.enabled }} |
| 12 | replicas: {{ .Values.replicaCount }} |
| 13 | {{- end }} |
| 14 | selector: |
| 15 | matchLabels: |
| 16 | {{- include "person-detection-app.selectorLabels" . | nindent 6 }} |
| 17 | template: |
| 18 | metadata: |
| 19 | {{- with .Values.podAnnotations }} |
| 20 | annotations: |
| 21 | {{- toYaml . | nindent 8 }} |
| 22 | {{- end }} |
| 23 | labels: |
| 24 | {{- include "person-detection-app.selectorLabels" . | nindent 8 }} |
| 25 | spec: |
| 26 | {{- with .Values.imagePullSecrets }} |
| 27 | imagePullSecrets: |
| 28 | {{- toYaml . | nindent 8 }} |
| 29 | {{- end }} |
| 30 | serviceAccountName: {{ include "person-detection-app.serviceAccountName" . }} |
| 31 | securityContext: |
| 32 | {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 33 | containers: |
| 34 | - name: {{ .Chart.Name }} |
| 35 | securityContext: |
| 36 | {{- toYaml .Values.securityContext | nindent 12 }} |
| 37 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 38 | imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 39 | ports: |
| 40 | - name: http |
| 41 | containerPort: 5000 |
| 42 | protocol: TCP |
| 43 | env: |
| 44 | - name: ROCUSER |
| 45 | valueFrom: |
| 46 | secretKeyRef: |
| 47 | name: rocsecret |
| 48 | key: username |
| 49 | - name: ROCPASSWORD |
| 50 | valueFrom: |
| 51 | secretKeyRef: |
| 52 | name: rocsecret |
| 53 | key: password |
| 54 | - name: ROCURL |
| 55 | value: {{ .Values.rocUrl }} |
| 56 | - name: KEYCLOAKURL |
| 57 | value: {{ .Values.keycloakUrl }} |
| 58 | - name: ENTERPRISE |
| 59 | value: {{ .Values.enterprise }} |
| 60 | - name: SITE |
| 61 | value: {{ .Values.site }} |
| 62 | - name: DEVICEGROUP |
| 63 | value: {{ .Values.deviceGroup }} |
| 64 | - name: NUMDEVICES |
| 65 | value: "{{ .Values.numDevices }}" |
| 66 | - name: MQTTIP |
| 67 | value: "{{ .Values.mqttIp }}" |
| 68 | livenessProbe: |
| 69 | httpGet: |
| 70 | path: / |
| 71 | port: http |
| 72 | readinessProbe: |
| 73 | httpGet: |
| 74 | path: / |
| 75 | port: http |
| 76 | resources: |
| 77 | {{- toYaml .Values.resources | nindent 12 }} |
| 78 | {{- with .Values.nodeSelector }} |
| 79 | nodeSelector: |
| 80 | {{- toYaml . | nindent 8 }} |
| 81 | {{- end }} |
| 82 | {{- with .Values.affinity }} |
| 83 | affinity: |
| 84 | {{- toYaml . | nindent 8 }} |
| 85 | {{- end }} |
| 86 | {{- with .Values.tolerations }} |
| 87 | tolerations: |
| 88 | {{- toYaml . | nindent 8 }} |
| 89 | {{- end }} |