I am self-hosting on GCP, behind my client's load ...
# self-hosting
b
I am self-hosting on GCP, behind my client's load balancer / firewall (Kong). I need connectivity from within my VPC (voice agent) and external (SDK - iOS/Android clients). I have successfully been able to either connect externally or internally only. Never both at the same time.
We have the following corp load balancers: Primary LB - 443 TCP -> 7880 (WebSocket Signaling | SSL termination at LB, forward as plain WS) - 5349 TCP -> 5349 (TURN/TLS | SSL termination at LB for TURN over TLS) WebRTC Network LB - 7881 TCP -> 7881 (WebRTC TCP Fallback | Used when UDP is blocked) - 3478 UDP -> 3478 (TURN/UDP | Standard TURN UDP port) - 50000-60000 UDP -> 50000-60000 (WebRTC Media | Full range required for RTP/RTCP streams) TURN Network LB - 443 TCP -> 5349 (TURN/TLS | SSL termination at LB for TURN over TLS) I am using a single VM LiveKit deployment (I also have K8s but wanted to get the single VM working first) External only The config:
Copy code
port: 7880
rtc:
  tcp_port: 7881
  port_range_start: 50000
  port_range_end: 60000
  use_external_ip: false
  node_ip: <webrtc_network_lb_external_ip>
keys:
  <key>: <secret>
logging:
  level: debug
turn:
  enabled: true
  external_tls: true
  domain: <turn_network_lb_url>
  tls_port: 5349
  udp_port: 3478
Trying to access
<webrtc_network_lb_external_ip>
from within the VPC doesn't work, packets drops, no hair-pinning. The network load balancer url does resolve to the IP though. Internal only and if I simply change
rtc.node_ip
to
<livekit_server_vm_internal_ip>
that works from the internal VPC voice agent. Trying to access LiveKit (ie.
lk load-test
) from external to
wss://primary-load-balancer-url
connects but then fails to send media packets. It seems like the TURN server advertises the internal IP. I have attempted lots of combinations and looked through the example configs for VM and GKE deployments and nothing has worked yet. Thank you.