Skip to main content

Componentised Helm chart

The spanway chart (helm/spanway in the release) deploys the gateway as three Deployments instead of one. gateway runs the LLM data plane from the spanway-gateway image on port 4000, backend runs the management API and the Admin UI backend from spanway-backend on port 4001, and ui serves the static Admin UI from spanway-ui on port 3000. A Job built from the spanway-migrations image applies the schema before either Python service rolls out. The chart brings no database and no Redis. It expects a master key Secret and a writer Postgres you already run. It refuses to render without the database host and name, and when the master key Secret it names does not exist, the migration Job and the pods stop in CreateContainerConfigError until you create it.

The all-in-one chart is the one-process alternative. The images page describes what each of the four images runs.

A real-world scenario​

A company runs AI traffic for hundreds of services, and a slow Admin UI query must never stall inference. They install the componentised chart, which runs the data-plane gateway, the management backend and the UI as separate Deployments, so the gateway scales from 1 to 10 replicas on request load while the backend autoscales separately between 1 and 4.

Steps​

  1. Create the master key and database Secrets as shown in Minimum install.

  2. Install the published chart.

    helm install spanway oci://registry.spanway.ai/spanway/charts/spanway --namespace spanway \
    --set database.writer.host=postgres.internal --set database.writer.dbname=spanway
  3. Check that the migration Job finished and the three Deployments are ready.

    kubectl -n spanway get jobs,deployments
  4. Turn on the Ingress with ingress.enabled=true and your host, then check the gateway and open the Admin UI at https://<host>/ui.

    curl https://<host>/health/readiness

Expected result​

The pre-install migration Job completes before the gateway, backend and UI Deployments start, /health/readiness reports the database as connected, and the Admin UI signs in with the master key.

Minimum install​

kubectl -n spanway create secret generic spanway-master-key-secret \
--from-literal=master-key=sk-change-me
kubectl -n spanway create secret generic spanway-writer-secret \
--from-literal=username=spanway --from-literal=password=choose-a-password

helm install spanway oci://registry.spanway.ai/spanway/charts/spanway --version 2.0.0 --namespace spanway \
--set database.writer.host=postgres.internal \
--set database.writer.dbname=spanway

The published chart already contains the Lens chart. The two Secret names above are the chart defaults (masterKey.secretName and database.writer.passwordSecret.name). database.writer.host and database.writer.dbname are the only values with no default. On install the migration Job runs as a Helm pre-install hook, then the three Deployments and their Services come up. helm upgrade runs the Job again as a pre-upgrade hook, so new pods never serve against an unmigrated schema.

Gateway, backend and UI​

Each component has the same block of values. The table lists them once with the gateway defaults, and the backend and UI columns show where their defaults differ.

ValueGatewayBackendUI
<component>.enabledtruetruetrue
<component>.image.repositoryregistry.spanway.ai/spanway/spanway-gatewayregistry.spanway.ai/spanway/spanway-backendregistry.spanway.ai/spanway/spanway-ui
<component>.image.tag"" (the chart appVersion)samesame
<component>.service.port400040013000
<component>.resources1 CPU and 4Gi requested, 2 CPU and 4Gi limitsame500m and 500Mi requested, 1 CPU and 1Gi limit
<component>.hpa.enabledtrue, 1 to 10 replicas at 70% CPU and 80% memorytrue, 1 to 4 replicas at 70% CPUfalse
<component>.replicaCountunset, only used when the HPA is offsamesame
<component>.logLevelINFO, rendered as SPANWAY_LOGsamesame
<component>.extraEnv, envConfigMaps, envSecrets[][][]
<component>.volumes, volumeMounts, extraContainers, lifecycle[], [], [], {}samesame
<component>.pdb, strategy, startupProbe, podSecurityContext, securityContext, topologySpreadConstraintsoff or emptysamesame
<component>.livenessProbe/health/liveliness every 15 seconds, 6 failures allowedsame/ every 20 seconds
<component>.readinessProbe/health/readiness every 10 secondssame/ every 10 seconds
<component>.image.pullPolicyIfNotPresentsamesame

