Skip to main content

Installing Ant Media Server on Azure AKS

In this document, you will see step-by-step instructions on how to run Ant Media Server Enterprise version on Azure Kubernetes Service (AKS).

info

You need to have the Azure CLI software and the Kubernetes command line toolinstalled on your computer.

Step 1: Create a Kubernetes Cluster

After logging in to the Azure Portal, open the Kubernetes service and click on the Create > Create a Kubernetes cluster button.

After creating the Resource Group and configuring settings such as Region and Kubernetes cluster name, navigate to the Next: Node pools tab.

Step 2: Configure Node Pools

In the Node pools tab, enter the node pool (default agent pool) and make the desired changes according to your preferences. However, it is essential to ensure that Enable public IP per node is selected here.

Step 3: Review and Create Cluster

Navigate to the Review + create tab and click Create to complete the setup (other settings are optional).

Step 4: Connect to Cluster

When the installation is complete, you will see a screen like the one below. And then Click on the Connect to cluster button.

Run the following commands to connect to the cluster from your local computer.

az account set --subscription your-subscription
az aks get-credentials --resource-group your-resource-group --name your-cluster-name

Step 5: Install Ant Media Server via Helm

After successfully accessing the cluster, let's add and update the Ant Media Helm repository as follows.

helm repo add antmedia https://ant-media.github.io/helm
helm repo update

And start the installation as follows

danger

Don't forget to change your licenseKey, origin and edge values.

helm install antmedia antmedia/antmedia --set origin=origin.antmedia.cloud --set edge=edge.antmedia.cloud  --set licenseKey="your-key" --set UseGlobalIP=false 
--namespace antmedia --create-namespace

Step 6: Configure Ingress Controller

You have two alternatives: you can opt for either Azure Application Gateway or Nginx Ingress Controller.

By default, Ant Media Server deploys a self-signed certificate. If You should prefer to utilize a signed certificate, kindly refer to this link for detailed instructions.

  1. Nginx Ingress Controller: For the Nginx Ingress Controller, you will only need to run the following command.
kubectl annotate service antmedia-ingress-nginx-controller service.beta.kubernetes.io/azure-load-balancer-health-probe-request-path=/healthz -n antmedia
  1. Azure Application Gateway: Need to use an Application Gateway for which you can select Networking > Enable ingress controller from your cluster, and then create the Application Gateway.

Then run the following command to enable Application Gateway Ingress.

kubectl annotate ingress -n antmedia kubernetes.io/ingress.class=azure/application-gateway --overwrite --all

If you are using Application Gateway as Ingress, you should make changes to the deployment files as follows.

kubectl edit deployment ant-media-server-origin -n antmedia

Add the following lines under image:

        lifecycle:
postStart:
exec:
command:
- /bin/sh
- -c
- sed -i '/org.apache.catalina.valves.RemoteIpValve/d' /usr/local/antmedia/conf/jee-container.xml

These changes must be made on both Origin and Edge deployment side.

Step 7

If the installation and configuration was successful, the public IP address/domain name will be output when running the command kubectl get ingress -n antmedia. After making the DNS registration, you will be able to access Ant Media Server using the hostname thats been configured.

Execute the kubectl get svc -n antmedia command to fetch the RTMP address from the EXTERNAL-IP column to start live streaming using RTMP on port 1935.

Share feedback