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