Skip to main content
DeploymentsKubernetes

Prerequisites

Prerequisites for deploying Realtime on Kubernetes

Before you install the Realtime Helm chart, make sure you have:

Requirement
Registry accessCredentials for the Speechmatics image and chart registry
Private registryOptional. Recommended for closed environments
Speechmatics licenseA license stored as a secret on the cluster
GPU driversGPU nodes with the NVIDIA device plugin
Ingress setupGateway API (recommended) or an ingress controller that supports WebSockets
Request IDOptional. Headers for tracing sessions

Access to Docker and Helm registry​

It is important to create and reference resources within the same namespace if you do not have full control of your Kubernetes cluster or if it is a shared cluster

The Speechmatics Docker images and Helm chart are obtained from the speechmaticspublic.azurecr.io registry. If you do not have credentials for the registry account or have lost your details, please reach out to Support for help.

Add a docker-registry secret to the cluster so it can successfully pull Speechmatics docker images.

# Add the speechmatics registry credentials for image pulling
kubectl create secret docker-registry speechmatics-registry \
--docker-server=speechmaticspublic.azurecr.io \
--docker-username=<username> \
--docker-password=<password>

The chart uses the speechmatics-registry secret by default, through the global.imagePullSecrets value.

Using the same credentials, authenticate Helm with the speechmaticspublic registry to install the Helm chart:

# Authenticate to the Speechmatics Helm repository
helm registry login speechmaticspublic.azurecr.io \
--username <username> \
--password <password>

Private registry​

Instead of pulling from speechmaticspublic.azurecr.io, you can mirror the Speechmatics images into a registry you control. We recommend this for closed environments, where the cluster cannot reach external registries, and when you want control over which images are available to the cluster.

Mirror the images under the same repository names and tags, for example my-registry.example.com/rt-asr-transcriber-en:<version>. To list the images your configuration uses, render the chart with your values:

helm template oci://speechmaticspublic.azurecr.io/sm-charts/sm-realtime \
--version 1.5.0 -f values.yaml | grep 'image:' | sort -u

Redis is not published to speechmaticspublic.azurecr.io, so also mirror the Docker Hub redis image under the same name. The command above lists the Redis image and tag with the other images.

Then set global.imageRegistry to your registry. It replaces the registry of every image in the chart, including Redis, and keeps each image's repository and tag:

global:
imageRegistry: my-registry.example.com
# Secret for your registry, or [] if nodes can pull without one
imagePullSecrets:
- name: my-registry

You can also host the Helm chart in your registry:

helm pull oci://speechmaticspublic.azurecr.io/sm-charts/sm-realtime --version 1.5.0
helm push sm-realtime-1.5.0.tgz oci://my-registry.example.com/sm-charts

Speechmatics license​

Please speak to support@speechmatics.com if you do not already have a valid Speechmatics license.

The Helm chart requires you to have a valid Speechmatics license stored in a secret called speechmatics-license, on the Kubernetes cluster.

To create the secret from your license file, for example license.json:

kubectl create secret generic speechmatics-license \
--from-file=license.json=./license.json

Alternatively, the chart can create the secret for you. Set global.licensing.license to the base64-encoded contents of your license file, for example the output of base64 < license.json | tr -d '\n':

global:
licensing:
createSecret: true
license: <base64-encoded license>

GPU drivers​

The Speechmatics inference server runs Nvidia Triton Server, which requires an Nvidia GPU. When running GPU nodes in Kubernetes, you will require the Nvidia device plugin which allows containers on the cluster to access the GPUs.

Refer to the Nvidia driver requirements for the supported driver releases corresponding to different Speechmatics container versions.

Below is a list of the common cloud providers and their recommended way of deploying the Nvidia device plugin on a cluster:

Alternatively, see the Nvidia Device Plugin docs.

You can validate which nodes have allocatable GPU resources with:

kubectl get nodes -o custom-columns='NAME:.metadata.name,GPU:.status.allocatable.nvidia\.com/gpu'

Nodes without GPUs show <none>.

Ingress setup​

The Helm chart exposes proxy-service, the entry point for Realtime sessions, through either Gateway API or a Kubernetes Ingress. Configure one of these. Your gateway or ingress controller must support WebSocket connections.

For new deployments, we recommend Gateway API. It is the successor to Ingress in Kubernetes, and the ingress-nginx controller that the default chart values are written for is retired.

Gateway API (recommended)​

To expose proxy-service with Kubernetes Gateway API, the chart creates an HTTPRoute. You need:

  • Gateway API CRDs (v1 or later) installed on the cluster
  • A gateway controller, for example NGINX Gateway Fabric
  • A Gateway resource. The Helm chart does not create the Gateway, so you must manage it separately

If you are not already running a gateway controller, follow these steps to set up NGINX Gateway Fabric:

  1. Install the Gateway API CRDs:
kubectl kustomize "https://github.com/nginx/nginx-gateway-fabric/config/crd/gateway-api/standard?ref=v2.8.1" | kubectl apply -f -
  1. Create an ngf.values.yaml file:
ngf.values.yaml
nginxGateway:
snippets:
# Needed for the SnippetsPolicy that keeps sessions alive during upgrades
enable: true

nginx:
service:
# This is needed to preserve the source IP of the client
externalTrafficPolicy: Local

pod:
# Used to prevent nginx pods being terminated for 24h while there are active sessions
terminationGracePeriodSeconds: 86400
  1. Install the NGINX Gateway Fabric chart:
helm install ngf oci://ghcr.io/nginx/charts/nginx-gateway-fabric \
--version 2.8.1 \
--create-namespace -n nginx-gateway \
-f ngf.values.yaml
  1. Create a Gateway with an HTTPS listener, and a SnippetsPolicy that lets active sessions finish when nginx reloads or shuts down. The TLS secret must be in the same namespace as the Gateway:
