blob: 9f54bdedd391a6dcf24090ab0c1ece188eebc190 [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---
Matteo Scandolo5628d4b2021-01-11 11:46:12 -080032apiVersion: apps/v1
Woojoong Kim79e408c2019-02-07 22:23:22 +090033kind: StatefulSet
34metadata:
35 name: nginx-rtmp
36spec:
37 serviceName: nginx-rtmp
38 replicas: 1
Matteo Scandolo5628d4b2021-01-11 11:46:12 -080039 selector:
40 matchLabels:
41 name: nginx-rtmp
42 release: {{ .Release.Name }}
Woojoong Kim79e408c2019-02-07 22:23:22 +090043 template:
44 metadata:
45 labels:
46 name: nginx-rtmp
47 app: nginx-rtmp
48 annotations:
49 k8s.v1.cni.cncf.io/networks: '[
50 { "name": "sgi-net", "interface": "sgi-net", "namespace": "default" }
51 ]'
52 spec:
53 #hostNetwork: true
54 nodeSelector:
Andy Bavier4ffc1a02019-02-17 16:51:54 -070055 kubernetes.io/hostname: {{ .Values.cdn_node_selector }}
Woojoong Kim79e408c2019-02-07 22:23:22 +090056 terminationGracePeriodSeconds: 0
57 imagePullSecrets:
58 - name: nexus-docker-secret
59 initContainers:
60 - name: "nginx-rtmp-init"
61 image: {{ .Values.nginx.images.nginx_image }}
62 imagePullPolicy: "IfNotPresent"
63 args:
64 - cp /config/*.sh /shared-vol;cp /conf/* /shared-vol
65 command:
66 - "/bin/bash"
67 - "-c"
68 volumeMounts:
69 - name: "shared-volume"
70 mountPath: "/shared-vol"
71 - name: "nginx-rtmp-config"
72 mountPath: "/config"
73 - name: "nginx-rtmp-conf"
74 mountPath: "/conf"
75 containers:
76 - name: nginx-rtmp
77 image: {{ .Values.nginx.images.nginx_image }}
78 imagePullPolicy: IfNotPresent
79 args:
80 - chmod a+x /config/*.sh;/config/nginx_rtmp_config.sh
81 command:
82 - "/bin/bash"
83 - "-c"
84 tty: true
85 securityContext:
86 privileged: true
87 ports:
88 - containerPort: {{ .Values.nginx.ports.rtmp_orig }}
89 volumeMounts:
90 - name: shared-volume
91 mountPath: /config
92 - name: shared-volume
93 mountPath: /conf
94 resources:
95 limits:
96 intel.com/sriov: '2'
97 volumes:
98 - name: nginx-rtmp-config
99 configMap:
100 name: nginx-rtmp-config
101 items:
102 - key: nginx_rtmp_config.sh
103 path: nginx_rtmp_config.sh
104 - name: nginx-rtmp-conf
105 configMap:
106 name: nginx-rtmp-conf
107 items:
108 - key: nginx.conf
109 path: nginx.conf
110 - name: shared-volume
Matteo Scandolo5628d4b2021-01-11 11:46:12 -0800111 emptyDir: {}