blob: 2f5460a3a3ffe60f587ce7c8b74844ba65d0e490 [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:
Woojoong Kim574c42a2020-01-26 22:03:46 -080071{{- if .Values.config.videoArchive.q720p.enabled }}
Woojoong Kim3f51f0c2019-09-06 11:31:13 -070072 - name: streaming-720
73 image: {{ .Values.images.tags.videoArchive | quote }}
74 imagePullPolicy: {{ .Values.images.pullPolicy }}
75 securityContext:
76 allowPrivilegeEscalation: false
77 readOnlyRootFilesystem: false
78 runAsUser: 0
79 stdin: true
80 tty: true
81 command: [ "bash", "-xc"]
82 args:
83 - /opt/start-stream.sh 720
84 {{- if .Values.resources.enabled }}
85 resources:
86{{ toYaml .Values.resources.videoArchive | indent 10 }}
87 {{- end }}
88 volumeMounts:
89 - name: start-script
90 mountPath: /opt/start-stream.sh
91 subPath: start-stream.sh
Woojoong Kim574c42a2020-01-26 22:03:46 -080092{{- end }}
93{{- if .Values.config.videoArchive.q480p.enabled }}
Woojoong Kim3f51f0c2019-09-06 11:31:13 -070094 - name: streaming-480
95 image: {{ .Values.images.tags.videoArchive | quote }}
96 imagePullPolicy: {{ .Values.images.pullPolicy }}
97 securityContext:
98 allowPrivilegeEscalation: false
99 readOnlyRootFilesystem: false
100 runAsUser: 0
101 stdin: true
102 tty: true
103 command: [ "bash", "-xc"]
104 args:
105 - /opt/start-stream.sh 480
106 {{- if .Values.resources.enabled }}
107 resources:
108{{ toYaml .Values.resources.videoArchive | indent 10 }}
109 {{- end }}
110 volumeMounts:
111 - name: start-script
112 mountPath: /opt/start-stream.sh
113 subPath: start-stream.sh
Woojoong Kim574c42a2020-01-26 22:03:46 -0800114{{- end }}
115{{- if .Values.config.videoArchive.q360p.enabled }}
Woojoong Kim3f51f0c2019-09-06 11:31:13 -0700116 - name: streaming-360
117 image: {{ .Values.images.tags.videoArchive | quote }}
118 imagePullPolicy: {{ .Values.images.pullPolicy }}
119 securityContext:
120 allowPrivilegeEscalation: false
121 readOnlyRootFilesystem: false
122 runAsUser: 0
123 stdin: true
124 tty: true
125 command: [ "bash", "-xc"]
126 args:
127 - /opt/start-stream.sh 360
128 {{- if .Values.resources.enabled }}
129 resources:
130{{ toYaml .Values.resources.videoArchive | indent 10 }}
131 {{- end }}
132 volumeMounts:
133 - name: start-script
134 mountPath: /opt/start-stream.sh
135 subPath: start-stream.sh
Woojoong Kim574c42a2020-01-26 22:03:46 -0800136{{- end }}
Woojoong Kim3f51f0c2019-09-06 11:31:13 -0700137 volumes:
138 - name: start-script
139 configMap:
140 name: start-stream
141 defaultMode: 493