I am trying to self-host livekit on AWS EKS. This ...
# ask-ai
m
I am trying to self-host livekit on AWS EKS. This is the values.yaml for the Helm chart.
Copy code
# =============================================================================
# LiveKit Server Helm Values for Porter (AWS EKS)
# =============================================================================
# After installing this chart, you still need to:
# * Open ports on the firewall (see https://docs.livekit.io/deploy/ports-firewall)
# * Update DNS of hostnames to the ingress/service that were created

replicaCount: 1

# Graceful termination: 5 hours (allows existing sessions to complete)
terminationGracePeriodSeconds: 18000

# =============================================================================
# Host Networking (REQUIRED for WebRTC)
# =============================================================================
# LiveKit requires host networking to properly handle WebRTC UDP traffic
# This binds the pod directly to the node's network interface
podHostNetwork: true

# =============================================================================
# LiveKit Server Configuration
# =============================================================================
livekit:
  # port: 7880
  # Uncomment to enable prometheus metrics
  # prometheus_port: 6789
  log_level: info

  # ---------------------------------------------------------------------------
  # RTC Configuration
  # ---------------------------------------------------------------------------
  rtc:
    use_external_ip: true
    port_range_start: 50000
    port_range_end: 60000
    tcp_port: 7881

  # ---------------------------------------------------------------------------
  # Redis Configuration
  # ---------------------------------------------------------------------------
  redis:
    address: "[redacted]"
    db: 0
    username: "default"
    password: "[redacted]"
    # use_tls: false

  # ---------------------------------------------------------------------------
  # API Keys Configuration
  # Generate your own keys: https://docs.livekit.io/guides/getting-started/#generate-api-key-and-secret
  # Format: api_key: "api_secret"
  # ---------------------------------------------------------------------------
  keys:
    [redacted]: [redacted]

  # ---------------------------------------------------------------------------
  # TURN Server Configuration
  # ---------------------------------------------------------------------------
  turn:
    enabled: true
    # Must match domain of your TLS cert
    domain: turn.lk-sandbox.featherhq.com
    # TURN/TLS port - pod handles TLS using the secretName certificate
    tls_port: 3478
    # Kubernetes Secret containing TLS cert for TURN domain
    # Create with: kubectl create secret tls <secretName> --cert <cert-file> --key <key-file>
    secretName: livekit-turn-tls
    # AWS NLB annotations for TURN LoadBalancer
    loadBalancerAnnotations:
      service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"
      service.beta.kubernetes.io/aws-load-balancer-type: "external"
      service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip"

# =============================================================================
# Load Balancer Configuration
# =============================================================================
# Disabled - letting Porter handle ingress and TLS termination
loadBalancer:
  type: alb
  tls:
    - hosts:
        - server.lk-sandbox.featherhq.com


# =============================================================================
# Autoscaling Configuration
# =============================================================================
# Note: Only one LiveKit pod can run per node due to host networking
autoscaling:
  enabled: false
  minReplicas: 1
  maxReplicas: 1
  targetCPUUtilizationPercentage: 60

# =============================================================================
# Resource Configuration
# =============================================================================
# Recommended: Give LiveKit plenty of resources since only one pod runs per node
resources:
  limits:
    cpu: 4000m
    memory: 2048Mi
  requests:
    cpu: 2000m
    memory: 1024Mi
