Woojoong Kim | 9bcff46 | 2019-09-19 12:59:01 -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 | --- |
| 18 | apiVersion: v1 |
| 19 | kind: ConfigMap |
| 20 | metadata: |
| 21 | name: nginx-net-config |
| 22 | labels: |
| 23 | {{ tuple "nginx" . | include "cdn-local.metadata_labels" | indent 4 }} |
| 24 | data: |
| 25 | route-gen.sh: | |
| 26 | {{ tuple "bin/_route-gen.sh.tpl" . | include "cdn-local.template" | indent 4 }} |
| 27 | network-config.sh: | |
| 28 | {{ tuple "bin/_network-config.sh.tpl" . | include "cdn-local.template" | indent 4 }} |
| 29 | run-nginx.sh: | |
| 30 | {{ tuple "bin/_run-nginx.sh.tpl" . | include "cdn-local.template" | indent 4 }} |
| 31 | |
| 32 | --- |
| 33 | apiVersion: v1 |
| 34 | kind: ConfigMap |
| 35 | metadata: |
| 36 | name: nginx-rtmp-config |
| 37 | labels: |
| 38 | {{ tuple "nginx" . | include "cdn-local.metadata_labels" | indent 4 }} |
| 39 | data: |
| 40 | nginx.conf: |+ |
| 41 | worker_processes {{ .Values.config.nginx.events.workerProcesses }}; |
| 42 | |
| 43 | events { |
| 44 | worker_connections {{ .Values.config.nginx.events.workerConnections }}; |
| 45 | } |
| 46 | |
| 47 | http { |
| 48 | include mime.types; |
| 49 | |
| 50 | default_type {{ .Values.config.nginx.http.defaultType }}; |
| 51 | |
| 52 | sendfile {{ .Values.config.nginx.http.sendfile }}; |
| 53 | |
| 54 | keepalive_timeout {{ .Values.config.nginx.http.keepaliveTimeout }}; |
| 55 | |
| 56 | server { |
| 57 | listen {{ .Values.config.nginx.ports.http }}; |
| 58 | |
| 59 | server_name {{ .Values.config.nginx.http.server.serverName }}; |
| 60 | |
| 61 | location / { |
| 62 | root {{ .Values.config.nginx.http.server.location.root }}; |
| 63 | |
| 64 | index {{ .Values.config.nginx.http.server.location.index }}; |
| 65 | } |
| 66 | |
| 67 | error_page {{ .Values.config.nginx.http.server.error.code }} {{ .Values.config.nginx.http.server.error.page }}; |
| 68 | |
| 69 | location = {{ .Values.config.nginx.http.server.error.page }} { |
| 70 | root {{ .Values.config.nginx.http.server.error.root }}; |
| 71 | } |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | rtmp { |
| 76 | server{ |
| 77 | listen {{ .Values.config.nginx.ports.rtmp }}; |
| 78 | |
| 79 | chunk_size {{ .Values.config.nginx.rtmp.chunkSize }}; |
| 80 | |
| 81 | {{ range .Values.config.cdnRemotes }} |
| 82 | {{- $cdnRemote := . -}} |
| 83 | # name: {{ .name }} |
| 84 | application {{ $.Values.config.nginx.rtmp.appRemote.name }}/{{ $cdnRemote.name }} { |
| 85 | live {{ $.Values.config.nginx.rtmp.appRemote.live }}; |
| 86 | |
| 87 | {{- range .streams }} |
| 88 | pull rtmp://{{ $cdnRemote.ip }}:{{ $cdnRemote.port }}/LiveApp/{{ .value }} name={{ .value }}; |
| 89 | {{- end }} |
| 90 | |
| 91 | } |
| 92 | {{ end }} |
| 93 | |
| 94 | application {{ .Values.config.nginx.rtmp.appLocal.name }} { |
| 95 | play {{ .Values.config.nginx.rtmp.appLocal.movieLocation }}; |
| 96 | } |
| 97 | } |
| 98 | } |