Skip to main content
FreeSWITCH Cluster by
Kubernetes
Stanley Wu (吳建澄)
skyeyester@gmail.com
Mar. 3, 2017
Outline
● Overview
● Create a FreeSWITCH Cluster
● Deploy a FreeSWITCH App
● Explore Your FreeSWITCH App
● Expose Your FreeSWITCH App Publicly
● Scale Your FreeSWITCH App
● Update Your FreeSWITCH App
2
Overview
● Kubernetes is a production-grade, open-source platform that orchestrates the
placement (scheduling) and execution of application containers within and
across computer clusters.
● Minikube is a lightweight Kubernetes implementation that creates a VM on
your local machine and deploys a simple cluster containing only one node.
3
Create a FreeSWITCH Cluster
Using Minikube to Create a Cluster
● High Availability and Scalability
● FreeSWITCH Cluster
Starting Minikube via a single command: $ minikube start Host Machine
FreeSWITCH
(Minikube)
VM Driver
Host OS
4
Deploy a FreeSWITCH App
Using kubectl to Create a Deployment
● $ kubectl run freeswitch --image=freeswitch --port=80
5
Explore Your FreeSWITCH App
Viewing Pods and Nodes
● $ kubectl get pod
● $ kubectl get pods --all-namespaces
6
Expose Your FreeSWITCH App Publicly
Using a Service to Expose Your App
● Create service
○ $ kubectl expose deployment freeswitch --type=NodePort
● Open service
○ $ minikube service freeswitch
● Check Deployment
○ $ kubectl get deployment
7
Scale Your FreeSWITCH App
Running Multiple Instances of Your FreeSWITCH App
● kubectl create -f freeswitch.yml
● kubectl scale deployment freeswitch --replicas=4
8
Update Your FreeSWITCH App
Rolling updates allows Deployments to occur with zero downtime by incrementally
updating Pods instances with new ones.
├─ Deployment: <name>
│ └─ Replica Set: <name>-<rs>
│ └─ Pod: <name>-<rs>-<randomString>
● Get replica set
○ $ kubectl get rs
● Check Status
○ $ kubectl rollout status deployment nginx
○ $ kubectl rollout history deployment/nginx 9
Reference
1. Kubernetes Tutorials (https://kubernetes.io/docs/tutorials/)
2. FreeSWITCH (https://www.freeswitch.org/)
10