gateway.yaml
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: my-gateway
namespace: nginx-gateway
spec:
gatewayClassName: nginx
listeners:
- name: https
port: 443
protocol: HTTPS
hostname: speechmatics.example.com
tls:
mode: Terminate
certificateRefs:
- kind: Secret
name: tls-secret
allowedRoutes:
namespaces:
from: All
---
apiVersion: gateway.nginx.org/v1alpha1
kind: SnippetsPolicy
metadata:
name: graceful-shutdown
namespace: nginx-gateway
spec:
targetRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: my-gateway
snippets:
# This prevents nginx worker processes from shutting down for 24h in case of active sessions
- context: main
value: worker_shutdown_timeout 86400s;

If you use another gateway controller, set gatewayClassName to its class.

Disable the default Ingress and enable the HTTPRoute. Set parentRefs to the Gateway that serves traffic for the route:

values.yaml
proxy:
ingress:
# Disable the default Ingress
enabled: false

httproute:
enabled: true

# Hostname to match
hostname: speechmatics.example.com

# Gateway that accepts traffic for this route
parentRefs:
- name: my-gateway
namespace: nginx-gateway
sectionName: https

Using a ListenerSet​

Instead of declaring the proxy listener on a shared Gateway, the chart can create a ListenerSet that attaches its own HTTPS listener and TLS configuration to the Gateway. This requires a Gateway API version and gateway controller that support ListenerSet. ListenerSet is in the Gateway API experimental channel, so with the NGINX Gateway Fabric steps above, install the CRDs from experimental instead of standard.

values.yaml
proxy:
ingress:
enabled: false

httproute:
enabled: true
hostname: speechmatics.example.com
parentRefs:
# Attach the route to the ListenerSet created by the chart
- group: gateway.networking.k8s.io
kind: ListenerSet
name: proxy
sectionName: https

listenerset:
enabled: true
parentRef:
group: gateway.networking.k8s.io
kind: Gateway
name: my-gateway
namespace: nginx-gateway
listeners:
https:
port: 443
protocol: HTTPS
hostname: speechmatics.example.com
tls:
mode: Terminate
certificateRefs:
- group: ""
kind: Secret
name: tls-secret
allowedRoutes:
namespaces:
from: Same

TLS secrets referenced by a listener must be in the same namespace as the ListenerSet.

Preventing session loss during gateway upgrades​

Restarting the gateway data plane pods, or reloading their configuration, ends active WebSocket sessions. The NGINX Gateway Fabric steps above handle this. With another gateway controller, configure the data plane to shut down gracefully:

  • Set the nginx worker_shutdown_timeout directive, or the equivalent for your controller
  • Set a preStop lifecycle hook and terminationGracePeriodSeconds on the data plane pods to match your maximum session duration

ingress-nginx​

By default, the Helm chart creates a Kubernetes Ingress for proxy-service that uses ingressClassName: nginx. The default values are written for the ingress-nginx ingress controller.

ingress-nginx is retired. Maintenance ended in March 2026, and the project no longer publishes releases, bug fixes or security patches. Existing installations keep working, but for new deployments we recommend Gateway API.

If you are not already running ingress-nginx, follow these steps:

  1. Create an nginx.values.yaml file:
nginx.values.yaml
controller:
service:
# This is needed to preserve the source IP of the client
# See: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
externalTrafficPolicy: Local

# This should be set to the IP address used to access services on your cluster
loadBalancerIP: $CLUSTER_INGRESS_IP

config:
# This prevents nginx worker process from shutting down for 24h in case of active sessions
worker-shutdown-timeout: 86400s

extraArgs:
# Needed to support annotations added by the chart ingresses
annotations-prefix: nginx.ingress.kubernetes.io

# This prevents nginx main process from shutting down for 24h in case of active sessions
shutdown-grace-period: 86400

# Used to prevent nginx pods being terminated for 24h while there are active sessions
terminationGracePeriodSeconds: 86400
  1. Install the Nginx chart with:
helm repo add nginx https://kubernetes.github.io/ingress-nginx
helm install nginx nginx/ingress-nginx --version 4.15.1 -f nginx.values.yaml

Other ingress controllers​

You can use any ingress controller that supports WebSocket connections. Set proxy.ingress.ingressClassName to the ingress class of your controller:

proxy:
ingress:
ingressClassName: my-ingress-class

The default proxy.ingress.annotations are specific to ingress-nginx, so add any annotations your controller needs. The default proxy.ingress.path is a regular expression, so enable regular expression path matching on your controller, or set a path that your controller supports.

Sessions do not require any additional request headers. To add a request ID for session tracking, see Request ID.

Request ID​

Each session is tagged with a request ID, which appears in the proxy-service logs and helps you trace a session across components:

  • If the incoming request has an X-Request-Id header, proxy-service uses it
  • Otherwise, proxy-service generates a random request ID

Request ID headers are optional. To correlate sessions with your ingress or gateway logs, configure the controller to set X-Request-Id on the request. To let clients see the ID, for example to quote it when reporting an issue with a session, configure the controller to return it in a Request-Id response header.

Set and return the request ID with filters on the HTTPRoute:

values.yaml
proxy:
httproute:
filters:
# Pass the gateway-generated request ID to proxy-service
- type: RequestHeaderModifier
requestHeaderModifier:
set:
- name: X-Request-Id
value: $request_id
# Return the request ID in the response, so the client can see it
- type: ResponseHeaderModifier
responseHeaderModifier:
add:
- name: Request-Id
value: $request_id

The $request_id variable is specific to NGINX Gateway Fabric. For other gateway controllers, refer to the controller's documentation.