[EDGEPOD-160] Add google application for Aether

Change-Id: Idaa77616aa3f83a29372c5754c431d4c4ac1c661
diff --git a/aether-apps/google-phylo/templates/deployment-phylo.yaml b/aether-apps/google-phylo/templates/deployment-phylo.yaml
new file mode 100644
index 0000000..bea130b
--- /dev/null
+++ b/aether-apps/google-phylo/templates/deployment-phylo.yaml
@@ -0,0 +1,143 @@
+{{- /*
+# Copyright 2020-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/ -}}
+
+{{ 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 }}
+    spec:
+    {{- if $context.Values.nodeSelectors.enabled }}
+      nodeSelector:
+        {{ $context.Values.nodeSelectors.phylo.label }}: {{ $context.Values.nodeSelectors.phylo.value }}
+    {{- 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 }}