telephoneorg / docker-kamailio Goto Github PK
View Code? Open in Web Editor NEWKamailio Dockerized for Kubernetes
Kamailio Dockerized for Kubernetes
We have the following service manifest for kamailio:
kind: Service
apiVersion: v1
metadata:
name: kamailio
labels:
app: kamailio
role: sip-proxy
spec:
selector:
app: kamailio
project: valuphone
type: NodePort
clusterIP: None
ports:
- name: sip-tcp
protocol: TCP
port: 5060
nodePort: 5060
- name: sip-udp
protocol: UDP
port: 5060
nodePort: 5060
- name: sip-tls
protocol: TCP
port: 5061
nodePort: 5061
- name: alg-tcp
protocol: TCP
port: 7000
nodePort: 7000
- name: alg-udp
protocol: UDP
port: 7000
nodePort: 7000
- name: alg-tls
protocol: TCP
port: 7001
nodePort: 7001
When I try to create it, it gives the following error:
The Service "kamailio" is invalid.
spec.ports[1].nodePort: invalid value '5060', Details: provided port is already allocated
It appears that the error checking kubernetes does of the service manifest isn't taking into account that udp and tcp ports are different ports. If i run it through and change the tcp ports to one port higher, it works.
I discussed the possible bug with the kubernetes developers and they had this to say:
justinsb [8:17 PM]
@xwhyz: I think it’s actually a bug/design mistake (my mistake) that we don’t allow you to bind the same NodePort for both TCP & UDP
[8:18]
It’s not a huge deal if you have ELB in front, because it will redirect the ports anyway
[8:19]
Not sure what to recommend if you’re not using ELB though
[8:19]
It’s definitely a fixable bug. Though likely not in 1.2
the following manifest is working, but doesn't meet the sip standards as i understand them:
kind: Service
apiVersion: v1
metadata:
name: kamailio
labels:
app: kamailio
role: sip-proxy
spec:
selector:
app: kamailio
project: valuphone
type: NodePort
clusterIP: None
ports:
- name: sip-tcp
protocol: TCP
port: 5060
nodePort: 5060
- name: sip-udp
protocol: UDP
port: 5060
#nodePort: 5060
nodePort: 5061
- name: sip-tls
protocol: TCP
port: 5061
# nodePort: 5061
nodePort: 5062
- name: alg-tcp
protocol: TCP
port: 7000
nodePort: 7000
- name: alg-udp
protocol: UDP
port: 7000
# nodePort: 7000
nodePort: 7001
- name: alg-tls
protocol: TCP
port: 7001
nodePort: 7002
Here is the output of kubectl describe svc kamailio
Name: kamailio
Namespace: default
Labels: app=kamailio,role=sip-proxy
Selector: app=kamailio,project=valuphone
Type: NodePort
IP: None
Port: sip-tcp 5060/TCP
NodePort: sip-tcp 5060/TCP
Endpoints: 172.17.16.27:5060,172.17.20.76:5060,172.17.60.89:5060
Port: sip-udp 5060/UDP
NodePort: sip-udp 5061/UDP
Endpoints: 172.17.16.27:5060,172.17.20.76:5060,172.17.60.89:5060
Port: sip-tls 5061/TCP
NodePort: sip-tls 5062/TCP
Endpoints: 172.17.16.27:5061,172.17.20.76:5061,172.17.60.89:5061
Port: alg-tcp 7000/TCP
NodePort: alg-tcp 7000/TCP
Endpoints: 172.17.16.27:7000,172.17.20.76:7000,172.17.60.89:7000
Port: alg-udp 7000/UDP
NodePort: alg-udp 7001/UDP
Endpoints: 172.17.16.27:7000,172.17.20.76:7000,172.17.60.89:7000
Port: alg-tls 7001/TCP
NodePort: alg-tls 7002/TCP
Endpoints: 172.17.16.27:7001,172.17.20.76:7001,172.17.60.89:7001
Hi
How does kamailio docker obtain the real ip of the client for fixing the NAT issues (like fix_nated_contact or fix_nated_register)
thanks
Siva
Hello, Joe.
Probably, you don't use RBAC in your Kubernetes cluster, but I do. So, a bunch of monitoring containers can't reach API rules because of permissions. (I've done files with roles and make PR later).
But I have the next problem:
1)I've created necessary Roles and RoleBindings.
2)But kubewait doesn't get them
pykube.exceptions.HTTPError: deployments.extensions "rabbitmq" is forbidden: User "system:serviceaccount:default:default" cannot get deployments.extensions in the namespace "default": [clusterrole.rbac.authorization.k8s.io "get-deployments-default" not found, role.rbac.authorization.k8s.io "get-rabbitmq-resources" not found]
though they exist and they are visible via kubectl:
root@kmaster1:~/# kubectl get roles
NAME AGE
get-couchdb-configmap 2d
get-couchdb-statefulsets 2d
get-rabbitmq-resources 22h
Hello.
I've noticed that to variables presented in the kubernetes/local.yaml
- name: FREESWITCH_SYNC_SOURCE
valueFrom:
configMapKeyRef:
name: kamailio
key: freeswitch.sync.source
- name: FREESWITCH_SYNC_ARGS
valueFrom:
configMapKeyRef:
name: kamailio
key: freeswitch.sync.args
But they are not defined in the ConfigMap definition:
data:
kamailio.log.level: info
kamailio.log.color: 'true'
rabbitmq.hosts: rabbitmq
kamailio.shm-memory: '128'
kamailio.pkg-memory: '8'
kamailio.enable-roles: websockets,message,presence_query,presence_notify_sync,registrar_sync
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.