coturn

by jaconi

Helm chartv1.0.5App 4.10.0-r1MITVerified publisher

Coturn TURN server

About this chart

coturn

Helm chart for coturn TURN and STUN server.

Testing

Install the coturn Helm chart with --allow-loopback-peers and --no-auth.

Emulate a peer by running turnutils_peer:

turnutils_peer -L 127.0.0.1

Port forward coturn:

kubectl port-forward --namespace coturn services/coturn 3478:3478

Emulate a client by running turnutils_uclient:

turnutils_uclient -t -e 127.0.0.1 -X 127.0.0.1

Parameters

coturn Parameters

The parameters in this section map to coturn server command line flags. For example: fingerprint: true is equivalent to --fingerprint. Any options that are not exposed by the chart directly, can be set using extraOptions.

NameDescriptionValue
fingerprintUse fingerprints in the TURN messages.false
lt-cred-mechUse long-term credential mechanism.false
realmThe default realm to be used for users.example.com
certCertificate file in PEM format.nil
pkeyPrivate key file in PEM format.nil
extraOptionsAdditional command line flags (for example, --verbose).[]
usersUsers for the long-term credential mechanism.[]
users[0].nameUsername for the long-term credential mechanism.
users[0].secretKeyRef.nameName of the secret with the users password.
users[0].secretKeyRef.keyName of the key with the users password.

cert-manager Parameters

When using cert-manager, a Certificate resource can be created by this chart:

certificate:
  enabled: true
  dnsName: coturn.example.com
  issuerName: letsencrypt

The resulting TLS certificate and private key will be passed to coturn via the --cert and --pkey flags. The settings cert and pkey will be ignored.

NameDescriptionValue
certificate.enabledfalse
certificate.dnsNamecoturn.example.com
certificate.issuerNameletsencrypt

Traefik Parameters

When using Traefik, a IngressRouteTCP and a IngressRouteUDP resource can be created by this chart:

traefik:
  enabled: true
  entryPoints:
    tcp: tcp
    tcp-tls: tcp-tls
    udp: udp
    udp-tls: udp-tls

When using the official Traefik Helm chart, the following (or similar) configuration is needed for Traefik:

ports:
  tcp:
    port: 3478
    nodePort: 30478
    expose: true
    exposedPort: 3478
    protocol: TCP
  tcp-tls:
    port: 5349
    nodePort: 30349
    expose: true
    exposedPort: 5349
    protocol: TCP
  udp:
    port: 3478
    nodePort: 30478
    expose: true
    exposedPort: 3478
    protocol: UDP
  udp-tls:
    port: 5349
    nodePort: 30349
    expose: true
    exposedPort: 5349
    protocol: UDP
NameDescriptionValue
traefik.enabledfalse
traefik.entryPoints.tcptcp
traefik.entryPoints.tcp-tlstcp-tls
traefik.entryPoints.udpudp
traefik.entryPoints.udp-tlsudp-tls

Common Parameters

NameDescriptionValue
replicaCount2
image.repositorycoturn/coturn
image.pullPolicyAlways
image.tagOverrides the image tag whose default is the chart appVersion.""
imagePullSecrets[]
nameOverride""
fullnameOverride""
serviceAccount.createSpecifies whether a service account should be created.true
serviceAccount.annotationsAnnotations to add to the service account.{}
serviceAccount.nameThe name of the service account to use. If not set and create is true, a""
deploymentAnnotationsAnnotations to add to the deployment.{}
podAnnotationsAnnotations to add to the pod(s).{}
defaultLabelsDefines default labels for all created resources.{}
podSecurityContext{}
securityContext.allowPrivilegeEscalationfalse
securityContext.capabilities.add["NET_BIND_SERVICE"]
securityContext.capabilities.drop["ALL"]
securityContext.readOnlyRootFilesystemtrue
securityContext.runAsNonRoottrue
securityContext.runAsUser65534
service.annotationsAnnotations to add to the service.{}
service.externalTrafficPolicyAnnotations to add to the service.nil
service.typeClusterIP
service.ports.plain3478
service.ports.tls5349
resources.limits.cpu100m
resources.limits.memory50Mi
resources.requests.cpu100m
resources.requests.memory50Mi
nodeSelector{}
tolerations[]
affinity{}

This section is generated using metadata from values.yaml!

Deploy coturn with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has coturn on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcoturn is pinned at v1.0.5 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply