We are using Azure for Live Kit self hosting. In a...
# ask-ai
l
We are using Azure for Live Kit self hosting. In a virtual machine, used livekit/generate to generate the yaml and docker compose files. We have • External Redis docker container running • updated livekit.yaml with redis address and password, started Livekit server using docker compose up
t
Thanks for reaching out, Shanmugam. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Let's walk through setting up LiveKit self-hosting with Azure, Redis, and Docker Compose together. Here are the steps to get you started: 1. First, use the
livekit/generate
tool to create your configuration files, including
livekit.yaml
and
docker-compose.yaml
. This will give you a solid base to work from. 2. Next, update your
livekit.yaml
file with your Redis address and password. For example:
Copy code
redis:
  address: redis.host:6379
  password: your_redis_password
1. Make sure your
docker-compose.yaml
includes both the LiveKit server and Redis services. Here's an example to guide you:
Copy code
services:
  redis:
    image: redis
    ports:
      - "6379:6379"
  livekit:
    image: livekit/livekit-server
    command: --config /livekit.yaml
    volumes:
      - ./livekit.yaml:/livekit.yaml
    ports:
      - "7880:7880"
      - "7881:7881"
    depends_on:
      - redis
1. Don't forget to open the necessary ports in your Azure VM's Network Security Group (NSG): • Ports 7880 (TCP), 7881 (WebRTC TCP), and the UDP range 50000–60000 for media traffic. 1. Finally, run
docker-compose up -d
to launch your services. If you run into any hiccups or want to dive deeper into any of these steps, just let me know—I'm here to help you get everything running smoothly! Sources: Deploy to a VM | LiveKit Docs | config-sample.yaml | README.md | README.md | Self-hosted SIP server | LiveKit Docs
l
I am planning to install Egress in AKS. Can you brief me the steps? Should i create a cluster in AKS?
I am planning to install Egress in AKS. Can you brief me the steps? Should i create a cluster in AKS?
t
To get you started with installing LiveKit Egress on Azure Kubernetes Service (AKS), here’s a friendly step-by-step guide: 1. Create an AKS Cluster: First, set up an AKS cluster with enough resources to run smoothly (I recommend at least 4 CPUs and 4GB RAM per node). 2. Install Helm: Make sure Helm is installed on your local machine or within your CI/CD pipeline. Then, add the LiveKit Helm repository by running:
Copy code
helm repo add livekit https://livekit.io/helm/charts
helm repo update
1. Prepare Configuration: You can start with the egress-sample.yaml as your base. Don’t forget to configure Azure Blob Storage for your output like this:
Copy code
egress:
  api_key: "your-livekit-api-key"
  api_secret: "your-livekit-api-secret"
  ws_url: "wss://your-livekit-server:443"
  redis:
    address: "your-redis-host:6379"
  azure:
    account_name: "your-storage-account-name"
    account_key: "your-storage-account-key"
    container_name: "your-container-name"
For your peace of mind, I highly suggest using Kubernetes Secrets or Managed Identities to keep your credentials safe instead of hardcoding them. 1. Deploy Egress: When you’re ready, install the Helm chart with this command:
Copy code
helm install my-egress livekit/egress -f values.yaml
1. Verify Installation: To make sure everything is running smoothly, check your pods and logs like this:
Copy code
kubectl get pods -l app.kubernetes.io/name=egress
kubectl logs <egress-pod-name>
If you run into any bumps along the way or want to dive deeper into any part of the setup, just let me know—I’m here to help! Sources: Self-hosting the Ingress Service | LiveKit Docs | egress/templates/NOTES.txt | go.sum | Egress output types | LiveKit Docs | Deploy to Kubernetes | LiveKit Docs
To get you started with installing LiveKit Egress in AKS (Azure Kubernetes Service), here’s a friendly step-by-step guide to walk you through the process: 1. Create an AKS Cluster: First things first, you’ll want to create an AKS cluster. Make sure it has enough resources—ideally 4+ CPUs and 4GB+ RAM per node—to comfortably handle transcoding workloads. 2. Install Helm: Next, install Helm on your local machine or within your CI/CD pipeline. You can do this by running:
Copy code
helm repo add livekit https://livekit.io/helm/charts
helm repo update
1. Prepare Configuration: Take a look at the egress-sample.yaml as a starting point. You’ll want to set up Azure Blob Storage for your output, something like this:
Copy code
egress:
  api_key: "your-livekit-api-key"
  api_secret: "your-livekit-api-secret"
  ws_url: "wss://your-livekit-server:443"
  redis:
    address: "your-redis-host:6379"
  azure:
    account_name: "your-storage-account-name"
    account_key: "your-storage-account-key"
    container_name: "your-container-name"
