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