blob: 0158711bdbd47b08ee57d3814033f928b89b85f0 [file] [log] [blame]
{{- /*
# Copyright 2020-present Open Networking Foundation
#
# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
*/ -}}
{{ tuple "phylo" . | include "phylo.service_account" }}
{{ $context := . }}
{{ range .Values.config.phylo.sources }}
{{- $name := printf "%s-%s" "phylo" .key -}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $name }}
labels:
{{ tuple $name $context | include "phylo.metadata_labels" | indent 4 }}
spec:
selector:
matchLabels:
{{ tuple $name $context | include "phylo.metadata_labels" | indent 6 }}
template:
metadata:
labels:
{{ tuple $name $context | include "phylo.metadata_labels" | indent 8 }}
{{- if $context.Values.config.userPlane.enabled }}
annotations:
danm.k8s.io/interfaces: |
[
{"clusterNetwork": "default"},
{"clusterNetwork": {{ $context.Values.config.userPlane.name | quote }}, "ip": "dynamic"}
]
{{- end }}
spec:
{{- if $context.Values.nodeSelectors.enabled }}
nodeSelector:
{{ $context.Values.nodeSelectors.phylo.label }}: {{ $context.Values.nodeSelectors.phylo.value }}
{{- end }}
{{- if $context.Values.images.credentials }}
imagePullSecrets:
- name: {{ $context.Release.Name }}.registry
{{- end }}
serviceAccountName: phylo
initContainers:
- name: phylo-dep-check
image: {{ $context.Values.images.tags.depCheck | quote }}
imagePullPolicy: {{ $context.Values.images.pullPolicy }}
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
runAsUser: 0
env:
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: PATH
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
- name: COMMAND
value: "echo done"
- name: DEPENDENCY_POD_JSON
value: '[{"labels": {"app": "wowza"}, "requireSameNode": false}]'
# add dependency job for make_certs.sh
command:
- kubernetes-entrypoint
volumeMounts:
[]
containers:
- name: rabbitmq
image: {{ $context.Values.images.tags.phyloRabbitmq }}
imagePullPolicy: {{ $context.Values.images.pullPolicy }}
{{- if $context.Values.resources.enabled }}
resources:
{{ toYaml $context.Values.resources.phyloRabbitmq | indent 10 }}
{{- end }}
- name: video-analytics-server
image: {{ $context.Values.images.tags.videoAnalyticsServer | quote }}
imagePullPolicy: {{ $context.Values.images.pullPolicy }}
env:
- name: GLOG_logtostderr
value: "1"
command: ["/bin/bash","-xc","sleep 60 && /bin/run-video-analytics-server.sh"]
resources:
{{- if $context.Values.resources.enabled }}
{{ toYaml $context.Values.resources.videoAnalyticsServer | indent 10 }}
{{- end }}
volumeMounts:
- name: script
mountPath: /bin/run-video-analytics-server.sh
readOnly: true
subPath: run-video-analytics-server.sh
- name: camera-ingestion
image: {{ $context.Values.images.tags.cameraIngestion | quote }}
imagePullPolicy: {{ $context.Values.images.pullPolicy }}
env:
- name: GLOG_logtostderr
value: "1"
- name: SOURCE_URI
value: {{ .uri }}
command: ["/bin/bash","-xc","sleep 90 && /google/run.sh"]
{{- if $context.Values.resources.enabled }}
resources:
{{ toYaml $context.Values.resources.cameraIngestion | indent 10 }}
{{- end }}
- name: phylo-rabbitmq-pubsub
image: {{ $context.Values.images.tags.phyloRabbitmqPubsub }}
imagePullPolicy: {{ $context.Values.images.pullPolicy }}
{{- if $context.Values.resources.enabled }}
resources:
{{ toYaml $context.Values.resources.phyloRabbitmqPubsub | indent 10 }}
{{- end }}
env:
- name: SOURCE_URI
value: {{ .uri }}
- name: RMQ_HOST_NAME
value: "0.0.0.0"
command: ["/bin/bash","-xc","sleep 120 && /google/run.sh"]
- name: phylo-rtsp-server
image: {{ $context.Values.images.tags.rtspServer }}
imagePullPolicy: {{ $context.Values.images.pullPolicy }}
{{- if $context.Values.resources.enabled }}
resources:
{{ toYaml $context.Values.resources.rtspServer | indent 10 }}
{{- end }}
command: ["/bin/bash","-xc","sleep 150 && \
/google/rmq_rtsp_server_main \
--rmq_broker_address=localhost:5672 \
--rmq_exchange_name=phylo.bbox_decoded_video_frame \
--resize_width=640 \
--resize_height=480 \
--rtsp_port=8554 \
--rtsp_url_suffix=/live"]
volumes:
- name: script
configMap:
defaultMode: 0700
name: phylo
{{ end }}