Files
zeaslity 437acbeb63 add
2024-10-30 16:30:51 +08:00

395 lines
10 KiB
YAML

# 修改 mysql的密码 mysql的地址
# 修改 minio的地址密码
# 修改 部署环境公网访问地址信息
---
# Source: outside-deploy/charts/srs-cluster/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: helm-srs-cm
namespace: xmyd
labels:
cmii.app: video-live-srs
cmii.type: middleware
helm.sh/chart: srs-cluster-2.1.0
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: "2.0.0"
data:
srs.rtc.conf: |-
listen 30935;
max_connections 4096;
srs_log_tank console;
srs_log_file /home/srs.log;
daemon off;
http_api {
enabled on;
listen 30985;
crossdomain on;
}
stats {
network 0;
}
http_server {
enabled on;
listen 30080;
dir /home/hls;
}
rtc_server {
enabled on;
listen 30090;
candidate $CANDIDATE;
}
vhost __defaultVhost__ {
http_hooks {
enabled on;
on_publish http://helm-srs-op-svc:8080/hooks/on_publish;
}
http_remux {
enabled on;
}
rtc {
enabled on;
rtmp_to_rtc on;
rtc_to_rtmp on;
keep_bframe off;
}
tcp_nodelay on;
min_latency on;
play {
gop_cache off;
mw_latency 0;
mw_msgs 0;
}
publish {
firstpkt_timeout 4000;
normal_timeout 2000;
mr off;
}
dvr {
enabled off;
dvr_path /home/dvr/[app]/[stream]/[2006][01]/[timestamp].mp4;
dvr_plan session;
}
hls {
enabled on;
hls_path /home/hls;
hls_fragment 10;
hls_window 60;
hls_m3u8_file [app]/[stream].m3u8;
hls_ts_file [app]/[stream]/[2006][01][02]/[timestamp]-[duration].ts;
hls_cleanup on;
}
}
srs.op.conf: |-
debug: false
server:
port: 8080
spring:
application:
name: cmii-srs-operator
platform:
info:
name: cmii-live-srs-operator
description: cmii-live-srs-operator
version: 1.2.0
scanPackage: com.cmii.live
datasource:
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://helm-mysql:3306/cmii_live_srs_op?characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
username: k8s_admin
password: fP#UaH6qQ3)8
driver-class-name: com.mysql.cj.jdbc.Driver
boot:
admin:
client:
enabled: false
url: http://127.0.0.1:8888
instance:
service-url: http://127.0.0.1:8080
druid:
mysql:
usePingMethod: false
management:
endpoints:
enabled-by-default: true
web:
exposure:
include: '*'
endpoint:
health:
show-details: always
live:
srs:
rtmp-base: "rtmp://36.134.71.138:30935"
rtsp-base: "rtsp://36.134.71.138:30554"
srt-base: "srt://36.134.71.138:23333"
flv-base: "http://36.134.71.138:30500"
rtc-base: "webrtc://36.134.71.138:30500"
api-base: "http://helm-srs-rtc-svc:30985"
hls:
max-ts: 200
interval-ms: 6000
minio:
endpoint: http://36.137.23.75:9000
access-key: cmii
secret-key: B#923fC7mk
bucket: srs-hls
hook:
on-publish:
- http://cmii-uav-cloud-live:8080/client/live/stream/reportVideoEvent
sync:
onStart: false
pool:
core: 8
max: 12
queue: 0
keepalive: 20
interval:
sync: 150
elect: 8
keepalive: 20
heartbeat: 8
logging:
level:
com.cmii.live.srs.mapper: info
---
# Source: outside-deploy/charts/srs-cluster/templates/service.yaml
---
apiVersion: v1
kind: Service
metadata:
name: srs-rtc
namespace: xmyd
spec:
type: ClusterIP
clusterIP: None
selector:
srs-role: webrtc
ports:
- name: srsrtc-rtmp
port: 30935
targetPort: 30935
- name: srsrtc-hls
port: 30080
targetPort: 30080
---
# Source: outside-deploy/charts/srs-cluster/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: helm-srs-rtc-svc
namespace: xmyd
spec:
type: NodePort
selector:
srs-role: webrtc
ports:
- name: srs-rtmp
port: 30935
targetPort: 30935
nodePort: 30935
- name: srs-api
port: 30985
targetPort: 30985
nodePort: 30985
- name: srs-rtc
port: 30090
targetPort: 30090
nodePort: 30090
protocol: UDP
- name: srs-flv
port: 30080
targetPort: 30080
nodePort: 30080
---
# Source: outside-deploy/charts/srs-cluster/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: helm-srs-op-svc
namespace: xmyd
spec:
type: ClusterIP
selector:
srs-role: op
ports:
- port: 8080
targetPort: 8080
---
# Source: outside-deploy/charts/srs-cluster/templates/operator-deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: helm-srs-op
namespace: xmyd
labels:
srs-role: op
cmii.app: video-live-srs
cmii.type: middleware
helm.sh/chart: srs-cluster-2.1.0
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: "2.0.0"
spec:
replicas: 1
selector:
matchLabels:
srs-role: op
template:
metadata:
labels:
srs-role: op
cmii.app: video-live-srs
cmii.type: middleware
helm.sh/chart: srs-cluster-2.1.0
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: "2.0.0"
spec:
imagePullSecrets:
- name: harborsecret
affinity:
{}
containers:
- name: operator
image: "192.168.0.8:8033/cmii/cmii-srs-operator:v4.0.0"
imagePullPolicy: Always
resources:
limits:
memory: 8Gi
cpu: 4000m
requests:
memory: 256Mi
cpu: 100m
ports:
- name: operator
containerPort: 8080
protocol: TCP
volumeMounts:
- name: srs-conf-file
mountPath: /cmii/application.yaml
subPath: application.yaml
volumes:
- name: srs-conf-file
configMap:
name: "helm-srs-cm"
items:
- key: "srs.op.conf"
path: "application.yaml"
---
# Source: outside-deploy/charts/srs-cluster/templates/webrtc-statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: helm-srs-rtc
namespace: xmyd
labels:
srs-role: webrtc
cmii.app: video-live-srs
cmii.type: middleware
helm.sh/chart: srs-cluster-2.1.0
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: "2.0.0"
spec:
serviceName: srsrtc
replicas: 1
selector:
matchLabels:
srs-role: webrtc
template:
metadata:
labels:
srs-role: webrtc
cmii.app: video-live-srs
cmii.type: middleware
helm.sh/chart: srs-cluster-2.1.0
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/version: "2.0.0"
spec:
imagePullSecrets:
- name: harborsecret
affinity:
containers:
- name: helm-srs
image: "192.168.0.8:8033/cmii/srs:v4.0-r4"
resources:
limits:
memory: 8Gi
cpu: 4
requests:
memory: 256Mi
cpu: 100m
ports:
- name: srs-rtmp
containerPort: 30935
protocol: TCP
- name: srs-api
containerPort: 30985
protocol: TCP
- name: srs-flv
containerPort: 30080
protocol: TCP
- name: srs-webrtc
containerPort: 30090
protocol: UDP
env:
- name: CANDIDATE
value: "36.134.71.138"
volumeMounts:
- name: srs-conf-file
mountPath: /usr/local/srs/conf/docker.conf
subPath: docker.conf
- name: srs-vol
mountPath: /home/dvr
subPath: "default/helm-srs/dvr"
- name: srs-vol
mountPath: /home/hls
subPath: "default/helm-srs/hls"
- name: oss-adaptor
image: "192.168.0.8:8033/cmii/cmii-srs-oss-adaptor:v4.0.0"
imagePullPolicy: Always
resources:
limits:
memory: 8Gi
cpu: 4
requests:
memory: 256Mi
cpu: 100m
env:
- name: OSS_ENDPOINT
value: http://36.137.23.75:9000
- name: OSS_AK
value: cmii
- name: OSS_SK
value: B#923fC7mk
- name: OSS_BUCKET
value: srs-hls
- name: SRS_OP
value: "http://helm-srs-op-svc:8080"
- name: MYSQL_ENDPOINT
value: helm-mysql:3306
- name: MYSQL_USERNAME
value: k8s_admin
- name: MYSQL_PASSWORD
value: fP#UaH6qQ3)8
volumeMounts:
- name: srs-vol
mountPath: /cmii/share/hls
subPath: default/helm-srs/hls
volumes:
- name: srs-conf-file
configMap:
name: "helm-srs-cm"
items:
- key: "srs.rtc.conf"
path: "docker.conf"
- name: srs-vol
emptyDir:
sizeLimit: 10Gi