-
Notifications
You must be signed in to change notification settings - Fork 2
Turn Server #12
base: master
Are you sure you want to change the base?
Turn Server #12
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ARG coturn_version=4.5.0.6-r3 | ||
| FROM ananace:coturn:${coturn_version} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| data: | ||
| # see https://github.com/matrix-org/synapse/blob/master/docs/turn-howto.md#configuration | ||
| turnserver.conf: | | ||
| no-tcp-relay | ||
|
|
||
| denied-peer-ip=10.0.0.0-10.255.255.255 | ||
| denied-peer-ip=192.168.0.0-192.168.255.255 | ||
| denied-peer-ip=172.16.0.0-172.31.255.255 | ||
|
nikhiljha marked this conversation as resolved.
|
||
|
|
||
| allowed-peer-ip=$INTERNAL_IP | ||
|
|
||
| user-quota=12 | ||
| total-quota=1200 | ||
| kind: ConfigMap | ||
| metadata: | ||
| labels: | ||
| app: coturn | ||
| name: coturn-config | ||
| namespace: matrix | ||
|
nikhiljha marked this conversation as resolved.
Outdated
|
||
| --- | ||
| apiVersion: v1 | ||
| data: | ||
|
nikhiljha marked this conversation as resolved.
Outdated
|
||
| # `pwgen -s 64 1 | base64 -w0` to generate | ||
| # identical to secret in homeserver.yaml | ||
| auth-secret: U2pKbFNwRjU4d016TW9FM0piVzFxZUFXVTk1Nzhta0JlbzgxSGxwMk9jNFpsbnRZVVI0MXR4VkJpcVJ2a1I1RQo= | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. obviously we need to move these out of here before merging. homeserver.yaml will probably be moved to use ocf/utils#146, here we can just use a standard templated secret (like https://github.com/ocf/grafana/blob/c5e6a1c9c429dc1c0e962cb90842b01b94b5a887/kubernetes/grafana.yml.erb#L107) |
||
| kind: Secret | ||
| metadata: | ||
| labels: | ||
| app: coturn | ||
| name: coturn-secret | ||
| namespace: matrix | ||
| type: Opaque | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| labels: | ||
| app: coturn | ||
| name: coturn | ||
| namespace: matrix | ||
| spec: | ||
| externalTrafficPolicy: Cluster | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure this does anything outside of AWS |
||
| ports: | ||
| # UDP only, do we need TCP? | ||
| - name: udp-port | ||
| port: 3487 | ||
| protocol: UDP | ||
| targetPort: 3487 | ||
| selector: | ||
| app: coturn | ||
| type: LoadBalancer | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think |
||
| --- | ||
| apiVersion: extensions/v1beta1 | ||
| kind: Deployment | ||
| metadata: | ||
| labels: | ||
| app: coturn | ||
| name: coturn | ||
| namespace: matrix | ||
| spec: | ||
| replicas: 1 | ||
| selector: | ||
| matchLabels: | ||
| app: coturn | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: coturn | ||
| spec: | ||
| containers: | ||
| - env: | ||
| - name: INTERNAL_IP | ||
| valueFrom: | ||
| fieldRef: | ||
| apiVersion: v1 | ||
| fieldPath: status.hostIP | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like we would want the kubernetes pod IP, not the host IP (aka the IP of the worker). that would be |
||
| - name: EXTERNAL_IP | ||
| value: 1.2.3.4 # TODO: How to get? | ||
|
nikhiljha marked this conversation as resolved.
Outdated
|
||
| - name: AUTH_SECRET | ||
| valueFrom: | ||
| secretKeyRef: | ||
| key: auth-secret | ||
| name: coturn-secret | ||
| - name: PORT | ||
| value: "3487" | ||
| - name: REALM | ||
| value: turn.ocf.berkeley.edu | ||
| image: "docker.ocf.berkeley.edu/coturn:<%= coturn_version %>" | ||
| name: coturn | ||
| readinessProbe: | ||
| tcpSocket: | ||
| port: 9090 | ||
| volumeMounts: | ||
| - mountPath: /etc/coturn/turnserver.conf | ||
| name: coturn-config | ||
| subPath: turnserver.conf | ||
| restartPolicy: Always | ||
| volumes: | ||
| - configMap: | ||
| defaultMode: 420 | ||
|
nikhiljha marked this conversation as resolved.
|
||
| name: coturn-config | ||
| name: coturn-config | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo we should build this into the container, like I mentioned in #11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... it's not fully static because it needs the
INTERNAL_IPvariable. I'll need to look into why it needs that in the first place.