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 | {{ tuple "video-archive" . | include "cdn-remote.service_account" }} |
| 9 | --- |
| 10 | apiVersion: apps/v1 |
| 11 | kind: StatefulSet |
| 12 | metadata: |
| 13 | name: video-archive |
| 14 | labels: |
| 15 | {{ tuple "video-archive" . | include "cdn-remote.metadata_labels" | indent 4 }} |
| 16 | spec: |
| 17 | replicas: {{ .Values.config.videoArchive.replicas }} |
| 18 | selector: |
| 19 | matchLabels: |
| 20 | {{ tuple "video-archive" . | include "cdn-remote.metadata_labels" | indent 6 }} |
| 21 | serviceName: "video-archive" |
| 22 | template: |
| 23 | metadata: |
| 24 | labels: |
| 25 | {{ tuple "video-archive" . | include "cdn-remote.metadata_labels" | indent 8 }} |
| 26 | spec: |
| 27 | {{- if .Values.nodeSelectors.enabled }} |
| 28 | nodeSelector: |
| 29 | {{ .Values.nodeSelectors.videoArchive.label }}: {{ .Values.nodeSelectors.videoArchive.value }} |
| 30 | {{- end }} |
| 31 | serviceAccountName: video-archive |
| 32 | initContainers: |
| 33 | - name: video-archive-dep-check |
| 34 | image: {{ .Values.images.tags.depCheck | quote }} |
| 35 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 36 | securityContext: |
| 37 | allowPrivilegeEscalation: false |
| 38 | readOnlyRootFilesystem: false |
| 39 | runAsUser: 0 |
| 40 | env: |
| 41 | - name: POD_NAME |
| 42 | valueFrom: |
| 43 | fieldRef: |
| 44 | apiVersion: v1 |
| 45 | fieldPath: metadata.name |
| 46 | - name: NAMESPACE |
| 47 | valueFrom: |
| 48 | fieldRef: |
| 49 | apiVersion: v1 |
| 50 | fieldPath: metadata.namespace |
| 51 | - name: PATH |
| 52 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 53 | - name: COMMAND |
| 54 | value: "echo done" |
| 55 | - name: DEPENDENCY_POD_JSON |
| 56 | value: '[{"labels": {"app": "ant-media"}, "requireSameNode": false}]' |
| 57 | command: |
| 58 | - kubernetes-entrypoint |
| 59 | volumeMounts: |
| 60 | [] |
| 61 | containers: |
| 62 | {{- if .Values.config.videoArchive.q720p.enabled }} |
| 63 | - name: streaming-720 |
| 64 | image: {{ .Values.images.tags.videoArchive | quote }} |
| 65 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 66 | securityContext: |
| 67 | allowPrivilegeEscalation: false |
| 68 | readOnlyRootFilesystem: false |
| 69 | runAsUser: 0 |
| 70 | stdin: true |
| 71 | tty: true |
| 72 | command: [ "bash", "-xc"] |
| 73 | args: |
| 74 | - /opt/start-stream.sh 720 |
| 75 | {{- if .Values.resources.enabled }} |
| 76 | resources: |
| 77 | {{ toYaml .Values.resources.videoArchive | indent 10 }} |
| 78 | {{- end }} |
| 79 | volumeMounts: |
| 80 | - name: start-script |
| 81 | mountPath: /opt/start-stream.sh |
| 82 | subPath: start-stream.sh |
| 83 | {{- end }} |
| 84 | {{- if .Values.config.videoArchive.q480p.enabled }} |
| 85 | - name: streaming-480 |
| 86 | image: {{ .Values.images.tags.videoArchive | quote }} |
| 87 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 88 | securityContext: |
| 89 | allowPrivilegeEscalation: false |
| 90 | readOnlyRootFilesystem: false |
| 91 | runAsUser: 0 |
| 92 | stdin: true |
| 93 | tty: true |
| 94 | command: [ "bash", "-xc"] |
| 95 | args: |
| 96 | - /opt/start-stream.sh 480 |
| 97 | {{- if .Values.resources.enabled }} |
| 98 | resources: |
| 99 | {{ toYaml .Values.resources.videoArchive | indent 10 }} |
| 100 | {{- end }} |
| 101 | volumeMounts: |
| 102 | - name: start-script |
| 103 | mountPath: /opt/start-stream.sh |
| 104 | subPath: start-stream.sh |
| 105 | {{- end }} |
| 106 | {{- if .Values.config.videoArchive.q360p.enabled }} |
| 107 | - name: streaming-360 |
| 108 | image: {{ .Values.images.tags.videoArchive | quote }} |
| 109 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 110 | securityContext: |
| 111 | allowPrivilegeEscalation: false |
| 112 | readOnlyRootFilesystem: false |
| 113 | runAsUser: 0 |
| 114 | stdin: true |
| 115 | tty: true |
| 116 | command: [ "bash", "-xc"] |
| 117 | args: |
| 118 | - /opt/start-stream.sh 360 |
| 119 | {{- if .Values.resources.enabled }} |
| 120 | resources: |
| 121 | {{ toYaml .Values.resources.videoArchive | indent 10 }} |
| 122 | {{- end }} |
| 123 | volumeMounts: |
| 124 | - name: start-script |
| 125 | mountPath: /opt/start-stream.sh |
| 126 | subPath: start-stream.sh |
| 127 | {{- end }} |
| 128 | volumes: |
| 129 | - name: start-script |
| 130 | configMap: |
| 131 | name: start-stream |
| 132 | defaultMode: 493 |