1. Deploy the Helm Chart: When you’re ready, deploy with this command:
Copy code
helm install my-egress livekit/egress -f values.yaml
1. Verify Installation: Finally, check how things are running by looking at your pod status and logs:
Copy code
kubectl get pods -l app.kubernetes.io/name=egress
kubectl logs <egress-pod-name>
If you run into any bumps or want a hand with specific settings or troubleshooting, just reach out—I’m here to help you every step of the way!
l
In the above - helm install my-egress livekit/egress -f values.yaml what should be my-egress?
t
Just to clarify, the term
my-egress
in the command is simply the release name you choose for this Helm deployment. It can be any name that feels right to you to help identify this particular deployment of the LiveKit Egress service in your AKS cluster. For example, you might use:
Copy code
helm install livekit-egress livekit/egress -f values.yaml
In this case,
livekit-egress
is the release name. Feel free to pick any name that makes sense and helps you easily manage and recognize the deployment later on. If you have any more questions or need a hand with anything else, just let me know—I’m here to help!
l
Can we deploy egress on virtual nodes enabled with azure cni, instead of virtual machines? If so, what will be the steps to do it
t
Thanks so much for reaching out! I want to make sure we get this right for you. Currently, it’s not entirely clear if LiveKit Egress can be deployed on Azure virtual nodes using Azure CNI, as virtual nodes sometimes have limitations with host networking, which LiveKit often needs. Could you help me understand a bit more? • Are you working with AKS that includes virtual nodes? • Do you need host networking for your Egress setup, or are you using a different configuration that doesn’t require it? Once I have a bit more detail, I’ll be happy to guide you with more tailored advice or suggest some alternatives that might work well for your situation. Sources: egress/templates/NOTES.txt | Self-hosting the Egress Service | LiveKit Docs | Egress API | LiveKit Docs | Azure AI Services and LiveKit | LiveKit Docs | docs/tutorials/azure.md
l
I am planning to use aks cluster only for egress. Using a virtual machine pool for egress jobs will involve considerable provisioning time and scale down time for each egress job. Hence the thought to use virtual nodes with azure cni. Are there any other options to minimise the overhead time other than egress job execution time? Is hostnetwork required for egress?
t
Great news! LiveKit Egress doesn’t require host networking, so you have the flexibility to deploy it on virtual nodes or other Kubernetes environments without any worries about that constraint. To help you minimize provisioning and scale-down time for your Egress jobs, here are some friendly tips you might find useful: 1. Enable Autoscaling: You can set this up in the Helm chart by turning on
autoscaling.enabled: true
and specifying
minReplicas
and
maxReplicas
. This way, the Egress service can smartly scale based on CPU usage or even custom metrics like
livekit_egress_available
. 2. Set Resource Requests and Limits: It’s a good idea to allocate enough CPU and memory—something like 4 CPUs and 4 GB RAM per instance—to help with faster scheduling and to avoid any resource shortages. 3. Use Graceful Termination: Configuring
terminationGracePeriodSeconds
(for example, 3600 seconds) lets your in-progress Egress jobs finish smoothly before the pod shuts down during scale-down. 4. Optimize Job Distribution: Running multiple Egress workers and balancing jobs through Redis can really boost efficiency by making the most of your available instances. Following these steps should help you reduce overhead time while keeping resource usage efficient. If you’d like, I’m here to assist you with setting up any of these options—just let me know! Sources: Deploy to Kubernetes | LiveKit Docs | egress/values.yaml | Self-hosting the Egress Service | LiveKit Docs
l
Can you help on the helm installation egress yaml configuration and steps to deploy on azure aks virtual nodes
t
I'm here to help you deploy LiveKit Egress on Azure AKS virtual nodes using Helm. Let's walk through the steps together: 1. Create an AKS Cluster: First, make sure your AKS cluster is set up with virtual nodes enabled and has enough resources to handle your Egress jobs. 2. Install Helm: Next, add the LiveKit Helm repository and update it by running:
Copy code
helm repo add livekit https://livekit.io/helm/charts
helm repo update
1. Prepare the Configuration: You can start with the egress-sample.yaml as a template. Be sure to update it with your Azure Blob Storage and Redis details like this:
Copy code
egress:
  api_key: "your-livekit-api-key"
  api_secret: "your-livekit-api-secret"
  ws_url: "wss://your-livekit-server:443"
  redis:
    address: "your-redis-host:6379"
  azure:
    account_name: "your-storage-account-name"
    account_key: "your-storage-account-key"
    container_name: "your-container-name"
For enhanced security, I recommend using Kubernetes Secrets or Managed Identities to handle your Azure Blob Storage credentials safely. 1. Enable Autoscaling: To make sure your deployment scales smoothly, configure autoscaling in your YAML file like this:
Copy code
autoscaling:
  enabled: true
  minReplicas: 1
  maxReplicas: 10
  targetCPUUtilizationPercentage: 60
1. Deploy the Helm Chart: When you’re ready, deploy by running:
Copy code
helm install egress-release livekit/egress -f values.yaml
1. Verify Deployment: Finally, check on your pods and their logs to ensure everything is running smoothly:
Copy code
kubectl get pods -l app.kubernetes.io/name=egress
kubectl logs <egress-pod-name>
If you have any questions about customizing the YAML file or run into any issues during deployment, please don’t hesitate to reach out. I’m here to help you every step of the way!