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