Values that exist on only one component:

ValueDefaultWhat it does
gateway.numWorkers1Uvicorn workers per gateway pod, passed to the image as NUM_WORKERS
gateway.config.createtrueRender gateway.config.proxy_config into a ConfigMap mounted as the proxy config and referenced by CONFIG_FILE_PATH
gateway.config.proxy_config{}The gateway config in the same shape as a config file
gateway.metricsServer.enabledfalseA metrics sidecar running spanway-container metrics-server on gateway.metricsServer.port (4001) with its own <gateway>-metrics Service
gateway.serviceMonitor.enabledfalseA Prometheus Operator ServiceMonitor for that Service
gateway.hpa.targetRequestsPerSecond, gateway.hpa.targetTokensPerSecond""Per-pod workload targets served by a Prometheus Adapter
ui.backendUrl""The externally reachable backend URL the dashboard calls

Collector sidecar​

gateway.collector.enabled adds a second container to every gateway pod that runs spanway-container collector from the gateway image. The uvicorn workers hand each finished request's spend event to it over gateway.collector.address (a Unix socket on a shared emptyDir by default, or tcp://127.0.0.1:<port>) and go back to serving. gateway.collector.bufferSize is how many events a worker queues while the sidecar is busy, gateway.collector.onUnavailable chooses between fallback (run the pipeline in the worker, spend stays exact) and drop, and gateway.collector.drainTimeoutSeconds bounds the shutdown drain. The sidecar has its own gateway.collector.resources, and gateway.collector.scaleOnGatewayContainerCpu (default true) makes the HPA read only the gateway container's CPU so the sidecar never drives replica count.

Database​

ValueDefaultWhat it does
database.writer.host, database.writer.port, database.writer.dbname, database.writer.schema"", 5432, "", ""Writer connection. Host and dbname are required
database.writer.passwordSecret.name, usernameKey, passwordKeyspanway-writer-secret, username, passwordSecret holding the writer credentials
database.writer.useIAMAuthfalseSets IAM_TOKEN_DB_AUTH=true and omits the password, so the proxy mints a URL from an IAM token at startup
database.writer.useAzureEntraAuthfalseThe same for Azure Database for PostgreSQL with an Entra ID token. Mutually exclusive with useIAMAuth
database.writer.sslMode, database.writer.sslRootCert""libpq sslmode and CA path applied to the writer and reader URLs. Setting only sslRootCert implies verify-full
database.reader.*same shape, host emptySetting database.reader.host routes read-only queries to a replica
database.connectionPool.enabledfalsePgBouncer in the gateway container, with maxDbConnections (20) and maxClientConn (1000). The backend and the migration Job keep direct connections

Redis​

ValueDefaultWhat it does
redis.host, redis.port"", 6379Empty host disables Redis. When set, the chart emits REDIS_HOST, REDIS_PORT and REDIS_PASSWORD for coordination (cross-pod rate limits, spend tracking, the pod lock manager)
redis.passwordSecret.name, redis.passwordSecret.passwordKey"", passwordLeave the name empty for an unauthenticated Redis
redis.clusterfalseEmit REDIS_CLUSTER_NODES instead, with host as the seed node

Response caching is independent and stays off until spanway_settings.cache is set in gateway.config.proxy_config. A general_settings.coordination_redis block there overrides the env vars.

Ingress​

The chart knows which paths belong to which component, so one Ingress fronts all three.

