blob: 5d8182549880741aca9eb2e149b6007d92fbe004 [file] [log] [blame]
Woojoong Kim2ccf3242019-06-06 14:12:44 -07001---
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: nginx-rtmp
21spec:
22 selector:
23 app: nginx-rtmp
24 type: NodePort
25 ports:
26 - name: vlc
27 port: {{ .Values.nginx.ports.rtmp_orig }}
28 nodePort: {{ .Values.nginx.ports.rtmp_np }}
29 protocol: TCP
30
31---
32apiVersion: apps/v1beta1
33kind: StatefulSet
34metadata:
35 name: nginx-rtmp
36spec:
37 serviceName: nginx-rtmp
38 replicas: 1
39 template:
40 metadata:
41 labels:
42 name: nginx-rtmp
43 app: nginx-rtmp
44 annotations:
45 k8s.v1.cni.cncf.io/networks: '[
Hyunsun Moon11189032019-08-29 02:02:33 +000046 { "name": "sgi-net-nd", "interface": "sgi-net-nd", "ips": {{ .Values.networks.sgi_net_nd.ip | quote }} }
Woojoong Kim2ccf3242019-06-06 14:12:44 -070047 ]'
48 spec:
49 #hostNetwork: true
Woojoong Kim2ccf3242019-06-06 14:12:44 -070050 terminationGracePeriodSeconds: 0
51 imagePullSecrets:
52 - name: nexus-docker-secret
53 initContainers:
54 - name: "nginx-rtmp-init"
55 image: {{ .Values.nginx.images.nginx_image }}
56 imagePullPolicy: "IfNotPresent"
57 args:
58 - cp /config/*.sh /shared-vol;cp /conf/* /shared-vol
59 command:
60 - "/bin/bash"
61 - "-c"
62 volumeMounts:
63 - name: "shared-volume"
64 mountPath: "/shared-vol"
65 - name: "nginx-rtmp-config"
66 mountPath: "/config"
67 - name: "nginx-rtmp-conf"
68 mountPath: "/conf"
69 containers:
70 - name: nginx-rtmp
71 image: {{ .Values.nginx.images.nginx_image }}
72 imagePullPolicy: IfNotPresent
73 args:
74 - chmod a+x /config/*.sh;/config/nginx_rtmp_config.sh
75 command:
76 - "/bin/bash"
77 - "-c"
78 tty: true
79 securityContext:
80 privileged: true
81 ports:
82 - containerPort: {{ .Values.nginx.ports.rtmp_orig }}
83 volumeMounts:
84 - name: shared-volume
85 mountPath: /config
86 - name: shared-volume
87 mountPath: /conf
88 resources:
89 limits:
Woojoong Kimc8e65f22019-09-05 14:10:50 -070090 cpu: {{ .Values.nginx.resources.cpu }}
91 memory: {{ .Values.nginx.resources.mem }}
Woojoong Kime455aab2019-07-12 10:53:43 -070092 intel.com/sriov_netdevice: '2'
Woojoong Kim2ccf3242019-06-06 14:12:44 -070093 volumes:
94 - name: nginx-rtmp-config
95 configMap:
96 name: nginx-rtmp-config
97 items:
98 - key: nginx_rtmp_config.sh
99 path: nginx_rtmp_config.sh
100 - name: nginx-rtmp-conf
101 configMap:
102 name: nginx-rtmp-conf
103 items:
104 - key: nginx.conf
105 path: nginx.conf
106 - name: shared-volume
Hyunsun Moon11189032019-08-29 02:02:33 +0000107 emptyDir: {}