While using the livekit-cli join room command, the websocket is able to connect but WebRTC is failing
t
Thanks for reaching out, arijit. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I looked at your Helm values and the symptom (WebSocket OK, WebRTC failing). The most likely causes and next steps are: 1) TURN TLS port • You set
turn.tls_port: 3478
. TURN/TLS should be 5349 or, ideally for firewall traversal, 443. Set
turn.tls_port: 443
(or 5349) and ensure your TURN certificate covers turn.lk-sandbox.featherhq.com. 2) Expose TURN via a LoadBalancer service • The Helm values you shared do not create a separate TCP service for TURN. Create a Service (type LoadBalancer) that exposes the TURN TLS port (TCP 443/5349) and add the NLB/ALB annotations you need. Ensure the LB forwards to the pod target port you set. 3) Open UDP media ports on node security group • With
podHostNetwork: true
, the pod uses node IPs. Open UDP 50000–60000 inbound on the EKS worker nodes’ security group so ICE host candidates can flow. 4) Confirm advertise/bind addresses • You set
rtc.use_external_ip: true
. Ensure nodes have public IPs or explicitly set
rtc.bind_address
and
rtc.advertise_address
to the correct addresses that clients should reach. 5) Verify and test • Run the LiveKit Connection Test (WebRTC, TURN, UDP) against your server URL. • Check LiveKit server logs for ICE/DTLS/turn errors:
kubectl logs <livekit-pod>
. If you’d like, please share: • The client-side WebRTC error logs (browser/cli output). • Output of
kubectl get svc
and
kubectl get pods -o wide
. • Results from the LiveKit connection test. I’ll use those to pinpoint whether it’s TURN TLS handshake, blocked UDP, or incorrect advertised addresses. Sources: Connecting to LiveKit | LiveKit docs | Deploying LiveKit | LiveKit docs | Ports and firewall | LiveKit docs | Configuring firewalls | LiveKit docs | Deploy to Kubernetes | LiveKit docs
m
output from livekit-cli join room command
Copy code
2025-12-12T19:03:15.303+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:57264->[fd00:ec2::23]:55125: sendto: no route to host
2025-12-12T19:03:15.303+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:57061->[fd00:ec2::23]:55125: sendto: no route to host
2025-12-12T19:03:15.303+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:57264->[fd00:ec2::23]:55125: sendto: no route to host
2025-12-12T19:03:15.303+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:57061->[fd00:ec2::23]:55125: sendto: no route to host
2025-12-12T19:03:15.303+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:57061->[fd00:ec2::23]:55125: sendto: no route to host
2025-12-12T19:03:15.311+0530    WARN    lk.pion.ice     v4@v4.0.10/gather.go:32 failed to get server reflexive address udp6 stun:stun.l.google.com:19302: write udp6 [::]:51234->[2001:4860:4864:5:8000::1]:19302: sendto: no route to host
2025-12-12T19:03:15.313+0530    INFO    lk.pion.pc      v4@v4.1.6/peerconnection.go:279 signaling state changed to have-local-offer
2025-12-12T19:03:15.315+0530    WARN    lk.pion.ice     v4@v4.0.10/gather.go:32 failed to get server reflexive address udp6 stun:stun.l.google.com:19302: write udp6 [::]:54752->[2001:4860:4864:5:8000::1]:19302: sendto: no route to host
2025-12-12T19:03:15.315+0530    WARN    lk.pion.ice     v4@v4.0.10/gather.go:32 failed to get server reflexive address udp6 stun:stun1.l.google.com:19302: write udp6 [::]:62405->[2001:4860:4864:5:8000::1]:19302: sendto: no route to host
2025-12-12T19:03:15.315+0530    WARN    lk.pion.ice     v4@v4.0.10/gather.go:32 failed to get server reflexive address udp6 stun:stun1.l.google.com:19302: write udp6 [::]:64773->[2001:4860:4864:5:8000::1]:19302: sendto: no route to host
2025-12-12T19:03:15.555+0530    INFO    lk.pion.pc      v4@v4.1.6/peerconnection.go:279 signaling state changed to stable
2025-12-12T19:03:15.555+0530    INFO    lk.pion.ice     v4@v4.0.10/agent.go:458 Setting new connection state: Checking
2025-12-12T19:03:15.555+0530    INFO    lk.pion.pc      v4@v4.1.6/peerconnection.go:500 ICE connection state changed: checking
2025-12-12T19:03:15.555+0530    INFO    lk.pion.pc      v4@v4.1.6/peerconnection.go:514 peer connection state changed: connecting
2025-12-12T19:03:15.558+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::1cf9:1864:7b5f:2126%en0]:55210->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.558+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:63663->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.558+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:62019->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.560+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::1cf9:1864:7b5f:2126%en0]:55210->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.560+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:63663->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.560+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:62019->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.763+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::1cf9:1864:7b5f:2126%en0]:55210->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.763+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:63663->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.763+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:62019->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.965+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::1cf9:1864:7b5f:2126%en0]:55210->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.965+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:63663->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:15.965+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:62019->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:16.168+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::1cf9:1864:7b5f:2126%en0]:55210->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:16.168+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:63663->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:16.168+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:62019->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:16.350+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::1cf9:1864:7b5f:2126%en0]:55210->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:16.350+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:63663->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:16.350+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:62019->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:16.805+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::1cf9:1864:7b5f:2126%en0]:55210->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:16.805+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:63663->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:16.805+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:62019->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:17.008+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::1cf9:1864:7b5f:2126%en0]:55210->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:17.008+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%awdl0]:63663->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:17.008+0530    INFO    lk.pion.ice     v4@v4.0.10/candidate_base.go:363        Failed to send packet: write udp [fe80::6c1b:b6ff:fe2f:372%llw0]:62019->[fd00:ec2::23]:59338: sendto: no route to host
2025-12-12T19:03:20.321+0530    WARN    lk.pion.ice     v4@v4.0.10/gather.go:32 failed to get server reflexive address udp4 turns:turn.lk-sandbox.featherhq.com:443?transport=tcp: read udp4 0.0.0.0:53213: i/o timeout
2025-12-12T19:03:20.321+0530    WARN    lk.pion.ice     v4@v4.0.10/gather.go:32 failed to get server reflexive address udp4 turns:turn.lk-sandbox.featherhq.com:443?transport=tcp: read udp4 0.0.0.0:65305: i/o timeout
could not connect after timeout
t
Thanks — I reviewed your livekit-cli logs. They show two clear problems I can help you fix: What the logs show • Repeated "sendto: no route to host" for IPv6 link‑local and IPv6 STUN addresses — client is trying IPv6 but cannot route. • STUN over UDP6 fails, and STUN/TURN over IPv4 times out. • Final error: TURN TLS (turns) at turn.lk-sandbox.featherhq.com:443 timed out — TURN not reachable. What you can do next (in order) 1. Ensure TURN is reachable over TCP 443 (or 5349) ◦ Create a LoadBalancer (type=LoadBalancer) service that forwards TCP 443 (client) to your pod TURN TLS port (e.g., 5349). Confirm external IP/DNS for that service. 1. Open UDP media ports on node security group ◦ Add inbound UDP rule: 50000–60000 from 0.0.0.0/0 (nodes use hostNetwork). 1. Verify TURN certificate and hostname ◦ TLS cert must include turn.lk-sandbox.featherhq.com. 1. Confirm advertise/bind addresses ◦ If nodes are in private subnets,
rtc.use_external_ip: true
may fail. Either put nodes in public subnets or explicitly set
rtc.bind_address
and
rtc.advertise_address
. 1. Disable/ignore IPv6 (optional quick test) ◦ If your environment has no IPv6 routing, client may try IPv6 first. For testing, force IPv4 STUN/TURN in the client or disable IPv6 on the test machine to see if behavior changes. Quick checks to run and paste back • kubectl get svc • kubectl get pods -o wide • Describe the TURN service you created (or confirm none exists) • Security group rules for EKS worker nodes (show UDP 50000–60000 and TCP 443) If you share those outputs I’ll point out exactly what to change next and a minimal Kubernetes Service manifest you can apply.