apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: media-analyzer-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/proxy-body-size: "100m"
    # WebSocket support
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
spec:
  ingressClassName: nginx
  rules:
  - host: localhost
    http:
      paths:
      # Django API and admin
      - path: /
        pathType: Prefix
        backend:
          service:
            name: django-service
            port:
              number: 8000
      # WebSocket connections
      - path: /ws
        pathType: Prefix
        backend:
          service:
            name: django-service
            port:
              number: 8000
      # Media files (HLS streaming)
      - path: /media
        pathType: Prefix
        backend:
          service:
            name: nginx-service
            port:
              number: 80