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