blob: 8b97592fa4d324583e38b0695ffaabc6a512d065 [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: '[
Woojoong Kime455aab2019-07-12 10:53:43 -070046 { "name": "sgi-net-nd", "interface": "sgi-net-nd" }
Woojoong Kim2ccf3242019-06-06 14:12:44 -070047 ]'
48 spec:
49 #hostNetwork: true
50 nodeSelector:
Woojoong Kim314d57c2019-07-09 17:08:11 -070051{{ toYaml .Values.nginx.nodeselector | indent 8 }}
Woojoong Kim2ccf3242019-06-06 14:12:44 -070052 terminationGracePeriodSeconds: 0
53 imagePullSecrets:
54 - name: nexus-docker-secret
55 initContainers:
56 - name: "nginx-rtmp-init"
57 image: {{ .Values.nginx.images.nginx_image }}
58 imagePullPolicy: "IfNotPresent"
59 args:
60 - cp /config/*.sh /shared-vol;cp /conf/* /shared-vol
61 command:
62 - "/bin/bash"
63 - "-c"
64 volumeMounts:
65 - name: "shared-volume"
66 mountPath: "/shared-vol"
67 - name: "nginx-rtmp-config"
68 mountPath: "/config"
69 - name: "nginx-rtmp-conf"
70 mountPath: "/conf"
71 containers:
72 - name: nginx-rtmp
73 image: {{ .Values.nginx.images.nginx_image }}
74 imagePullPolicy: IfNotPresent
75 args:
76 - chmod a+x /config/*.sh;/config/nginx_rtmp_config.sh
77 command:
78 - "/bin/bash"
79 - "-c"
80 tty: true
81 securityContext:
82 privileged: true
83 ports:
84 - containerPort: {{ .Values.nginx.ports.rtmp_orig }}
85 volumeMounts:
86 - name: shared-volume
87 mountPath: /config
88 - name: shared-volume
89 mountPath: /conf
90 resources:
91 limits:
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
107 emptyDir: {}