blob: 0651ff032a2c54afe0ae6217c8224072ca0f0992 [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{- /*
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07002
Jeremy Ronquillo223db002020-06-05 10:28:22 -07003# Copyright 2020-present Open Networking Foundation
4#
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07005# SPDX-License-Identifier: Apache-2.0
6# SPDX-License-Identifier: LicenseRef-ONF-Member-Only
7
Jeremy Ronquillo223db002020-06-05 10:28:22 -07008*/ -}}
9
10{{ tuple "phylo" . | include "phylo.service_account" }}
11
12{{ $context := . }}
13{{ range .Values.config.phylo.sources }}
14{{- $name := printf "%s-%s" "phylo" .key -}}
15---
16apiVersion: apps/v1
17kind: Deployment
18metadata:
19 name: {{ $name }}
20 labels:
21{{ tuple $name $context | include "phylo.metadata_labels" | indent 4 }}
22spec:
23 selector:
24 matchLabels:
25{{ tuple $name $context | include "phylo.metadata_labels" | indent 6 }}
26 template:
27 metadata:
28 labels:
29{{ tuple $name $context | include "phylo.metadata_labels" | indent 8 }}
30 spec:
31 {{- if $context.Values.nodeSelectors.enabled }}
32 nodeSelector:
33 {{ $context.Values.nodeSelectors.phylo.label }}: {{ $context.Values.nodeSelectors.phylo.value }}
34 {{- end }}
35 serviceAccountName: phylo
36 initContainers:
37 - name: phylo-dep-check
38 image: {{ $context.Values.images.tags.depCheck | quote }}
39 imagePullPolicy: {{ $context.Values.images.pullPolicy }}
40 securityContext:
41 allowPrivilegeEscalation: false
42 readOnlyRootFilesystem: false
43 runAsUser: 0
44 env:
45 - name: POD_NAME
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.name
50 - name: NAMESPACE
51 valueFrom:
52 fieldRef:
53 apiVersion: v1
54 fieldPath: metadata.namespace
55 - name: PATH
56 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
57 - name: COMMAND
58 value: "echo done"
59 - name: DEPENDENCY_POD_JSON
60 value: '[{"labels": {"app": "wowza"}, "requireSameNode": false}]'
61 # add dependency job for make_certs.sh
62 command:
63 - kubernetes-entrypoint
64 volumeMounts:
65 []
66 containers:
67 - name: rabbitmq
68 image: {{ $context.Values.images.tags.phyloRabbitmq }}
69 imagePullPolicy: {{ $context.Values.images.pullPolicy }}
70 {{- if $context.Values.resources.enabled }}
71 resources:
72{{ toYaml $context.Values.resources.phyloRabbitmq | indent 10 }}
73 {{- end }}
74 - name: video-analytics-server
75 image: {{ $context.Values.images.tags.videoAnalyticsServer | quote }}
76 imagePullPolicy: {{ $context.Values.images.pullPolicy }}
77 env:
78 - name: GLOG_logtostderr
79 value: "1"
80 command: ["/bin/bash","-xc","sleep 60 && /bin/run-video-analytics-server.sh"]
81 resources:
82 {{- if $context.Values.resources.enabled }}
83{{ toYaml $context.Values.resources.videoAnalyticsServer | indent 10 }}
84 {{- end }}
85 volumeMounts:
86 - name: script
87 mountPath: /bin/run-video-analytics-server.sh
88 readOnly: true
89 subPath: run-video-analytics-server.sh
90 - name: camera-ingestion
91 image: {{ $context.Values.images.tags.cameraIngestion | quote }}
92 imagePullPolicy: {{ $context.Values.images.pullPolicy }}
93 env:
94 - name: GLOG_logtostderr
95 value: "1"
96 - name: SOURCE_URI
97 value: {{ .uri }}
98 command: ["/bin/bash","-xc","sleep 90 && /google/run.sh"]
99 {{- if $context.Values.resources.enabled }}
100 resources:
101{{ toYaml $context.Values.resources.cameraIngestion | indent 10 }}
102 {{- end }}
103 - name: phylo-rabbitmq-pubsub
104 image: {{ $context.Values.images.tags.phyloRabbitmqPubsub }}
105 imagePullPolicy: {{ $context.Values.images.pullPolicy }}
106 {{- if $context.Values.resources.enabled }}
107 resources:
108{{ toYaml $context.Values.resources.phyloRabbitmqPubsub | indent 10 }}
109 {{- end }}
110 env:
111 - name: SOURCE_URI
112 value: {{ .uri }}
113 - name: RMQ_HOST_NAME
114 value: "0.0.0.0"
115 command: ["/bin/bash","-xc","sleep 120 && /google/run.sh"]
116 - name: phylo-rtsp-server
117 image: {{ $context.Values.images.tags.rtspServer }}
118 imagePullPolicy: {{ $context.Values.images.pullPolicy }}
119 {{- if $context.Values.resources.enabled }}
120 resources:
121{{ toYaml $context.Values.resources.rtspServer | indent 10 }}
122 {{- end }}
123 command: ["/bin/bash","-xc","sleep 150 && \
124 /google/rmq_rtsp_server_main \
125 --rmq_broker_address=localhost:5672 \
126 --rmq_exchange_name=phylo.bbox_decoded_video_frame \
127 --resize_width=640 \
128 --resize_height=480 \
129 --rtsp_port=8554 \
130 --rtsp_url_suffix=/live"]
131 volumes:
132 - name: script
133 configMap:
134 defaultMode: 0700
135 name: phylo
136{{ end }}