[Agent][Deploy] - srs part
This commit is contained in:
@@ -38,6 +38,15 @@ type CmiiFrontendConfig struct {
|
||||
ClientId string
|
||||
}
|
||||
|
||||
type CmiiSrsConfig struct {
|
||||
z_dep.CommonEnvironmentConfig
|
||||
RtmpPort string
|
||||
WebRTCPort string
|
||||
SrtPort string
|
||||
WebApiPort string
|
||||
MySQLK8sAdminPassword string
|
||||
}
|
||||
|
||||
type IngressConfig struct {
|
||||
z_dep.CommonEnvironmentConfig
|
||||
FrontendShortNameMaps map[string]string
|
||||
@@ -139,6 +148,16 @@ func (ingress *IngressConfig) IngressDeploy(commonEnv *z_dep.CommonEnvironmentCo
|
||||
return true
|
||||
}
|
||||
|
||||
func (srsConfig *CmiiSrsConfig) SRSDeploy(commonEnv *z_dep.CommonEnvironmentConfig) bool {
|
||||
// copy
|
||||
utils.CopySameFields(commonEnv, srsConfig)
|
||||
|
||||
if !z_dep.ParseEnvToApplyFile(srsConfig, CmiiSrsTemplate, z_dep.SRSApplyFilePath) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func IngressDeploy(commonEnv *z_dep.CommonEnvironmentConfig) bool {
|
||||
if !commonEnv.ParseCommonEnvToApplyFile(CmiiFrontendIngressTemplate, z_dep.IngresApplyFilePath) {
|
||||
return false
|
||||
|
||||
@@ -84,7 +84,7 @@ spec:
|
||||
cpu: 200m
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /cmii/ping
|
||||
path: /cmii/health
|
||||
port: pod-port
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 60
|
||||
@@ -94,7 +94,7 @@ spec:
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /cmii/ping
|
||||
path: /cmii/health
|
||||
port: pod-port
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 60
|
||||
@@ -104,7 +104,7 @@ spec:
|
||||
failureThreshold: 3
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /cmii/ping
|
||||
path: /cmii/health
|
||||
port: pod-port
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 60
|
||||
|
||||
@@ -14,7 +14,7 @@ metadata:
|
||||
helm.sh/chart: cmlc-live-srs-rtc-2.0.0
|
||||
data:
|
||||
srs.rtc.conf: |-
|
||||
listen 30935;
|
||||
listen {{ .RtmpPort }};
|
||||
max_connections 4096;
|
||||
srs_log_tank console;
|
||||
srs_log_level info;
|
||||
@@ -43,7 +43,7 @@ data:
|
||||
}
|
||||
rtc_server {
|
||||
enabled on;
|
||||
listen 30090;
|
||||
listen {{ .WebRTCPort }};
|
||||
candidate $CANDIDATE;
|
||||
}
|
||||
vhost __defaultVhost__ {
|
||||
@@ -85,7 +85,11 @@ data:
|
||||
hls_m3u8_file [app]/[stream].m3u8;
|
||||
hls_ts_file [app]/[stream]/[2006][01][02]/[timestamp]-[duration].ts;
|
||||
hls_cleanup on;
|
||||
{{- if .WebPort }}
|
||||
hls_entry_prefix http://{{ .WebIP }}:{{ .WebPort }};
|
||||
{{- else }}
|
||||
hls_entry_prefix http://{{ .WebIP }};
|
||||
{{- end }}
|
||||
}
|
||||
}
|
||||
---
|
||||
@@ -103,27 +107,27 @@ spec:
|
||||
protocol: TCP
|
||||
port: 30935
|
||||
targetPort: 30935
|
||||
nodePort: 30935
|
||||
nodePort: {{ .RtmpPort }}
|
||||
- name: rtc
|
||||
protocol: UDP
|
||||
port: 30090
|
||||
targetPort: 30090
|
||||
nodePort: 30090
|
||||
nodePort: {{ .WebRTCPort }}
|
||||
- name: rtc-tcp
|
||||
protocol: TCP
|
||||
port: 30090
|
||||
targetPort: 30090
|
||||
nodePort: 30090
|
||||
nodePort: {{ .WebRTCPort }}
|
||||
- name: srt
|
||||
protocol: UDP
|
||||
port: 30556
|
||||
targetPort: 30556
|
||||
nodePort: 30556
|
||||
nodePort: {{ .SrtPort }}
|
||||
- name: api
|
||||
protocol: TCP
|
||||
port: 1985
|
||||
targetPort: 1985
|
||||
nodePort: 30557
|
||||
nodePort: {{ .WebApiPort }}
|
||||
selector:
|
||||
srs-role: rtc
|
||||
type: NodePort
|
||||
@@ -194,7 +198,6 @@ spec:
|
||||
srs-role: rtc
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
srs-role: rtc
|
||||
spec:
|
||||
@@ -211,7 +214,11 @@ spec:
|
||||
sizeLimit: 8Gi
|
||||
containers:
|
||||
- name: srs-rtc
|
||||
{{- if .HarborPort }}
|
||||
image: {{ .HarborIP }}:{{ .HarborPort }}/cmii/srs:v5.0.195
|
||||
{{- else }}
|
||||
image: {{ .HarborIP }}srs:v5.0.195
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: srs-rtmp
|
||||
containerPort: 30935
|
||||
@@ -236,8 +243,8 @@ spec:
|
||||
value: {{ .WebIP }}
|
||||
resources:
|
||||
limits:
|
||||
cpu: 1200m
|
||||
memory: 6Gi
|
||||
cpu: 2000m
|
||||
memory: 4Gi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
@@ -255,7 +262,11 @@ spec:
|
||||
terminationMessagePolicy: File
|
||||
imagePullPolicy: Always
|
||||
- name: oss-adaptor
|
||||
{{- if .HarborPort }}
|
||||
image: {{ .HarborIP }}:{{ .HarborPort }}/cmii/cmii-srs-oss-adaptor:2023-SA
|
||||
{{- else }}
|
||||
image: {{ .HarborIP }}cmii-srs-oss-adaptor:2023-SA
|
||||
{{- end }}
|
||||
env:
|
||||
- name: OSS_ENDPOINT
|
||||
value: 'http://{{ .MinioInnerIP }}:9000'
|
||||
@@ -272,7 +283,7 @@ spec:
|
||||
- name: MYSQL_USERNAME
|
||||
value: k8s_admin
|
||||
- name: MYSQL_PASSWORD
|
||||
value: fP#UaH6qQ3)8
|
||||
value: {{ .MySQLK8sAdminPassword }}
|
||||
- name: MYSQL_DATABASE
|
||||
value: cmii_live_srs_op
|
||||
- name: MYSQL_TABLE
|
||||
@@ -283,7 +294,7 @@ spec:
|
||||
value: 'yes'
|
||||
resources:
|
||||
limits:
|
||||
cpu: 1200m
|
||||
cpu: 2000m
|
||||
memory: 4Gi
|
||||
requests:
|
||||
cpu: 100m
|
||||
@@ -332,7 +343,6 @@ spec:
|
||||
live-role: op-v2
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
live-role: op-v2
|
||||
spec:
|
||||
@@ -346,7 +356,11 @@ spec:
|
||||
defaultMode: 420
|
||||
containers:
|
||||
- name: helm-live-op-v2
|
||||
{{- if .HarborPort }}
|
||||
image: {{ .HarborIP }}:{{ .HarborPort }}/cmii/cmii-live-operator:5.2.0
|
||||
{{- else }}
|
||||
image: {{ .HarborIP }}cmii-live-operator:5.2.0
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: operator
|
||||
containerPort: 8080
|
||||
@@ -364,7 +378,7 @@ spec:
|
||||
subPath: bootstrap.yaml
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /cmii/ping
|
||||
path: /cmii/health
|
||||
port: 8080
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 60
|
||||
@@ -374,7 +388,7 @@ spec:
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /cmii/ping
|
||||
path: /cmii/health
|
||||
port: 8080
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 60
|
||||
@@ -485,14 +499,13 @@ data:
|
||||
engine:
|
||||
type: srs
|
||||
endpoint: 'http://helm-live-srs-svc:1985'
|
||||
|
||||
proto:
|
||||
rtmp: 'rtmp://{{ .WebIP }}:30935'
|
||||
rtmp: 'rtmp://{{ .WebIP }}:{{ .RtmpPort }}'
|
||||
rtsp: 'rtsp://{{ .WebIP }}:30554'
|
||||
srt: 'srt://{{ .WebIP }}:30556'
|
||||
srt: 'srt://{{ .WebIP }}:{{ .SrtPort }}'
|
||||
flv: 'http://{{ .WebIP }}:30500'
|
||||
hls: 'http://{{ .WebIP }}:30500'
|
||||
rtc: 'webrtc://{{ .WebIP }}:30557'
|
||||
rtc: 'webrtc://{{ .WebIP }}:{{ .WebRTCPort }}'
|
||||
replay: 'https://{{ .WebIP }}:30333'
|
||||
minio:
|
||||
endpoint: http://{{ .MinioInnerIP }}:9000
|
||||
|
||||
@@ -91,12 +91,12 @@ spec:
|
||||
http:
|
||||
paths:
|
||||
{{- if .TenantEnv }}
|
||||
{{- $tenantEnv := .TenantEnv }}
|
||||
- path: /{{ $tenantEnv }}/?(.*)
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
serviceName: cmii-uav-platform
|
||||
servicePort: 9528
|
||||
{{- $tenantEnv := .TenantEnv }}
|
||||
{{- range $key, $value := .FrontendShortNameMaps }}
|
||||
- path: /{{ $tenantEnv }}/{{ $value }}/?(.*)
|
||||
pathType: ImplementationSpecific
|
||||
|
||||
Reference in New Issue
Block a user