Coturn Helm Chart to provide a STUN/TURN Server on Kubernetes
  • Go Template 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Owentje 6272921faa
All checks were successful
Release Chart / codeberg (push) Successful in 0s
Release Chart / build-and-push (push) Successful in 4s
Release Chart / harbor (push) Successful in 0s
Release Chart / build-and-push-1 (push) Successful in 4s
Release Chart / forgejo (push) Successful in 0s
Release Chart / build-and-push-2 (push) Successful in 4s
Update to version 10.4.0 and regenerate docs.
2026-11-14 09:52:52 +00:00
.forgejo working to get rid of bitnami mysql in favor of pxc db 2026-09-08 13:42:32 +02:00
charts/coturn Update to version 10.4.0 and regenerate docs. 2026-11-14 09:52:52 +00:00
.gitignore Adds ability to run as daemonset or deployment with hostNetwork set (#197) 2026-05-14 16:00:43 +02:00
.pre-commit-config.yaml switch to official docker image; update github actions to latest version; add some docs and comments 2023-07-24 13:59:35 +02:00
AI_POLICY.md add AI policy and another way to install the chart 2026-11-11 09:49:04 +01:00
CONTRIBUTING.md Update CONTRIBUTING.md - add helm-docs as a requirement 2023-07-29 19:11:25 +02:00
coturn_icon.png update docs and add pvc that I forgot; also add icon for chart 2023-07-27 11:14:20 +02:00
LICENSE Add deprecated 2023-07-26 09:52:01 +02:00
README.md add comment for where you actually install the chart 2026-11-11 09:49:59 +01:00
renovate.json clean up docs and release process 2026-06-16 19:23:12 +02:00

Coturn Helm Chart

An unofficial coturn helm chart using the official coturn docker image.

Note

This repo is mirrored from git.open.engineering to codeberg, where you can submit Issues and Pull Requests.

Usage

TLDR

Note that you still need to fill out the charts/coturn/values.yaml (Autogenerated Docs can be found in charts/coturn/README.md - Note these are not generated using an LLM).

Using git.open.engineering

This method should be a bit faster, but sometimes is down for maintanence

# add the helm repo locally using the forgejo release
helm repo add git.open.engineering https://git.open.engineering/api/packages/oeng/helm
helm repo update

# install the chart
helm install coturn git.open.engineering/coturn-chart

Using codeberg.org

This method is a little slower and puts additional tax on codeberg.org if you're using something like Argo CD.

# add the helm repo locally using the forgejo release
helm repo add codeberg.org https://codeberg.org/api/packages/open-engineering/helm
helm repo update

# install the chart
helm install coturn codeberg.org/coturn-chart

Tip

If you do not need a database, you can set the cnpg.enabled helm parameter to false.

Basics

Coturn Realm

At very least, you'll need to configure a coturn realm which is like your hostname, and is used for authentication as well.

# most coturn config parameters that you really need
coturn:
  # --  hostname for the coturn server realm
  realm: "turn.example.com"

Adding a user declaratively

Pass in one set of credentials (username/password) directly either plaintext, or via an existing k8s secret, like this:

# most coturn config parameters that you really need
coturn:
  # --  hostname for the coturn server realm
  realm: "turn.example.com"

  auth:
    # -- username for the main user of the turn server; ignored if you existingSecret is not ""
    username: "coturn"
    # -- password for the main user of the turn server; ignored if you existingSecret is not ""
    password: "myverysecretpasswordthatimobviouslygoingtochangeright"
    # -- existing secret with keys username/password for coturn; if this is not "" then we will ignore coturn.auth.username/password
    existingSecret: ""
    secretKeys:
      # -- key in existing secret for turn server user
      username: username
      # -- key in existing secret for turn server user's password
      password: password

Currently only one user is supported, but we'd like to support adding more than that to match what is possible in the coturn/coturn:examples/etc/turnserver.conf

Databases

Internal SQLite database

If you would like to use the built-in sqlite database, set externalDatabse.enabled and cnpg.enabled to false in your values.yaml like this:

externalDatabse:
  enabled: false
cnpg:
  enabled: false

Bundled PostgreSQL Cluster Object

We provide optional CNPG Postgresql object to deploy an external database. It requires the Cloud Native PostgreSQL Operator to use. You can use it like this:

externalDatabse:
  enabled: false
cnpg:
  enabled: true

You're free to use any other values you you want for the Cluster object under cnpg in our values.yaml. You can find all values available to you in the CNPG Cluster helm values.

External PostgreSQL database

If externalDatabase.enabled is set to true, and cnpg.enabled is set to false, you can pass in credentials from an existing postgresql database, like this:

externalDatabse:
  enabled: true
  # -- Currently only postgresql is supported. mariadb/mysql coming soon
  type: "postgresql"
  # -- required if externalDatabase.enabled: true and postgresql.enabled: false
  hostname: "mypostgresserver"
  # -- username for database, ignored if existingSecret is passed in
  username: "coturn"
  # -- password for database, ignored if existingSecret is passed in
  password: "coolpasswordfordogs"
  # -- database to create, ignored if existingSecret is passed in
  database: "coturn"
  # -- name of existing Secret to use for postgresql credentials
  existingSecret: ""
  # Names of the keys in existing secret to use for PostgreSQL credentials
  secretKeys:
    # -- key in existing Secret to use for the db user
    username: ""
    # -- key in existing Secret to use for db user's password
    password: ""
    # -- key in existing Secret to use for the database name
    database: ""
    # -- key in existing Secret to use for the db's hostname
    hostname: ""
cnpg:
  enabled: false

Bundled MySQL subchart

We provide an optional PXC DB sub chart for deploying a MySQL cluster (Requires the Percona PXC Operator be pre-installed)

mysql:
  enabled: true

You're free to use any other values you find in the Percona mysql helm values under the mysql parameter in your values.yaml for coturn.

External MySQL database

If externalDatabase.enabled is set to true, and mysql.enabled is set to false, you can pass in credentials from an existing mysql database, like this:

externalDatabse:
  enabled: true
  # -- Currently postgresql and mysql are supported.
  type: "mysql"
  # -- required if externalDatabase.enabled: true and mysql.enabled: false
  hostname: "mysqlserver"
  # -- username for database, ignored if existingSecret is passed in
  username: "coturn"
  # -- password for database, ignored if existingSecret is passed in
  password: "coolpasswordfordogs"
  # -- database to create, ignored if existingSecret is passed in
  database: "coturn"
  # -- name of existing Secret to use for mysql credentials
  existingSecret: ""
  # Names of the keys in existing secret to use for MySQL credentials
  secretKeys:
    # -- key in existing Secret to use for the db user
    username: ""
    # -- key in existing Secret to use for db user's password
    password: ""
    # -- key in existing Secret to use for the database name
    database: ""
    # -- key in existing Secret to use for the db's hostname
    hostname: ""
mysql:
  enabled: false

Testing

Source: Tutorial for turnutils_uclient and Coturn server

  1. Install coturn:

    brew install coturn
    
  2. Test the connection to the server. This is an example for LoadBalancer type services:

    turnutils_uclient -u $COTURN_USER \
      -w $COTURN_PASSWORD \
      -L $CLIENT_IP \
      -y $SERVER_UDP_IP
    

    A Successful test looks like this:

    0: (18446744073709551615): INFO: Total connect time is 0
    1: (18446744073709551615): INFO: start_mclient: msz=4, tot_send_msgs=0, tot_recv_msgs=0, tot_send_bytes ~ 0, tot_recv_bytes ~ 0
    2: (18446744073709551615): INFO: start_mclient: msz=4, tot_send_msgs=0, tot_recv_msgs=0, tot_send_bytes ~ 0, tot_recv_bytes ~ 0
    3: (18446744073709551615): INFO: start_mclient: msz=4, tot_send_msgs=10, tot_recv_msgs=10, tot_send_bytes ~ 1000, tot_recv_bytes ~ 1000
    4: (18446744073709551615): INFO: start_mclient: msz=1, tot_send_msgs=20, tot_recv_msgs=20, tot_send_bytes ~ 2000, tot_recv_bytes ~ 2000
    4: (18446744073709551615): INFO: start_mclient: tot_send_msgs=20, tot_recv_msgs=20
    4: (18446744073709551615): INFO: start_mclient: tot_send_bytes ~ 2000, tot_recv_bytes ~ 2000
    4: (18446744073709551615): INFO: Total transmit time is 4
    4: (18446744073709551615): INFO: Total lost packets 0 (0.000000%), total send dropped 0 (0.000000%)
    4: (18446744073709551615): INFO: Average round trip delay 5.500000 ms; min = 4 ms, max = 13 ms
    4: (18446744073709551615): INFO: Average jitter 1.700000 ms; min = 0 ms, max = 9 ms
    

Status and Contributing

This is actively maintained by both live developers and [renovateBot] via a scheduled Forgejo Action. If you'd like to contribute, please read the CONTRIBUTING.md feel free to open a PR :) If you'd like a feature or want to report a bug, please do that in the Codeberg Issues. If you know coturn and k8s well enough, please also feel free to scan the issues and help others <3

Thanks

This is a fork of the, now deprecated, iits-consulting/coturn chart. Thanks to them for getting this started.