Woojoong Kim | 79e408c | 2019-02-07 22:23:22 +0900 | [diff] [blame] | 1 | --- |
| 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 | --- |
| 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: '[ |
| 46 | { "name": "sgi-net", "interface": "sgi-net", "namespace": "default" } |
| 47 | ]' |
| 48 | spec: |
| 49 | #hostNetwork: true |
| 50 | nodeSelector: |
| 51 | kubernetes.io/hostname: "node2" |
| 52 | 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: {} |