diff --git a/kubernetes/README.md b/kubernetes/README.md new file mode 100644 index 0000000..fd71619 --- /dev/null +++ b/kubernetes/README.md @@ -0,0 +1,19 @@ +This is the first draft of deploying Jambonz on Kubernetes (K8S). The K8S manifests are built based on the Docker compose file in the same repository. + +# Manual steps + +- Setup MySQL databases and tables +- Setup public DNS for `webapp` and `api-server`. It looks like that `webapp` connects to `api-server` in the front-end, so public DNS for `api-server` is needed. + +# Deployment + +The current deployment uses Kustomize: + +```bash +kubectl apply -k . +``` + +# TODO + +- Use Secret to store MySQL password +- Setup MySQL databases and tables using sidecar \ No newline at end of file diff --git a/kubernetes/api-server/api-server-deployment.yaml b/kubernetes/api-server/api-server-deployment.yaml new file mode 100644 index 0000000..003cf82 --- /dev/null +++ b/kubernetes/api-server/api-server-deployment.yaml @@ -0,0 +1,48 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: api-server + name: api-server +spec: + replicas: 1 + selector: + matchLabels: + app: api-server + template: + metadata: + labels: + app: api-server + spec: + containers: + - env: + - name: ENABLE_METRICS + value: "0" + - name: HTTP_PORT + value: "3000" + - name: JAMBONES_CLUSTER_ID + value: jb + - name: JAMBONES_LOGLEVEL + value: info + - name: JAMBONES_MYSQL_DATABASE + value: jambones + - name: JAMBONES_MYSQL_HOST + value: mysql + - name: JAMBONES_MYSQL_PASSWORD + value: jambones + - name: JAMBONES_MYSQL_USER + value: jambones + - name: JAMBONES_REDIS_HOST + value: redis + - name: JAMBONES_REDIS_PORT + value: "6379" + - name: JAMBONE_API_VERSION + value: v1 + - name: NODE_ENV + value: production + image: jambonz/jambonz-api-server:latest + name: api-server + ports: + - containerPort: 3000 + resources: {} + restartPolicy: Always \ No newline at end of file diff --git a/kubernetes/api-server/api-server-ingress.yaml b/kubernetes/api-server/api-server-ingress.yaml new file mode 100644 index 0000000..c84f70f --- /dev/null +++ b/kubernetes/api-server/api-server-ingress.yaml @@ -0,0 +1,15 @@ +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: api-server + annotations: + kubernetes.io/ingress.class: traefik +spec: + rules: + - host: api-server + http: + paths: + - path: / + backend: + serviceName: api-server + servicePort: 3000 \ No newline at end of file diff --git a/kubernetes/api-server/api-server-service.yaml b/kubernetes/api-server/api-server-service.yaml new file mode 100644 index 0000000..fdd0943 --- /dev/null +++ b/kubernetes/api-server/api-server-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: api-server + name: api-server +spec: + ports: + - name: "api-server" + port: 3000 + targetPort: 3000 + selector: + app: api-server diff --git a/kubernetes/call-router/call-router-deployment.yaml b/kubernetes/call-router/call-router-deployment.yaml new file mode 100644 index 0000000..af56778 --- /dev/null +++ b/kubernetes/call-router/call-router-deployment.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: call-router + name: call-router +spec: + replicas: 1 + selector: + matchLabels: + app: call-router + template: + metadata: + labels: + app: call-router + spec: + containers: + - env: + - name: ENABLE_METRICS + value: "0" + - name: HTTP_PORT + value: "4000" + - name: JAMBONES_INBOUND_ROUTE + value: 127.0.0.1:4002 + - name: JAMBONES_LOGLEVEL + value: info + - name: JAMBONES_NETWORK_CIDR + value: 100.0.0.0/8 + - name: JAMBONES_OUTBOUND_ROUTE + value: 127.0.0.1:4003 + - name: JAMBONZ_TAGGED_INBOUND + value: "1" + - name: NODE_ENV + value: production + image: jambonz/sbc-call-router:latest + name: call-router + resources: {} + restartPolicy: Always diff --git a/kubernetes/call-router/call-router-service.yaml b/kubernetes/call-router/call-router-service.yaml new file mode 100644 index 0000000..7e2de04 --- /dev/null +++ b/kubernetes/call-router/call-router-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: call-router + name: call-router +spec: + ports: + - name: "4000" + port: 4000 + protocol: UDP + targetPort: 4000 + selector: + app: call-router diff --git a/kubernetes/drachtio-sbc/drachtio-sbc-configmap.yaml b/kubernetes/drachtio-sbc/drachtio-sbc-configmap.yaml new file mode 100644 index 0000000..32f1081 --- /dev/null +++ b/kubernetes/drachtio-sbc/drachtio-sbc-configmap.yaml @@ -0,0 +1,29 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: drachtio-sbc-conf +data: + drachtio.conf.xml: | + + + + 0.0.0.0 + + http://call-router:4000 + + + + + + 4096 + + + + false + + + 3 + info + + + \ No newline at end of file diff --git a/kubernetes/drachtio-sbc/drachtio-sbc-deployment.yaml b/kubernetes/drachtio-sbc/drachtio-sbc-deployment.yaml new file mode 100644 index 0000000..07c9c8e --- /dev/null +++ b/kubernetes/drachtio-sbc/drachtio-sbc-deployment.yaml @@ -0,0 +1,52 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: drachtio-sbc + name: drachtio-sbc +spec: + replicas: 1 + selector: + matchLabels: + app: drachtio-sbc + template: + metadata: + labels: + app: drachtio-sbc + spec: + containers: + - args: + - drachtio + - --contact + - sip:$(MY_POD_IP);transport=udp + - --contact + - sip:$(MY_POD_IP);transport=tcp + - --address + - 0.0.0.0 + - --port + - "9022" + image: drachtio/drachtio-server:latest + name: drachtio-sbc + env: + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + ports: + - containerPort: 9022 + protocol: TCP + - containerPort: 5060 + protocol: UDP + resources: {} + volumeMounts: + - mountPath: /etc/drachtio.conf.xml + name: drachtio-sbc-conf + subPath: drachtio.conf.xml + restartPolicy: Always + volumes: + - name: drachtio-sbc-conf + configMap: + name: drachtio-sbc-conf + items: + - key: drachtio.conf.xml + path: drachtio.conf.xml \ No newline at end of file diff --git a/kubernetes/drachtio-sbc/drachtio-sbc-service.yaml b/kubernetes/drachtio-sbc/drachtio-sbc-service.yaml new file mode 100644 index 0000000..bf6c126 --- /dev/null +++ b/kubernetes/drachtio-sbc/drachtio-sbc-service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: drachtio-sbc + name: drachtio-sbc +spec: + ports: + - name: "9022" + port: 9022 + protocol: TCP + targetPort: 9022 + - name: "5060" + port: 5060 + protocol: UDP + targetPort: 5060 + selector: + app: drachtio-sbc diff --git a/kubernetes/kustomization.yaml b/kubernetes/kustomization.yaml new file mode 100644 index 0000000..d31ea26 --- /dev/null +++ b/kubernetes/kustomization.yaml @@ -0,0 +1,27 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +namespace: default # Replace by your namespace here + +resources: +- namespace.yaml +- mysql/mysql-service.yaml +- mysql/mysql-statefulset.yaml +- redis/redis-service.yaml +- redis/redis-statefulset.yaml +- rtpengine/rtpengine-service.yaml +- rtpengine/rtpengine-deployment.yaml +- webapp/webapp-deployment.yaml +- webapp/webapp-service.yaml +- webapp/webapp-ingress.yaml +- api-server/api-server-deployment.yaml +- api-server/api-server-service.yaml +- api-server/api-server-ingress.yaml +- drachtio-sbc/drachtio-sbc-deployment.yaml +- drachtio-sbc/drachtio-sbc-service.yaml +- drachtio-sbc/drachtio-sbc-configmap.yaml +- call-router/call-router-deployment.yaml +- call-router/call-router-service.yaml +- sbc-inbound/sbc-inbound-deployment.yaml +- sbc-outbound/sbc-outbound-deployment.yaml +- registrar/registrar-deployment.yaml diff --git a/kubernetes/mysql/mysql-service.yaml b/kubernetes/mysql/mysql-service.yaml new file mode 100644 index 0000000..4a25484 --- /dev/null +++ b/kubernetes/mysql/mysql-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: mysql + name: mysql +spec: + ports: + - name: "mysql" + port: 3306 + targetPort: 3306 + selector: + app: mysql diff --git a/kubernetes/mysql/mysql-statefulset.yaml b/kubernetes/mysql/mysql-statefulset.yaml new file mode 100644 index 0000000..02a1beb --- /dev/null +++ b/kubernetes/mysql/mysql-statefulset.yaml @@ -0,0 +1,56 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app: mysql + name: mysql +spec: + serviceName: mysql + replicas: 1 + selector: + matchLabels: + app: mysql + template: + metadata: + name: mysql + labels: + app: mysql + spec: + containers: + - env: + - name: MYSQL_ALLOW_EMPTY_PASSWORD + value: "yes" + - name: MYSQL_DATABASE + value: jambones + - name: MYSQL_PASSWORD + value: jambones + - name: MYSQL_USER + value: jambones + image: mysql + livenessProbe: + exec: + command: + - mysqladmin + - ping + - -h + - 127.0.0.1 + - --protocol + - tcp + failureThreshold: 10 + timeoutSeconds: 5 + name: mysql + ports: + - containerPort: 3306 + resources: {} + volumeMounts: + - mountPath: /var/lib/mysql + name: mysql-claim + restartPolicy: Always + volumeClaimTemplates: + - metadata: + name: mysql-claim + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 10Gi diff --git a/kubernetes/namespace.yaml b/kubernetes/namespace.yaml new file mode 100644 index 0000000..d1a979e --- /dev/null +++ b/kubernetes/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: voicegateway \ No newline at end of file diff --git a/kubernetes/redis/redis-service.yaml b/kubernetes/redis/redis-service.yaml new file mode 100644 index 0000000..663307f --- /dev/null +++ b/kubernetes/redis/redis-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: redis + name: redis +spec: + ports: + - name: "6379" + port: 6379 + targetPort: 6379 + selector: + app: redis \ No newline at end of file diff --git a/kubernetes/redis/redis-statefulset.yaml b/kubernetes/redis/redis-statefulset.yaml new file mode 100644 index 0000000..6a3ac65 --- /dev/null +++ b/kubernetes/redis/redis-statefulset.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app: redis + name: redis +spec: + serviceName: redis + replicas: 1 + selector: + matchLabels: + app: redis + template: + metadata: + name: redis + labels: + app: redis + spec: + containers: + - image: redis:alpine + name: redis + ports: + - containerPort: 6379 + resources: {} + restartPolicy: Always diff --git a/kubernetes/registrar/registrar-deployment.yaml b/kubernetes/registrar/registrar-deployment.yaml new file mode 100644 index 0000000..d6009b5 --- /dev/null +++ b/kubernetes/registrar/registrar-deployment.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: registrar + name: registrar +spec: + replicas: 1 + selector: + matchLabels: + app: registrar + template: + metadata: + labels: + app: registrar + spec: + containers: + - env: + - name: DRACHTIO_HOST + value: drachtio-sbc + - name: DRACHTIO_PORT + value: "9022" + - name: DRACHTIO_SECRET + value: cymru + - name: ENABLE_METRICS + value: "0" + - name: JAMBONES_LOGLEVEL + value: info + - name: JAMBONES_MYSQL_DATABASE + value: jambones + - name: JAMBONES_MYSQL_HOST + value: mysql + - name: JAMBONES_MYSQL_PASSWORD + value: jambones + - name: JAMBONES_MYSQL_USER + value: jambones + - name: JAMBONES_REDIS_HOST + value: redis + - name: JAMBONES_REDIS_PORT + value: "6379" + - name: NODE_ENV + value: production + image: jambonz/sbc-registrar:latest + name: registrar + resources: {} + restartPolicy: Always diff --git a/kubernetes/rtpengine/rtpengine-deployment.yaml b/kubernetes/rtpengine/rtpengine-deployment.yaml new file mode 100644 index 0000000..a879832 --- /dev/null +++ b/kubernetes/rtpengine/rtpengine-deployment.yaml @@ -0,0 +1,230 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: rtpengine + name: rtpengine +spec: + replicas: 1 + selector: + matchLabels: + app: rtpengine + template: + metadata: + labels: + app: rtpengine + spec: + containers: + - args: + - rtpengine + - --log-level + - "7" + image: drachtio/rtpengine:jambonz-test + name: rtpengine + ports: + - containerPort: 40000 + protocol: UDP + - containerPort: 40001 + protocol: UDP + - containerPort: 40002 + protocol: UDP + - containerPort: 40003 + protocol: UDP + - containerPort: 40004 + protocol: UDP + - containerPort: 40005 + protocol: UDP + - containerPort: 40006 + protocol: UDP + - containerPort: 40007 + protocol: UDP + - containerPort: 40008 + protocol: UDP + - containerPort: 40009 + protocol: UDP + - containerPort: 40010 + protocol: UDP + - containerPort: 40011 + protocol: UDP + - containerPort: 40012 + protocol: UDP + - containerPort: 40013 + protocol: UDP + - containerPort: 40014 + protocol: UDP + - containerPort: 40015 + protocol: UDP + - containerPort: 40016 + protocol: UDP + - containerPort: 40017 + protocol: UDP + - containerPort: 40018 + protocol: UDP + - containerPort: 40019 + protocol: UDP + - containerPort: 40020 + protocol: UDP + - containerPort: 40021 + protocol: UDP + - containerPort: 40022 + protocol: UDP + - containerPort: 40023 + protocol: UDP + - containerPort: 40024 + protocol: UDP + - containerPort: 40025 + protocol: UDP + - containerPort: 40026 + protocol: UDP + - containerPort: 40027 + protocol: UDP + - containerPort: 40028 + protocol: UDP + - containerPort: 40029 + protocol: UDP + - containerPort: 40030 + protocol: UDP + - containerPort: 40031 + protocol: UDP + - containerPort: 40032 + protocol: UDP + - containerPort: 40033 + protocol: UDP + - containerPort: 40034 + protocol: UDP + - containerPort: 40035 + protocol: UDP + - containerPort: 40036 + protocol: UDP + - containerPort: 40037 + protocol: UDP + - containerPort: 40038 + protocol: UDP + - containerPort: 40039 + protocol: UDP + - containerPort: 40040 + protocol: UDP + - containerPort: 40041 + protocol: UDP + - containerPort: 40042 + protocol: UDP + - containerPort: 40043 + protocol: UDP + - containerPort: 40044 + protocol: UDP + - containerPort: 40045 + protocol: UDP + - containerPort: 40046 + protocol: UDP + - containerPort: 40047 + protocol: UDP + - containerPort: 40048 + protocol: UDP + - containerPort: 40049 + protocol: UDP + - containerPort: 40050 + protocol: UDP + - containerPort: 40051 + protocol: UDP + - containerPort: 40052 + protocol: UDP + - containerPort: 40053 + protocol: UDP + - containerPort: 40054 + protocol: UDP + - containerPort: 40055 + protocol: UDP + - containerPort: 40056 + protocol: UDP + - containerPort: 40057 + protocol: UDP + - containerPort: 40058 + protocol: UDP + - containerPort: 40059 + protocol: UDP + - containerPort: 40060 + protocol: UDP + - containerPort: 40061 + protocol: UDP + - containerPort: 40062 + protocol: UDP + - containerPort: 40063 + protocol: UDP + - containerPort: 40064 + protocol: UDP + - containerPort: 40065 + protocol: UDP + - containerPort: 40066 + protocol: UDP + - containerPort: 40067 + protocol: UDP + - containerPort: 40068 + protocol: UDP + - containerPort: 40069 + protocol: UDP + - containerPort: 40070 + protocol: UDP + - containerPort: 40071 + protocol: UDP + - containerPort: 40072 + protocol: UDP + - containerPort: 40073 + protocol: UDP + - containerPort: 40074 + protocol: UDP + - containerPort: 40075 + protocol: UDP + - containerPort: 40076 + protocol: UDP + - containerPort: 40077 + protocol: UDP + - containerPort: 40078 + protocol: UDP + - containerPort: 40079 + protocol: UDP + - containerPort: 40080 + protocol: UDP + - containerPort: 40081 + protocol: UDP + - containerPort: 40082 + protocol: UDP + - containerPort: 40083 + protocol: UDP + - containerPort: 40084 + protocol: UDP + - containerPort: 40085 + protocol: UDP + - containerPort: 40086 + protocol: UDP + - containerPort: 40087 + protocol: UDP + - containerPort: 40088 + protocol: UDP + - containerPort: 40089 + protocol: UDP + - containerPort: 40090 + protocol: UDP + - containerPort: 40091 + protocol: UDP + - containerPort: 40092 + protocol: UDP + - containerPort: 40093 + protocol: UDP + - containerPort: 40094 + protocol: UDP + - containerPort: 40095 + protocol: UDP + - containerPort: 40096 + protocol: UDP + - containerPort: 40097 + protocol: UDP + - containerPort: 40098 + protocol: UDP + - containerPort: 22222 + protocol: UDP + # - containerPort: 40099 + # protocol: UDP + # - containerPort: 40100 + # protocol: UDP + resources: {} + restartPolicy: Always diff --git a/kubernetes/rtpengine/rtpengine-service.yaml b/kubernetes/rtpengine/rtpengine-service.yaml new file mode 100644 index 0000000..758372e --- /dev/null +++ b/kubernetes/rtpengine/rtpengine-service.yaml @@ -0,0 +1,418 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: rtpengine + name: rtpengine +spec: + ports: + - name: "40000" + port: 40000 + protocol: UDP + targetPort: 40000 + - name: "40001" + port: 40001 + protocol: UDP + targetPort: 40001 + - name: "40002" + port: 40002 + protocol: UDP + targetPort: 40002 + - name: "40003" + port: 40003 + protocol: UDP + targetPort: 40003 + - name: "40004" + port: 40004 + protocol: UDP + targetPort: 40004 + - name: "40005" + port: 40005 + protocol: UDP + targetPort: 40005 + - name: "40006" + port: 40006 + protocol: UDP + targetPort: 40006 + - name: "40007" + port: 40007 + protocol: UDP + targetPort: 40007 + - name: "40008" + port: 40008 + protocol: UDP + targetPort: 40008 + - name: "40009" + port: 40009 + protocol: UDP + targetPort: 40009 + - name: "40010" + port: 40010 + protocol: UDP + targetPort: 40010 + - name: "40011" + port: 40011 + protocol: UDP + targetPort: 40011 + - name: "40012" + port: 40012 + protocol: UDP + targetPort: 40012 + - name: "40013" + port: 40013 + protocol: UDP + targetPort: 40013 + - name: "40014" + port: 40014 + protocol: UDP + targetPort: 40014 + - name: "40015" + port: 40015 + protocol: UDP + targetPort: 40015 + - name: "40016" + port: 40016 + protocol: UDP + targetPort: 40016 + - name: "40017" + port: 40017 + protocol: UDP + targetPort: 40017 + - name: "40018" + port: 40018 + protocol: UDP + targetPort: 40018 + - name: "40019" + port: 40019 + protocol: UDP + targetPort: 40019 + - name: "40020" + port: 40020 + protocol: UDP + targetPort: 40020 + - name: "40021" + port: 40021 + protocol: UDP + targetPort: 40021 + - name: "40022" + port: 40022 + protocol: UDP + targetPort: 40022 + - name: "40023" + port: 40023 + protocol: UDP + targetPort: 40023 + - name: "40024" + port: 40024 + protocol: UDP + targetPort: 40024 + - name: "40025" + port: 40025 + protocol: UDP + targetPort: 40025 + - name: "40026" + port: 40026 + protocol: UDP + targetPort: 40026 + - name: "40027" + port: 40027 + protocol: UDP + targetPort: 40027 + - name: "40028" + port: 40028 + protocol: UDP + targetPort: 40028 + - name: "40029" + port: 40029 + protocol: UDP + targetPort: 40029 + - name: "40030" + port: 40030 + protocol: UDP + targetPort: 40030 + - name: "40031" + port: 40031 + protocol: UDP + targetPort: 40031 + - name: "40032" + port: 40032 + protocol: UDP + targetPort: 40032 + - name: "40033" + port: 40033 + protocol: UDP + targetPort: 40033 + - name: "40034" + port: 40034 + protocol: UDP + targetPort: 40034 + - name: "40035" + port: 40035 + protocol: UDP + targetPort: 40035 + - name: "40036" + port: 40036 + protocol: UDP + targetPort: 40036 + - name: "40037" + port: 40037 + protocol: UDP + targetPort: 40037 + - name: "40038" + port: 40038 + protocol: UDP + targetPort: 40038 + - name: "40039" + port: 40039 + protocol: UDP + targetPort: 40039 + - name: "40040" + port: 40040 + protocol: UDP + targetPort: 40040 + - name: "40041" + port: 40041 + protocol: UDP + targetPort: 40041 + - name: "40042" + port: 40042 + protocol: UDP + targetPort: 40042 + - name: "40043" + port: 40043 + protocol: UDP + targetPort: 40043 + - name: "40044" + port: 40044 + protocol: UDP + targetPort: 40044 + - name: "40045" + port: 40045 + protocol: UDP + targetPort: 40045 + - name: "40046" + port: 40046 + protocol: UDP + targetPort: 40046 + - name: "40047" + port: 40047 + protocol: UDP + targetPort: 40047 + - name: "40048" + port: 40048 + protocol: UDP + targetPort: 40048 + - name: "40049" + port: 40049 + protocol: UDP + targetPort: 40049 + - name: "40050" + port: 40050 + protocol: UDP + targetPort: 40050 + - name: "40051" + port: 40051 + protocol: UDP + targetPort: 40051 + - name: "40052" + port: 40052 + protocol: UDP + targetPort: 40052 + - name: "40053" + port: 40053 + protocol: UDP + targetPort: 40053 + - name: "40054" + port: 40054 + protocol: UDP + targetPort: 40054 + - name: "40055" + port: 40055 + protocol: UDP + targetPort: 40055 + - name: "40056" + port: 40056 + protocol: UDP + targetPort: 40056 + - name: "40057" + port: 40057 + protocol: UDP + targetPort: 40057 + - name: "40058" + port: 40058 + protocol: UDP + targetPort: 40058 + - name: "40059" + port: 40059 + protocol: UDP + targetPort: 40059 + - name: "40060" + port: 40060 + protocol: UDP + targetPort: 40060 + - name: "40061" + port: 40061 + protocol: UDP + targetPort: 40061 + - name: "40062" + port: 40062 + protocol: UDP + targetPort: 40062 + - name: "40063" + port: 40063 + protocol: UDP + targetPort: 40063 + - name: "40064" + port: 40064 + protocol: UDP + targetPort: 40064 + - name: "40065" + port: 40065 + protocol: UDP + targetPort: 40065 + - name: "40066" + port: 40066 + protocol: UDP + targetPort: 40066 + - name: "40067" + port: 40067 + protocol: UDP + targetPort: 40067 + - name: "40068" + port: 40068 + protocol: UDP + targetPort: 40068 + - name: "40069" + port: 40069 + protocol: UDP + targetPort: 40069 + - name: "40070" + port: 40070 + protocol: UDP + targetPort: 40070 + - name: "40071" + port: 40071 + protocol: UDP + targetPort: 40071 + - name: "40072" + port: 40072 + protocol: UDP + targetPort: 40072 + - name: "40073" + port: 40073 + protocol: UDP + targetPort: 40073 + - name: "40074" + port: 40074 + protocol: UDP + targetPort: 40074 + - name: "40075" + port: 40075 + protocol: UDP + targetPort: 40075 + - name: "40076" + port: 40076 + protocol: UDP + targetPort: 40076 + - name: "40077" + port: 40077 + protocol: UDP + targetPort: 40077 + - name: "40078" + port: 40078 + protocol: UDP + targetPort: 40078 + - name: "40079" + port: 40079 + protocol: UDP + targetPort: 40079 + - name: "40080" + port: 40080 + protocol: UDP + targetPort: 40080 + - name: "40081" + port: 40081 + protocol: UDP + targetPort: 40081 + - name: "40082" + port: 40082 + protocol: UDP + targetPort: 40082 + - name: "40083" + port: 40083 + protocol: UDP + targetPort: 40083 + - name: "40084" + port: 40084 + protocol: UDP + targetPort: 40084 + - name: "40085" + port: 40085 + protocol: UDP + targetPort: 40085 + - name: "40086" + port: 40086 + protocol: UDP + targetPort: 40086 + - name: "40087" + port: 40087 + protocol: UDP + targetPort: 40087 + - name: "40088" + port: 40088 + protocol: UDP + targetPort: 40088 + - name: "40089" + port: 40089 + protocol: UDP + targetPort: 40089 + - name: "40090" + port: 40090 + protocol: UDP + targetPort: 40090 + - name: "40091" + port: 40091 + protocol: UDP + targetPort: 40091 + - name: "40092" + port: 40092 + protocol: UDP + targetPort: 40092 + - name: "40093" + port: 40093 + protocol: UDP + targetPort: 40093 + - name: "40094" + port: 40094 + protocol: UDP + targetPort: 40094 + - name: "40095" + port: 40095 + protocol: UDP + targetPort: 40095 + - name: "40096" + port: 40096 + protocol: UDP + targetPort: 40096 + - name: "40097" + port: 40097 + protocol: UDP + targetPort: 40097 + - name: "40098" + port: 40098 + protocol: UDP + targetPort: 40098 + - name: "22222" + port: 22222 + protocol: UDP + targetPort: 22222 + # - name: "40099" + # port: 40099 + # protocol: UDP + # targetPort: 40099 + # - name: "40100" + # port: 40100 + # protocol: UDP + # targetPort: 40100 + selector: + app: rtpengine diff --git a/kubernetes/sbc-inbound/sbc-inbound-deployment.yaml b/kubernetes/sbc-inbound/sbc-inbound-deployment.yaml new file mode 100644 index 0000000..b6a0415 --- /dev/null +++ b/kubernetes/sbc-inbound/sbc-inbound-deployment.yaml @@ -0,0 +1,50 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: sbc-inbound + name: sbc-inbound +spec: + replicas: 1 + selector: + matchLabels: + app: sbc-inbound + template: + metadata: + labels: + app: sbc-inbound + spec: + containers: + - env: + - name: DRACHTIO_HOST + value: drachtio-sbc + - name: DRACHTIO_PORT + value: "9022" + - name: DRACHTIO_SECRET + value: cymru + - name: ENABLE_METRICS + value: "0" + - name: JAMBONES_CLUSTER_ID + value: jb + - name: JAMBONES_LOGLEVEL + value: info + - name: JAMBONES_MYSQL_DATABASE + value: jambones + - name: JAMBONES_MYSQL_HOST + value: mysql + - name: JAMBONES_MYSQL_PASSWORD + value: jambones + - name: JAMBONES_MYSQL_USER + value: jambones + - name: JAMBONES_REDIS_HOST + value: redis + - name: JAMBONES_REDIS_PORT + value: "6379" + - name: JAMBONES_RTPENGINES + value: rtpengine:22222 + - name: NODE_ENV + value: production + image: jambonz/sbc-inbound:latest + name: sbc-inbound + resources: {} + restartPolicy: Always diff --git a/kubernetes/sbc-outbound/sbc-outbound-deployment.yaml b/kubernetes/sbc-outbound/sbc-outbound-deployment.yaml new file mode 100644 index 0000000..24e3982 --- /dev/null +++ b/kubernetes/sbc-outbound/sbc-outbound-deployment.yaml @@ -0,0 +1,50 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: sbc-outbound + name: sbc-outbound +spec: + replicas: 1 + selector: + matchLabels: + app: sbc-outbound + template: + metadata: + labels: + app: sbc-outbound + spec: + containers: + - env: + - name: DRACHTIO_HOST + value: drachtio-sbc + - name: DRACHTIO_PORT + value: "9022" + - name: DRACHTIO_SECRET + value: cymru + - name: ENABLE_METRICS + value: "0" + - name: JAMBONES_CLUSTER_ID + value: jb + - name: JAMBONES_LOGLEVEL + value: info + - name: JAMBONES_MYSQL_DATABASE + value: jambones + - name: JAMBONES_MYSQL_HOST + value: mysql + - name: JAMBONES_MYSQL_PASSWORD + value: jambones + - name: JAMBONES_MYSQL_USER + value: jambones + - name: JAMBONES_REDIS_HOST + value: redis + - name: JAMBONES_REDIS_PORT + value: "6379" + - name: JAMBONES_RTPENGINES + value: rtpengine:22222 + - name: NODE_ENV + value: production + image: jambonz/sbc-outbound:latest + name: sbc-outbound + resources: {} + restartPolicy: Always diff --git a/kubernetes/webapp/webapp-deployment.yaml b/kubernetes/webapp/webapp-deployment.yaml new file mode 100644 index 0000000..aee03c0 --- /dev/null +++ b/kubernetes/webapp/webapp-deployment.yaml @@ -0,0 +1,28 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: webapp + name: webapp +spec: + replicas: 1 + selector: + matchLabels: + app: webapp + template: + metadata: + labels: + app: webapp + spec: + containers: + - env: + - name: REACT_APP_API_BASE_URL + value: https://api-server/v1 + - name: NODE_OPTIONS + value: '--openssl-legacy-provider' + image: cognigydevelopment.azurecr.io/jambonzwebapp:8473 # {"$imagepolicy": "flux-system:jambonzwebapp"} + name: webapp + ports: + - containerPort: 3001 + resources: {} + restartPolicy: Always \ No newline at end of file diff --git a/kubernetes/webapp/webapp-ingress.yaml b/kubernetes/webapp/webapp-ingress.yaml new file mode 100644 index 0000000..c0ba7da --- /dev/null +++ b/kubernetes/webapp/webapp-ingress.yaml @@ -0,0 +1,15 @@ +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: jambonzwebapp + annotations: + kubernetes.io/ingress.class: traefik +spec: + rules: + - host: webapp + http: + paths: + - path: / + backend: + serviceName: webapp + servicePort: 3001 \ No newline at end of file diff --git a/kubernetes/webapp/webapp-service.yaml b/kubernetes/webapp/webapp-service.yaml new file mode 100644 index 0000000..666ef5b --- /dev/null +++ b/kubernetes/webapp/webapp-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: webapp + name: webapp +spec: + ports: + - name: "webapp" + port: 3001 + targetPort: 3001 + selector: + app: webapp