I deploying the agent in a pod with high network r...
# ask-ai
s
I deploying the agent in a pod with high network restrictions, what type of ports and rules the python agent need to get ?
t
Thanks for reaching out, Mostafa. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — regarding the network ports and rules the Python agent needs when deployed in a tightly restricted pod, here’s what you should allow and why. Which part of this are you focused on — connectivity to LiveKit, access to external AI providers (STT/TTS/LLM), or both? If you want the full list now, allow the following outbound rules: • LiveKit signaling (required) ◦ Outbound TCP 443 to your LiveKit domain (e.g.,
*.livekit.cloud
or your self‑hosted domain) — agent uses
wss://
for signaling and job assignment. • TURN/media (conditional) ◦ Outbound UDP 3478 to TURN servers if you rely on TURN/UDP for media relay. ◦ Outbound TCP 443 to TURN/TLS hosts (e.g.,
*.turn.livekit.cloud
) as a TLS fallback when UDP is blocked. ◦ Optional: outbound UDP high ports (e.g., 50000–60000) for direct WebRTC media if you allow RTP over UDP. • External AI services (required if using STT/TTS/LLM) ◦ Outbound TCP 443 to the specific API endpoints you use (e.g.,
api.openai.com
,
api.deepgram.com
, or your model provider). Restrict to the exact domains you need. • DNS/TLS ◦ Outbound DNS resolution (UDP/TCP 53) for LiveKit and AI provider domains. ◦ Outbound HTTPS (TCP 443) to certificate authorities if using Let’s Encrypt. • Optional (internal monitoring) ◦ Inbound TCP 8081 to the pod IP only if you enable a health-check endpoint. Do NOT expose publicly; restrict to your cluster/monitoring network. Quick summary: • No inbound ports required for normal operation (agent initiates outbound connections). • Minimum required: outbound TCP 443 to LiveKit and to any AI provider APIs. • Add UDP 3478 and a range like 50000–60000 only if you need TURN/UDP or direct RTP over UDP. If you share which LiveKit deployment you use (LiveKit Cloud vs self‑hosted), the AI providers you call, and whether UDP is allowed in your cluster, I’ll give an exact allowlist you can paste into your network policy. Sources: Configuring firewalls | LiveKit docs | Deploying to custom environments | LiveKit docs | Deploy to Kubernetes | LiveKit docs | examples/survey | livekit/livekit_composite | DeepWiki
s
I am speaking about the agent only not the other services from livekit, the rest we use from livekit cloud
t
Thanks — since you’re asking about the Python agent only (LiveKit Cloud for other services), allow these outbound rules for the pod: • Outbound TCP 443 to your LiveKit Cloud domain (
*.livekit.cloud
or the specific host) — required for the agent’s signaling connection via
wss://
. • Outbound TCP 443 to the specific AI provider API domains you use (e.g.,
api.openai.com
,
api.deepgram.com
) — required for STT/TTS/LLM calls. • Outbound UDP 3478 to LiveKit TURN servers only if your agent must relay media via TURN/UDP (optional). • Outbound TCP 443 to TURN/TLS hosts (e.g.,
*.turn.livekit.cloud
) as a fallback when UDP is blocked (optional). • Outbound UDP range 50000–60000 only if you need direct WebRTC media over UDP (optional). • Outbound DNS (UDP/TCP 53) to resolve LiveKit and provider domains. • If you enable the agent’s local health endpoint, allow inbound TCP 8081 to the pod IP only from your internal monitoring network (do not expose publicly). No inbound ports are required for normal agent operation otherwise. Would you like a Kubernetes NetworkPolicy manifest with these allow rules for your cluster?