{{- if and .Values.enabled.enabled .Values.enabled.cluster }} {{- $namespace := .Release.Namespace -}} {{- $applicationName := .Values.deploy.name -}} {{- $domain := ternary (first (regexSplit ":" .Values.global.domain.DeployDomainName -1)) ( .Values.global.domain.DeployDomainName ) (contains ":" .Values.global.domain.DeployDomainName) -}} --- apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ $applicationName }}-og namespace: {{ $namespace }} labels: {{- include "srs.labels.origin" . | nindent 4 }} spec: serviceName: srsog replicas: {{ .Values.apps.srs.replicas.origin }} selector: matchLabels: {{- include "srs.matchLabels.origin" . | nindent 6 }} template: metadata: labels: {{- include "srs.labels.origin" . | nindent 8 }} spec: imagePullSecrets: - name: {{ .Values.deploy.harbor.secret }} {{- /* affinity:*/}} {{- /* {{- include "srs.affinity" . | nindent 8 }}*/}} containers: - name: srs image: {{ .Values.apps.srs.image.srs }} resources: limits: memory: 4Gi cpu: 1200m requests: memory: 256Mi cpu: 100m ports: - containerPort: {{ .Values.apps.srs.ports.rtmp }} name: srs-rtmp protocol: TCP - containerPort: {{ .Values.apps.srs.ports.api }} name: srs-api protocol: TCP {{- if lt .Values.apps.srs.replicas.origin 2.0 }} - containerPort: {{ .Values.apps.srs.ports.rtc }} name: srs-webrtc protocol: UDP {{- end }} env: - name: CANDIDATE value: {{ $domain }} volumeMounts: - name: srs-conf-file mountPath: /usr/local/srs/conf/docker.conf subPath: docker.conf - name: srs-vol mountPath: /home/dvr subPath: {{ $namespace }}/{{ $applicationName }}/dvr - name: srs-vol mountPath: /home/hls subPath: {{ $namespace }}/{{ $applicationName }}/hls - name: oss-adaptor {{/* image: {{ .Values.apps.srs.image.oss }}*/}} image: "{{ .Values.global.image.repository }}/{{ .Values.apps.srs.image.oss }}" imagePullPolicy: Always resources: limits: memory: 4Gi cpu: 1200m requests: memory: 256Mi cpu: 100m env: - name: OSS_ENDPOINT value: {{ .Values.apps.srs.oss.endpoint }} - name: OSS_AK value: {{ .Values.apps.srs.oss.ak }} - name: OSS_SK value: {{ .Values.apps.srs.oss.sk }} - name: OSS_BUCKET value: {{ .Values.apps.srs.oss.bucket }} - name: SRS_OP value: "http://{{ $applicationName }}-op-svc:8080" - name: MYSQL_ENDPOINT value: {{ .Values.apps.mysql.endpoint }} - name: MYSQL_USERNAME value: {{ .Values.apps.mysql.username }} - name: MYSQL_PASSWORD value: {{ .Values.apps.mysql.password }} volumeMounts: - name: srs-vol mountPath: /cmii/share/hls subPath: "{{ $namespace }}/{{ $applicationName }}/hls" volumes: - name: srs-conf-file configMap: name: "{{ $applicationName }}-cm" items: - key: "srs.origin.conf" path: "docker.conf" - name: srs-vol {{- include "srs.vol.main" . | nindent 10 }} --- {{- end }}