2022-05-09:k8s安装lalserver流媒体服务器,yaml如何写?
答案2022-05-09:
yaml如下:
代码语言:yaml复制apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: lal
name: lal
namespace: moonfdd
spec:
replicas: 1
selector:
matchLabels:
app: lal
template:
metadata:
labels:
app: lal
spec:
containers:
- args: ["/lal/bin/lalserver","-c","/lal/conf/lalserver.conf.json"]
image: q191201771/lal
imagePullPolicy: IfNotPresent
name: lal
volumeMounts:
- mountPath: /lal/conf
name: volv
volumes:
- hostPath:
path: /root/k8s/moonfdd/lal/lal/conf
type: DirectoryOrCreate
name: volv
---
apiVersion: v1
kind: Service
metadata:
labels:
app: lal
name: lal
namespace: moonfdd
spec:
ports:
- port: 1935
targetPort: 1935
protocol: TCP
name: a1
- port: 8080
targetPort: 8080
protocol: TCP
name: a2
- port: 4433
targetPort: 4433
protocol: TCP
name: a3
- port: 5544
targetPort: 5544
protocol: TCP
name: a4
- port: 8083
targetPort: 8083
protocol: TCP
name: a5
- port: 8084
targetPort: 8084
protocol: TCP
name: a6
selector:
app: lal
type: NodePort
给流媒体服务器推流:
代码语言:text复制ffmpeg.exe -re -i 1.MP4 -vcodec copy -acodec copy -rtsp_transport tcp -f rtsp rtsp://192.168.204.13:51534/live/test1
结果如下: