blob: 82de8b0970523be81a41890294a77556fe812a81 [file] [log] [blame]
Woojoong Kim79e408c2019-02-07 22:23:22 +09001---
2# Copyright 2018-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: '[
46 { "name": "sgi-net", "interface": "sgi-net", "namespace": "default" }
47 ]'
48 spec:
49 #hostNetwork: true
50 nodeSelector:
Andy Bavier4ffc1a02019-02-17 16:51:54 -070051 kubernetes.io/hostname: {{ .Values.cdn_node_selector }}
Woojoong Kim79e408c2019-02-07 22:23:22 +090052 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:
92 intel.com/sriov: '2'
93 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: {}