Back to All Guides
codeAugust 7, 20269 min readRTSPLink Dev Team

Scalable Kubernetes (K8s) MediaMTX & RTSP Gateway Deployment

Architect auto-scaling RTSP stream proxy clusters in Kubernetes with NodePort and StatefulSets.

#Kubernetes#K8s#MediaMTX#DevOps#Cloud Architecture
Live Stream Workbench

Need a live RTSP stream link right now to test this setup in VLC or OpenCV?

Test Live Stream

#1Kubernetes MediaMTX Deployment YAML

Deploy MediaMTX with TCP and UDP port mapping in K8s:

k8s-mediamtx-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mediamtx-gateway
spec:
  replicas: 3
  selector:
    matchLabels:
      app: mediamtx
  template:
    metadata:
      labels:
        app: mediamtx
    spec:
      containers:
      - name: mediamtx
        image: bluenviron/mediamtx:latest
        ports:
        - containerPort: 8554
          name: rtsp
        - containerPort: 8889
          name: webrtc

Ready to test your live RTSP video stream?

Generate free authenticated RTSP links with unlimited bandwidth and inspect frame timestamps in seconds.

Generate Free RTSP Link

Related Tutorials & Setup Guides

View all 100+ guides