blob: 13db78a0249b874b27728336bb40a18a18f9fe7b [file] [log] [blame]
Woojoong Kim7b3d4b12019-02-17 23:45:04 +09001---
2# Copyright 2019-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16---
17apiVersion: v1
18kind: Service
19metadata:
20 name: remote-streaming
21spec:
22 selector:
23 app: remote-streaming
24 type: NodePort
25 ports:
26 - name: vlc
27 port: {{ .Values.remote_streaming.ports.vlc }}
28 nodePort: {{ .Values.remote_streaming.ports.vlc_np }}
29 protocol: TCP
30 - name: http
31 port: {{ .Values.remote_streaming.ports.http }}
32 nodePort: {{ .Values.remote_streaming.ports.http_np }}
33 protocol: TCP
34
35---
36apiVersion: apps/v1
37kind: StatefulSet
38metadata:
39 name: remote-streaming
40 labels:
41 name: remote-streaming
42 app: remote-streaming
43spec:
44 replicas: {{ .Values.remote_streaming.replicas }}
45 selector:
46 matchLabels:
47 app: remote-streaming
48 serviceName: "remote-streaming"
49 template:
50 metadata:
51 labels:
52 app: remote-streaming
53 name: remote-streaming
54 spec:
55 #hostNetwork: true
56 terminationGracePeriodSeconds: 1
57 nodeSelector:
Andy Bavier98bfdee2019-02-18 16:01:56 -070058 kubernetes.io/hostname: {{ .Values.cdn_node_selector }}
Woojoong Kim7b3d4b12019-02-17 23:45:04 +090059 containers:
60 - name: streaming
61 image: {{ .Values.remote_streaming.images.remote_streaming_image }}
62 imagePullPolicy: IfNotPresent
63 ports:
64 - containerPort: {{ .Values.remote_streaming.ports.vlc }}
65 - containerPort: {{ .Values.remote_streaming.ports.http }}
66 stdin: true
67 tty: true
68 command: [ "bash", "-xc"]
69 args:
70 - sed -i 's/geteuid/getppid/' /usr/bin/vlc;
71 ffmpeg -re -i /opt/cdn/movies/{{ .Values.remote_streaming.video_quality }}.mp4 -c copy -f flv rtmp://{{ .Values.remote_streaming.nginx_ip }}:31935/app/r
72 resources:
73 limits:
74 cpu: {{ .Values.remote_streaming.resources.cpu }}
75 memory: {{ .Values.remote_streaming.resources.mem }}