Jeremy Ronquillo | 11851d3 | 2020-06-08 15:13:08 -0700 | [diff] [blame] | 1 | {{/* |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame^] | 2 | # Copyright 2019-present Open Networking Foundation |
Jeremy Ronquillo | 11851d3 | 2020-06-08 15:13:08 -0700 | [diff] [blame] | 3 | |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame^] | 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only |
Jeremy Ronquillo | 11851d3 | 2020-06-08 15:13:08 -0700 | [diff] [blame] | 6 | */}} |
| 7 | |
| 8 | --- |
| 9 | apiVersion: v1 |
| 10 | kind: ConfigMap |
| 11 | metadata: |
| 12 | name: nginx-net-config |
| 13 | labels: |
| 14 | {{ tuple "nginx" . | include "cdn-local.metadata_labels" | indent 4 }} |
| 15 | data: |
| 16 | run-nginx.sh: | |
| 17 | {{ tuple "bin/_run-nginx.sh.tpl" . | include "cdn-local.template" | indent 4 }} |
| 18 | |
| 19 | --- |
| 20 | apiVersion: v1 |
| 21 | kind: ConfigMap |
| 22 | metadata: |
| 23 | name: nginx-rtmp-config |
| 24 | labels: |
| 25 | {{ tuple "nginx" . | include "cdn-local.metadata_labels" | indent 4 }} |
| 26 | data: |
| 27 | nginx.conf: |+ |
| 28 | worker_processes {{ .Values.config.nginx.events.workerProcesses }}; |
| 29 | |
| 30 | events { |
| 31 | worker_connections {{ .Values.config.nginx.events.workerConnections }}; |
| 32 | } |
| 33 | |
| 34 | http { |
| 35 | include mime.types; |
| 36 | |
| 37 | default_type {{ .Values.config.nginx.http.defaultType }}; |
| 38 | |
| 39 | sendfile {{ .Values.config.nginx.http.sendfile }}; |
| 40 | |
| 41 | keepalive_timeout {{ .Values.config.nginx.http.keepaliveTimeout }}; |
| 42 | |
| 43 | server { |
| 44 | listen {{ .Values.config.nginx.ports.http }}; |
| 45 | |
| 46 | server_name {{ .Values.config.nginx.http.server.serverName }}; |
| 47 | |
| 48 | location / { |
| 49 | root {{ .Values.config.nginx.http.server.location.root }}; |
| 50 | |
| 51 | index {{ .Values.config.nginx.http.server.location.index }}; |
| 52 | } |
| 53 | |
| 54 | error_page {{ .Values.config.nginx.http.server.error.code }} {{ .Values.config.nginx.http.server.error.page }}; |
| 55 | |
| 56 | location = {{ .Values.config.nginx.http.server.error.page }} { |
| 57 | root {{ .Values.config.nginx.http.server.error.root }}; |
| 58 | } |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | rtmp { |
| 63 | server{ |
| 64 | listen {{ .Values.config.nginx.ports.rtmp }}; |
| 65 | |
| 66 | chunk_size {{ .Values.config.nginx.rtmp.chunkSize }}; |
| 67 | |
| 68 | {{ range .Values.config.cdnRemotes }} |
| 69 | {{- $cdnRemote := . -}} |
| 70 | # name: {{ .name }} |
| 71 | application {{ $.Values.config.nginx.rtmp.appRemote.name }}/{{ $cdnRemote.name }} { |
| 72 | live {{ $.Values.config.nginx.rtmp.appRemote.live }}; |
| 73 | |
| 74 | {{- range .streams }} |
| 75 | pull rtmp://{{ $cdnRemote.ip }}:{{ $cdnRemote.port }}/LiveApp/{{ .value }} name={{ .value }}; |
| 76 | {{- end }} |
| 77 | |
| 78 | } |
| 79 | {{ end }} |
| 80 | |
| 81 | application {{ .Values.config.nginx.rtmp.appLocal.name }} { |
| 82 | play {{ .Values.config.nginx.rtmp.appLocal.movieLocation }}; |
| 83 | } |
| 84 | } |
| 85 | } |