blob: 4f515d1c5afa4f15c8e0959769f3cd7af01dd439 [file] [log] [blame]
Woojoong Kim3f51f0c2019-09-06 11:31:13 -07001{{/*
2Copyright 2019-present Open Networking Foundation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17{{ tuple "video-archive" . | include "cdn-remote.service_account" }}
18---
19apiVersion: apps/v1
20kind: StatefulSet
21metadata:
22 name: video-archive
23 labels:
24{{ tuple "video-archive" . | include "cdn-remote.metadata_labels" | indent 4 }}
25spec:
26 replicas: {{ .Values.config.videoArchive.replicas }}
27 selector:
28 matchLabels:
29{{ tuple "video-archive" . | include "cdn-remote.metadata_labels" | indent 6 }}
30 serviceName: "video-archive"
31 template:
32 metadata:
33 labels:
34{{ tuple "video-archive" . | include "cdn-remote.metadata_labels" | indent 8 }}
35 spec:
36 {{- if .Values.nodeSelectors.enabled }}
37 nodeSelector:
38 {{ .Values.nodeSelectors.videoArchive.label }}: {{ .Values.nodeSelectors.videoArchive.value }}
39 {{- end }}
40 serviceAccountName: video-archive
41 initContainers:
42 - name: video-archive-dep-check
43 image: {{ .Values.images.tags.depCheck | quote }}
44 imagePullPolicy: {{ .Values.images.pullPolicy }}
45 securityContext:
46 allowPrivilegeEscalation: false
47 readOnlyRootFilesystem: false
48 runAsUser: 0
49 env:
50 - name: POD_NAME
51 valueFrom:
52 fieldRef:
53 apiVersion: v1
54 fieldPath: metadata.name
55 - name: NAMESPACE
56 valueFrom:
57 fieldRef:
58 apiVersion: v1
59 fieldPath: metadata.namespace
60 - name: PATH
61 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
62 - name: COMMAND
63 value: "echo done"
64 - name: DEPENDENCY_POD_JSON
65 value: '[{"labels": {"app": "ant-media"}, "requireSameNode": false}]'
66 command:
67 - kubernetes-entrypoint
68 volumeMounts:
69 []
70 containers:
71 - name: streaming-720
72 image: {{ .Values.images.tags.videoArchive | quote }}
73 imagePullPolicy: {{ .Values.images.pullPolicy }}
74 securityContext:
75 allowPrivilegeEscalation: false
76 readOnlyRootFilesystem: false
77 runAsUser: 0
78 stdin: true
79 tty: true
80 command: [ "bash", "-xc"]
81 args:
82 - /opt/start-stream.sh 720
83 {{- if .Values.resources.enabled }}
84 resources:
85{{ toYaml .Values.resources.videoArchive | indent 10 }}
86 {{- end }}
87 volumeMounts:
88 - name: start-script
89 mountPath: /opt/start-stream.sh
90 subPath: start-stream.sh
91 - name: streaming-480
92 image: {{ .Values.images.tags.videoArchive | quote }}
93 imagePullPolicy: {{ .Values.images.pullPolicy }}
94 securityContext:
95 allowPrivilegeEscalation: false
96 readOnlyRootFilesystem: false
97 runAsUser: 0
98 stdin: true
99 tty: true
100 command: [ "bash", "-xc"]
101 args:
102 - /opt/start-stream.sh 480
103 {{- if .Values.resources.enabled }}
104 resources:
105{{ toYaml .Values.resources.videoArchive | indent 10 }}
106 {{- end }}
107 volumeMounts:
108 - name: start-script
109 mountPath: /opt/start-stream.sh
110 subPath: start-stream.sh
111 - name: streaming-360
112 image: {{ .Values.images.tags.videoArchive | quote }}
113 imagePullPolicy: {{ .Values.images.pullPolicy }}
114 securityContext:
115 allowPrivilegeEscalation: false
116 readOnlyRootFilesystem: false
117 runAsUser: 0
118 stdin: true
119 tty: true
120 command: [ "bash", "-xc"]
121 args:
122 - /opt/start-stream.sh 360
123 {{- if .Values.resources.enabled }}
124 resources:
125{{ toYaml .Values.resources.videoArchive | indent 10 }}
126 {{- end }}
127 volumeMounts:
128 - name: start-script
129 mountPath: /opt/start-stream.sh
130 subPath: start-stream.sh
131 volumes:
132 - name: start-script
133 configMap:
134 name: start-stream
135 defaultMode: 493