ValueDefaultWhat it does
ingress.enabledfalseRender the Ingress
ingress.controlleralbalb renders Exact and Prefix paths plus the /*.txt wildcard the UI needs. nginx renders dotted paths as ImplementationSpecific because the ingress-nginx admission webhook rejects dots in Exact and Prefix paths
ingress.className, ingress.host, ingress.annotations, ingress.tls"", "", {}, []Standard fields
ingress.extraPaths[]Additional entries of path, service (gateway, backend or ui) and pathType, placed after the built-in rules and before the backend catch-all. Repeating a built-in path fails the render

Data-plane prefixes go to the gateway, /, /ui, /_next/*, /spanway-asset-prefix/* and /favicon.ico go to the UI, /lens-ingest goes to the Lens worker when Lens is bundled (or external with lensWorker.externalServiceName set), and everything else goes to the backend. Do not repeat any of these paths in ingress.extraPaths, because the chart refuses a duplicate. The gateway prefix list is a snapshot of the data-plane surface at chart release time, so use ingress.extraPaths for a pass-through route it does not know about.

Migrations Job​

ValueDefaultWhat it does
migrationJob.enabledtrueRender the Job
migrationJob.image.repository, migrationJob.image.tag, migrationJob.image.pullPolicyregistry.spanway.ai/spanway/spanway-migrations, "", IfNotPresentThe slim migrations image
migrationJob.hooks.helm.enabled, migrationJob.hooks.helm.weighttrue, "0"Run as a Helm pre-install,pre-upgrade hook
migrationJob.hooks.argocd.enabledfalseRun as an Argo CD PreSync hook instead, which re-runs on every sync
migrationJob.backoffLimit, migrationJob.activeDeadlineSeconds, migrationJob.ttlSecondsAfterFinished4, 1800, 120A migration that exhausts its retries fails the release rather than hanging it
migrationJob.serviceAccountName""Set when the Job needs its own identity, for example the IRSA or Workload Identity annotations that database.writer.useIAMAuth relies on
migrationJob.automountServiceAccountTokenfalse
migrationJob.extraEnv[]Append USE_V2_MIGRATION_RESOLVER=false to fall back to the v1 resolver
migrationJob.resources, podSecurityContext, securityContext, podLabels, volumes, volumeMounts, nodeSelector, tolerations, affinityemptyThe Job does not inherit scheduling from the other components

The image's entrypoint runs prisma migrate deploy against the writer with the v2 resolver and builds the request-log indexes afterwards, exiting non-zero if an index could not be built so that the hook retries. It reads the same DATABASE_* values as the gateway, plus SPANWAY_MASTER_KEY from the master key Secret and SPANWAY_LICENSE when license.secretName is set, so both Secrets must exist before the Job can start.

Workflow workers​

workflowWorker.enabled: true adds a Deployment that runs workflow runner steps and sets SPANWAY_WORKFLOW_RUNNER_ROLE=producer on the gateway and backend, so they accept runs but never execute steps. It needs a license with the workflow_runner and workflow_queue_workers features. The workers use the gateway image unless workflowWorker.image names another, run the image's spanway-container worker role on workflowWorker.port (4002), read the same proxy config as the gateway and get no Service, so nothing can route traffic to them. Their service account token is not mounted.

workflowWorker.drainSeconds (90) is how long a stopping worker keeps running its steps before handing the rest back to the queue. It becomes GRACEFUL_SHUTDOWN_TIMEOUT, and the pod's grace period is drainSeconds + 30 unless workflowWorker.terminationGracePeriodSeconds is set, which must then be at least drainSeconds + 10 or the chart refuses to render. Steps per worker come from general_settings.workflow_runner.max_concurrent_steps_per_pod in the proxy config.

A metrics sidecar serves the workers' Prometheus samples on workflowWorker.metricsPort (4003) without virtual-key auth, and workflowWorker.podMonitor.enabled scrapes it through a Prometheus Operator PodMonitor. workflowWorker.hpa.enabled renders an HPA whose main target is targetBacklogPerWorker (4) on the spanway_workflow_runner_backlog_per_worker Pods metric, served by a Prometheus Adapter, with targetCPUUtilizationPercentage (70) next to it and a 300 second scale down window so a short dip does not kill workers mid step. A PodDisruptionBudget with maxUnavailable: 1 is on by default.

workflowWorker.networkPolicy.enabled is on by default and denies every ingress to worker pods. List your scrapers as NetworkPolicy peers in workflowWorker.networkPolicy.metricsFrom to let them reach the metrics port.

Enterprise license​

Enterprise features, such as the workflow workers above, read the license key from SPANWAY_LICENSE. Store the key in a Secret and set license.secretName, and the chart sets SPANWAY_LICENSE from it on the gateway, backend, workflow worker and migration pods. license.secretKey (default license) is the key inside the Secret. A free install leaves license.secretName empty and gets no SPANWAY_LICENSE.

kubectl -n spanway create secret generic spanway-license --from-literal=license='<license key>'
helm upgrade --install spanway oci://registry.spanway.ai/spanway/charts/spanway -n spanway -f values.yaml \
--set license.secretName=spanway-license

The license key stays in the Secret and never appears in the rendered manifests or in Helm's release history.

Marketplace mode​

Marketplace mode is groundwork for the planned cloud marketplace listings. No listing is available yet, so leave marketplace.provider empty and license the chart with license.secretName today. Once the planned AWS listing ships, marketplace.provider set to aws will make the gateway, backend and workflow worker pods read their license features from the AWS Marketplace entitlement instead of SPANWAY_LICENSE. license.secretName must be empty in this mode, or the chart refuses to render. marketplace.serviceAccountAnnotations is added to the gateway and backend ServiceAccounts for the IRSA role, and the chart then needs serviceAccounts.gateway.create and serviceAccounts.backend.create set to true. AWS Marketplace (planned) covers the IAM role, the contract, usage and hourly pricing and the marketplace.aws.* values. marketplace.aws.metering.enabled sends hourly usage records for a usage listing. It is off by default, stays off until the listing is live, and the chart only accepts it together with marketplace.aws.pricing=usage and gateway.numWorkers: 1. azure and gcp are accepted but their listings are planned too, so either of them turns every licensed feature off. aws grants features only when a real AWS Marketplace entitlement verifies at startup, which cannot happen until the listing exists, so in practice every licensed feature is off with any provider set today.

Service accounts and the master key​

serviceAccounts.gateway, serviceAccounts.backend and serviceAccounts.ui each take create, automount, annotations and name. The UI defaults to automount: false because nginx has no reason to hold a cluster token. masterKey.secretName (default spanway-master-key-secret) and masterKey.secretKey (default master-key) name the Secret the gateway and backend read the proxy master key from.

Lens​

The chart declares the Lens chart as a dependency and controls it through lensWorker.mode, exactly as the all-in-one chart does. bundled installs the Lens worker and a ClickHouse, external connects to a Lens you already run, and disabled turns it off. The lensWorker.* values are documented on the Lens on Kubernetes page. The Lens worker image defaults to the appVersion of the bundled Lens chart, which every release sets to the release version, so a chart always pulls the Lens image built by the same release and that tag never moves to a newer build. Set lensWorker.image.tag or lensWorker.image.digest to pin a different build.

Billing metrics​

billingMetrics.enabled, billingMetrics.endpoint, billingMetrics.secretName, billingMetrics.caSecretName and billingMetrics.exportIntervalMs (empty means every 60000 milliseconds) behave as in the all-in-one chart. Both the gateway and the backend export the counter, because the backend serves the named-server MCP transport.

Errors​

What you seeWhat it meansFix
Error: execution error at (...): database.writer.host is requiredThe writer database is not set.Set database.writer.host and database.writer.dbname.
The migration Job and the pods stay in CreateContainerConfigErrorThe master key Secret (masterKey.secretName, default spanway-master-key-secret), the writer password Secret or the license Secret does not exist. helm install waits on the hook until it times out.kubectl -n spanway describe pod <pod> names the missing Secret. Create it and the Job starts.
helm install hangs on the hookThe migration Job cannot reach the database.Find the Job with kubectl -n spanway get jobs and read its log with kubectl -n spanway logs job/<job name>.
A pass-through route answers 404 through the IngressThe route is not in the chart's gateway prefix list.Add it with ingress.extraPaths.
ingress-nginx rejects the IngressDotted paths in Exact or Prefix rules.Set ingress.controller: nginx.
Every licensed feature is off with marketplace.provider setazure and gcp always turn them off, and aws found no verified AWS Marketplace entitlement, which no listing can provide yet.Leave marketplace.provider empty and use a license Secret.

Render errors​

The chart checks your values before Kubernetes sees anything, and helm install, helm upgrade or helm template stops with Error: execution error at (...): <message>. Nothing is created or changed.

MessageWhat it meansFix
masterKey.secretName is required (the chart no longer accepts an inline master key)masterKey.secretName was set to an empty string.Name the Secret that holds the master key.
database.writer.host is required, database.writer.dbname is required or database.writer.passwordSecret.name is requiredThe writer connection is incomplete.Set the value named.
database.writer.useIAMAuth and database.writer.useAzureEntraAuth are mutually exclusive ...Two token sources were turned on for the database password.Keep one of them.
database.reader.useIAMAuth requires database.writer.useIAMAuth: true ... or the same for useAzureEntraAuthThe reader asks for token auth that only the writer can turn on.Turn it on for the writer too, or off for the reader.
database.reader.dbname is required when database.reader.host is set or database.reader.passwordSecret.name is required when database.reader.host is setA read replica was named without its database or credentials.Set the value named.
database.connectionPool.maxDbConnections is required when the pool is enabled or ... maxClientConn ...The connection pool is on without its limits.Set both limits, or keep the defaults.
<component>.podLabels cannot set <key>: it is part of the Deployment's immutable selectorA pod label would change which pods a Deployment owns.Use another label name.
ingress.controller: unknown controller "<name>", expected one of alb, nginxAn unknown Ingress controller.Use alb or nginx.
ingress.extraPaths[<n>]: ...An extra path has no path, names an unknown service or pathType, or repeats a path the chart already routes.Fix that entry, the message says which rule it broke.
gateway.serviceMonitor.enabled requires gateway.metricsServer.enabled ...The ServiceMonitor would scrape a port that needs a key.Turn on gateway.metricsServer.enabled.
gateway.metricsServer.port must differ from the gateway port 4000The metrics server would listen on the gateway's own port.Pick another port, for example the default 4001.
workflowWorker.terminationGracePeriodSeconds (...) must be at least workflowWorker.drainSeconds + 10 (...) or workflowWorker.hpa needs targetBacklogPerWorker or targetCPUUtilizationPercentageThe workflow worker settings cannot work together.Raise the grace period, or set an autoscaling target.
marketplace.provider must be aws, azure or gcp ..., license.secretName must be empty when marketplace.provider is set ..., marketplace.aws.pricing must be hourly, contract or usage ..., marketplace.aws.productCode is required ..., marketplace.aws.productSku is required ..., marketplace.aws.pricing=usage needs marketplace.aws.metering.enabled=true ..., marketplace.aws.metering.enabled needs marketplace.aws.pricing=usage ..., marketplace.aws.pricing=usage needs gateway.numWorkers=1 ... or marketplace.serviceAccountAnnotations needs serviceAccounts.gateway.create and serviceAccounts.backend.create set to trueMarketplace mode is set up inconsistently.Leave marketplace.provider empty until a listing exists, see Marketplace mode.
billingMetrics.endpoint is required ..., billingMetrics.secretName is required ... or a lensWorker.* messageThe same checks as the all-in-one chart.Set the value named.

Logs​

CommandWhat a healthy start looks likeWhat to look for
kubectl -n spanway logs job/<migration job name>The migrations apply, then the request-log indexes are built and the Job exits 0A database error, or an index that could not be built, which makes the hook retry
kubectl -n spanway logs deploy/spanway-gatewaySpanway: Proxy initialized with Config, Set models: followed by your model namesERROR lines about the database, Redis or the config. <component>.logLevel controls how much is printed
kubectl -n spanway logs deploy/spanway-backendThe backend starts on port 4001Database and sign-in errors
kubectl -n spanway logs deploy/spanway-workflow-workerThe worker starts and reports its metrics portErrors claiming or finishing steps, usually the database or a missing license feature

The Deployment names follow the chart's naming for your release, kubectl -n spanway get deployments lists them.