Woojoong Kim | 2ccf324 | 2019-06-06 14:12:44 -0700 | [diff] [blame] | 1 | --- |
| 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 | --- |
| 17 | apiVersion: v1 |
| 18 | kind: Service |
| 19 | metadata: |
| 20 | name: nginx-rtmp |
| 21 | spec: |
| 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 | --- |
| 32 | apiVersion: apps/v1beta1 |
| 33 | kind: StatefulSet |
| 34 | metadata: |
| 35 | name: nginx-rtmp |
| 36 | spec: |
| 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 Moon | 1118903 | 2019-08-29 02:02:33 +0000 | [diff] [blame] | 46 | { "name": "sgi-net-nd", "interface": "sgi-net-nd", "ips": {{ .Values.networks.sgi_net_nd.ip | quote }} } |
Woojoong Kim | 2ccf324 | 2019-06-06 14:12:44 -0700 | [diff] [blame] | 47 | ]' |
| 48 | spec: |
| 49 | #hostNetwork: true |
Woojoong Kim | 2ccf324 | 2019-06-06 14:12:44 -0700 | [diff] [blame] | 50 | 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 Kim | e455aab | 2019-07-12 10:53:43 -0700 | [diff] [blame] | 90 | intel.com/sriov_netdevice: '2' |
Woojoong Kim | 2ccf324 | 2019-06-06 14:12:44 -0700 | [diff] [blame] | 91 | volumes: |
| 92 | - name: nginx-rtmp-config |
| 93 | configMap: |
| 94 | name: nginx-rtmp-config |
| 95 | items: |
| 96 | - key: nginx_rtmp_config.sh |
| 97 | path: nginx_rtmp_config.sh |
| 98 | - name: nginx-rtmp-conf |
| 99 | configMap: |
| 100 | name: nginx-rtmp-conf |
| 101 | items: |
| 102 | - key: nginx.conf |
| 103 | path: nginx.conf |
| 104 | - name: shared-volume |
Hyunsun Moon | 1118903 | 2019-08-29 02:02:33 +0000 | [diff] [blame] | 105 | emptyDir: {} |