Skip to main content

All-in-one Helm chart

The spanway-helm chart (helm/spanway-helm in the release) deploys the classic proxy image, registry.spanway.ai/spanway/spanway-ai, as a single Deployment. The Admin UI, the management API and the LLM data plane all run in that one container on port 4000. The chart can also stand up a Postgres and a Redis for you through Bitnami subcharts, run the schema migration as a Job, expose the gateway through an Ingress, scale it with an HPA or KEDA, and run the Admin Assistant for Slack as a second workload. The release pipeline publishes it to oci://registry.spanway.ai/spanway/charts/spanway-helm with the chart's appVersion set to the gateway version it was built with.

Use this chart when one process per pod is enough. The componentised chart splits the gateway into separately scaled services, and the deployment overview compares both.

A real-world scenario​

A team running a small Kubernetes cluster wants the gateway in one namespace with its own Postgres for a trial, and later wants to point it at their managed database without reinstalling. They install the all-in-one chart with the bundled database, then switch db.useExisting on before going live.

Steps​

  1. Install the chart as shown in Install.

  2. Read the generated master key.

    kubectl -n spanway get secret spanway-masterkey -o jsonpath='{.data.masterkey}' | base64 -d
  3. Forward the port and check the gateway.

    kubectl -n spanway port-forward svc/spanway 4000:4000
    curl http://localhost:4000/health/readiness
  4. Open http://localhost:4000/ui and sign in as admin with the master key.

  5. Before production, set db.useExisting: true with your database values and run helm upgrade with the same release name.

Expected result​

The migration Job completes, the Deployment's pods are ready, /health/readiness reports the database as connected, and the Admin UI opens.

Install​

helm install spanway oci://registry.spanway.ai/spanway/charts/spanway-helm \
--namespace spanway --create-namespace \
--set masterkey=sk-change-me \
--set postgresql.auth.password=choose-a-password \
--set postgresql.auth.postgres-password=choose-a-password

With the defaults this creates a Postgres (db.deployStandalone: true), runs the migration Job, renders a config with a placeholder model list, and exposes the gateway as a ClusterIP Service on port 4000. The chart names its resources after the release: when the release name already contains spanway, as spanway does here, the Service is called spanway, and for any other release name, for example gateway, it is called gateway-spanway. Leave masterkey out and the chart generates an sk-... key on first install, stores it in a Secret named after the Service with -masterkey added (spanway-masterkey for this install, gateway-spanway-masterkey for a release called gateway) under the key masterkey, and reuses it on every upgrade.

kubectl -n spanway get secret spanway-masterkey -o jsonpath='{.data.masterkey}' | base64 -d

Master key​

The master key is the admin password of the whole gateway, so keep it out of Helm. A value passed with --set masterkey=... is stored in Helm's release history, where anyone who can read Secrets in the namespace can recover it, even after you change it. The recommended install creates the key in a Secret first and points the chart at it.

kubectl -n spanway create secret generic spanway-master-key --from-literal=master-key="sk-$(openssl rand -hex 24)"
helm install spanway oci://registry.spanway.ai/spanway/charts/spanway-helm --namespace spanway \
--set masterkeySecretName=spanway-master-key --set masterkeySecretKey=master-key \
--set postgresql.auth.password=choose-a-password \
--set postgresql.auth.postgres-password=choose-a-password
ValueDefaultWhat it does
masterkeyunsetThe master key as plain text. Convenient for a test install, but it lands in Helm's release history. Leave it unset and the chart generates one
masterkeySecretName""The name of a Secret you created that holds the master key. When set, the chart creates no master key Secret of its own and reads the key from yours on every pod and the migration Job. Use this in production
masterkeySecretKey"", meaning masterkeyThe key inside that Secret

If the named Secret does not exist, the pods and the migration Job stop in CreateContainerConfigError, and kubectl -n spanway describe pod <pod> says which Secret is missing.

The values that matter​

Image and replicas​

ValueDefaultWhat it does
image.repositoryregistry.spanway.ai/spanway/spanway-aiThe proxy image. The same image runs the migration Job, the optional collector sidecar and the Admin Assistant worker
image.tag""Empty means the chart's appVersion
image.pullPolicyAlways
imagePullSecrets[]Registry credentials for every container the chart runs, the helm test pods included
testImages.connection, testImages.kubectlbusybox and bitnamilegacy/kubectl, pinned by digestThe images the helm test pods run. Point them at your own registry in an air-gapped install
serviceAccount.create, serviceAccount.automount, serviceAccount.annotations, serviceAccount.namefalse, true, {}, ""Create a ServiceAccount for the gateway pods, for example to carry an IRSA or Workload Identity annotation. With create: false the pods use name, or the namespace default
deploymentAnnotations, deploymentLabels, podAnnotations, podLabels{}Extra metadata on the Deployment and its pods, for example for a service mesh
command, args{}Replace the container command or arguments. Leave both empty unless support asks you to change them
terminationGracePeriodSeconds90How long Kubernetes waits for a stopping pod to finish its open requests before killing it
lifecycle{}Container lifecycle hooks. The recommended preStop hook calls /health/drain with the X-Drain-Token header so the pod stops taking new requests before it shuts down, see health checks
livenessProbe, readinessProbe, startupProbe/health/liveliness every 15 seconds, /health/readiness every 10 seconds, and /health/readiness with 30 tries at startupEach takes path, initialDelaySeconds, periodSeconds, timeoutSeconds, successThreshold and failureThreshold. Raise the startup failureThreshold when a large config takes longer than five minutes to load
extraResources[]Extra Kubernetes objects rendered with the release, for example a NetworkPolicy of your own
replicaCount1Ignored once autoscaling.enabled or keda.enabled is on
numWorkersunsetAdds --num_workers to the container args
resources{}Unset so the chart installs on small clusters. Plan on 1 CPU and 4Gi per worker in production
logLevelINFORendered as SPANWAY_LOG. Set to "" if a Secret or ConfigMap supplies it instead
envVars{}Extra environment as a map
extraEnvVars{}Extra environment as a list of Kubernetes env entries
environmentSecrets[]Secret names loaded with envFrom, for provider keys referenced as os.environ/NAME in the config
environmentConfigMaps[]ConfigMap names loaded the same way

Proxy config​

ValueDefaultWhat it does
proxyConfigMap.createtrueRender proxy_config into a ConfigMap mounted at /etc/spanway/config.yaml
proxyConfigMap.name""When create is false, the existing ConfigMap to mount
proxyConfigMap.keyconfig.yamlKey inside that ConfigMap
proxy_configa placeholder model_list and general_settings.master_key: os.environ/PROXY_MASTER_KEYThe gateway config, in the same shape as a config file

The container starts with --config /etc/spanway/config.yaml, so anything you can put in a config file goes under proxy_config. The master key reaches the pod as PROXY_MASTER_KEY, which is why the default config references it that way. Because the config is a read-only ConfigMap, models added from the Admin UI are not written back to it. Set STORE_MODEL_IN_DB: "True" in envVars if you want models managed from the UI and stored in the database.

Database​

ValueDefaultWhat it does
db.deployStandalonetrueInstall the bundled Bitnami postgresql subchart
db.useExistingfalsePoint at a Postgres you run. Set deployStandalone to false at the same time
db.endpointlocalhostHost of the existing database
db.databasespanwayDatabase name
db.urlpostgresql://$(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_HOST)/$(DATABASE_NAME)Connection URL template. The $(...) references expand from the env vars the chart sets
db.secret.namepostgresSecret holding the credentials
db.secret.usernameKey, db.secret.passwordKeyusername, passwordKeys inside that Secret
db.secret.endpointKey""Read DATABASE_HOST from the Secret instead of db.endpoint
db.readReplicaUrl""Route read-only queries to a reader endpoint. Prefer db.secret.readReplicaUrlKey when the URL embeds credentials
db.secret.readReplicaUrlKey, db.secret.readReplicaEndpointKey""Source the reader URL, or just the reader host, from the Secret
db.connectionPool.enabledfalseRun PgBouncer inside the container so a pod holds at most maxDbConnections upstream connections however many workers it runs
db.connectionPool.maxDbConnections, db.connectionPool.maxClientConn20, 1000Pool sizing. 20 suits four workers
postgresql.auth.username, postgresql.auth.databasespanway, spanwayBundled database credentials
postgresql.auth.password, postgresql.auth.postgres-passwordNoTaGrEaTpAsSwOrDOverride both on install
postgresql.image.repository, postgresql.image.tagbitnamilegacy/postgresql, 16.2.0-debian-12-r6Pinned archived build. The chart refuses to render an empty or latest tag because a newer major cannot read the existing data directory

A Secret for db.useExisting needs the username and password keys (or whatever usernameKey and passwordKey name). The bundled Postgres is single-node, has no backups by default, and its image no longer receives updates, so move to db.useExisting before production.

Redis​

ValueDefaultWhat it does
redis.enabledfalseInstall the bundled Bitnami redis subchart and wire REDIS_HOST, REDIS_PORT and REDIS_PASSWORD into the pod
redis.coordination.enabledtrueAlso render a general_settings.coordination_redis block, so cross-pod rate limits, spend tracking and the pod lock manager use it. A block you write in proxy_config wins
redis.architecturestandaloneSubchart topology. With redis.sentinel.enabled the coordination block uses sentinel_nodes and service_name
redis.image.*, redis.sentinel.image.*, redis.metrics.image.*bitnamilegacy/... pinned tagsSame archived-build pinning as Postgres

To use a Redis you already run, keep redis.enabled false and provide REDIS_HOST, REDIS_PORT and REDIS_PASSWORD (or REDIS_URL) through environmentSecrets. Response caching is separate from coordination and stays off until you set cache: true under spanway_settings in proxy_config. When coordination Redis is configured but cannot be reached, requests that carry a rate limit or a budget get a 503 instead of being admitted, see when Redis is unreachable.

Ingress and service​

ValueDefaultWhat it does
service.type, service.portClusterIP, 4000The Service and the container port
service.loadBalancerClassunsetOnly read when the type is LoadBalancer
ingress.enabledfalseRender an Ingress
ingress.classNamenginx
ingress.hostsone rule for api.example.local with path /Standard host and path rules
ingress.tls, ingress.annotations, ingress.labels[], {}, {}

Migrations Job​

ValueDefaultWhat it does
migrationJob.enabledtrueRender the Job
migrationJob.hooks.argocd.enabledtrueAnnotate it as an Argo CD PreSync hook, deleted before each new hook run
migrationJob.hooks.helm.enabledfalseAnnotate it as a Helm pre-install,pre-upgrade hook with migrationJob.hooks.helm.weight (default "1")
migrationJob.backoffLimit4
migrationJob.activeDeadlineSeconds1800Wall-clock budget for the whole Job. Set to null for no limit
migrationJob.ttlSecondsAfterFinished120
migrationJob.command, migrationJob.args[]Override spanway-container migrate
migrationJob.serviceAccountName""Only relevant with the Helm hook and serviceAccount.create, since the hook runs before the chart's own ServiceAccount exists
migrationJob.resources, migrationJob.extraContainers, migrationJob.extraInitContainers{}, [], []
migrationJob.annotations, migrationJob.jobLabels, migrationJob.jobAnnotations, migrationJob.podLabels{}

The Job runs from the proxy image with the same database environment as the gateway and DISABLE_SCHEMA_UPDATE=false, so it always applies the migration even when the pods are configured to skip it. With the Argo CD hook on and the Helm hook off, a plain helm install creates the Job as an ordinary resource alongside the Deployment, which is fine because the proxy also checks the schema at startup. Turn the Helm hook on when you want helm upgrade to block until the migration has finished.

Scaling and availability​

autoscaling.enabled renders an HPA with minReplicas (1), maxReplicas (100) and targetCPUUtilizationPercentage (60), with optional per-pod targetRequestsPerSecond and targetTokensPerSecond targets served by a Prometheus Adapter. keda.enabled renders a KEDA ScaledObject instead, with keda.triggers plus first-class keda.prometheus.requestsPerSecond and keda.prometheus.tokensPerSecond targets. The two are mutually exclusive. pdb.enabled with pdb.minAvailable or pdb.maxUnavailable adds a PodDisruptionBudget, and topologySpreadConstraints, nodeSelector, tolerations and affinity pass through to the pod spec.

metricsServer.enabled serves /metrics from a separate port (metricsServer.port, default 4001) with its own Service named after the gateway Service with -metrics added (spanway-metrics for this install, gateway-spanway-metrics for a release called gateway), and serviceMonitor.enabled renders a Prometheus Operator ServiceMonitor that scrapes it. collector.enabled adds a sidecar running spanway-container collector that takes the spend pipeline off the request path, configured through collector.address, collector.bufferSize, collector.onUnavailable and collector.drainTimeoutSeconds. collector.resources sizes the sidecar on its own, because the spend pipeline is CPU bound.

collector.scaleOnProxyContainerCpu (default false) decides what CPU the autoscaler looks at when both autoscaling.enabled and the collector are on. Turned on, the HPA reads only the proxy container's CPU, so a busy collector never adds inference replicas you do not need. Turned off, the HPA reads the whole pod, sidecar included, which works on every Kubernetes version. Turn it on when your cluster runs Kubernetes 1.30 or newer (or 1.27 to 1.29 with the HPAContainerMetrics feature gate), which is the default the componentised chart uses.

keda.pollingInterval (30 seconds) is how often KEDA checks its triggers and keda.cooldownPeriod (300 seconds) how long it waits before scaling down. keda.prometheus.serverAddress is the Prometheus URL KEDA queries, required as soon as keda.prometheus.requestsPerSecond or keda.prometheus.tokensPerSecond is set. serviceMonitor.interval (15s), serviceMonitor.scrapeTimeout (10s), serviceMonitor.labels and serviceMonitor.annotations tune the ServiceMonitor, for example the label your Prometheus selects on.

Enterprise license​

Enterprise features, such as the workflow workers below, read the license key from SPANWAY_LICENSE. Store the key in a Secret and name it, and the chart sets SPANWAY_LICENSE from it on the proxy pods, their collector sidecar and the workflow workers. 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-helm -n spanway \
--set license.secretName=spanway-license

license.secretKey (default license) is the key inside the Secret. The license key stays in the Secret and never appears in the rendered manifests or in Helm's release history.

Workflow workers​

workflowWorker.enabled: true adds a Deployment of the same image started with --workflow_worker, which runs workflow runner steps, and makes the proxy pods producers that accept runs but never execute them. It needs a license with the workflow_runner and workflow_queue_workers features. The worker pods carry their own name label, so the proxy Service never selects them, and serve /metrics without virtual-key auth on workflowWorker.metricsPort (4003). workflowWorker.drainSeconds (90) sets GRACEFUL_SHUTDOWN_TIMEOUT and a grace period of drainSeconds + 30. A PodDisruptionBudget and a NetworkPolicy that denies every ingress except the metrics port from workflowWorker.networkPolicy.metricsFrom come with it. workflowWorker.networkPolicy.enabled (default true) turns that NetworkPolicy off, which you only need when your cluster has no NetworkPolicy support or manages policies elsewhere.

workflowWorker.hpa.enabled: true replaces the fixed replicaCount with a HorizontalPodAutoscaler between minReplicas (2) and maxReplicas (20). It scales on spanway_workflow_runner_backlog_per_worker first, with targetBacklogPerWorker (4) ready steps per worker served to the HPA by a Prometheus Adapter, and on CPU second with targetCPUUtilizationPercentage (70). Set either target to an empty string to leave it out.

Lens​

lensWorker.mode connects the gateway to Lens for agent tracing. bundled deploys the Lens worker and a ClickHouse next to the gateway from the lens chart dependency, external points at a Lens you already run and disabled leaves it off. The Lens on Kubernetes page covers the lensWorker.* values. 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​

Enterprise deployments that meter billable requests set billingMetrics.enabled: true and create a TLS Secret named by billingMetrics.secretName (default spanway-billing-metrics-mtls) holding the client certificate. billingMetrics.endpoint defaults to the production collector and billingMetrics.caSecretName is only for a private collector. billingMetrics.exportIntervalMs sets how often the counter is pushed, and empty means every 60000 milliseconds.

The Admin Assistant toggle​

The chart can run the Admin Assistant for Slack as a dedicated worker next to the gateway. Set adminAssistant.enabled: true and the chart renders a Deployment named after the gateway Service with -admin-assistant added (spanway-admin-assistant for this install, gateway-spanway-admin-assistant for a release called gateway) from the same proxy image, started with the --admin-agent argument, plus a ClusterIP Service on port 10000 and a PersistentVolumeClaim for the worker's SQLite state.

ValueDefaultWhat it does
adminAssistant.enabledfalseRender the worker, its Service and PVC
adminAssistant.existingSecret""Required. A Secret loaded into the worker with envFrom. It must contain ADMIN_AGENT_SERVICE_TOKEN, CREDENTIAL_ENCRYPTION_KEY, SLACK_BOT_TOKEN, SLACK_APP_TOKEN and SLACK_WORKSPACE_ID
adminAssistant.gatewayUrl""Required. The public HTTPS URL of the gateway, passed to the worker as SPANWAY_BASE_URL and to the gateway as PROXY_BASE_URL
adminAssistant.model""Required. A gateway model with tool calling, passed as SPANWAY_MODEL
adminAssistant.readOnlyfalseSets ADMIN_READ_ONLY on the worker
adminAssistant.storageSize, adminAssistant.storageClassName1Gi, ""The state PVC
adminAssistant.resources100m CPU and 256Mi requested, 1Gi memory limit

The worker runs with CONNECTION_AUTH_MODE=native, so Slack users sign in through the gateway's own login rather than a separate agent domain. The gateway pod receives SPANWAY_ADMIN_AGENT_URL=http://spanway-admin-assistant:10000 (with the Service name of your release) and ADMIN_AGENT_SERVICE_TOKEN from the same Secret, which is how it hands a user's session to the worker over the cluster network. The worker's Service is not exposed by the Ingress and should stay that way.

Upgrading​

helm upgrade keeps the generated master key, re-runs the migration Job according to the hook you enabled, and rolls the Deployment. Pin image.tag and the Bitnami image tags explicitly in your values file rather than relying on the chart defaults, so an upgrade of the chart never changes a database major version underneath you. Run helm test spanway -n spanway after an install or upgrade. Its test pod calls /health/readiness on the gateway Service and passes once the gateway answers, and with serviceMonitor.enabled a second pod checks that the ServiceMonitor scrapes the right port and path.

Errors​

What you seeWhat it meansFix
The migration Job failsThe database is unreachable or the user cannot create tables.Find the Job with kubectl -n spanway get jobs and read kubectl -n spanway logs job/<job name>, which names the cause.
Pods stay 0/1 readyThe readiness probe fails, usually the database.Check /health/readiness through a port-forward and the pod log.
Pods stay in CreateContainerConfigErrorA Secret the pod reads does not exist, usually the one named by masterkeySecretName or license.secretName.kubectl -n spanway describe pod <pod> names the missing Secret. Create it, or fix the name.
helm upgrade changes the database major versionThe Bitnami image tag was left to the chart default.Pin the image tags in your values file.
Licensed features stay offThe license Secret is missing or has another key name.Create it as in Enterprise license.

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
adminAssistant.existingSecret is required, adminAssistant.gatewayUrl is required or adminAssistant.model is requiredThe Admin Assistant is on but a required value is empty.Set the value named, see The Admin Assistant toggle.
keda.prometheus.serverAddress is required when keda.prometheus.requestsPerSecond or tokensPerSecond is setA Prometheus target was set without the Prometheus to ask.Set keda.prometheus.serverAddress, or remove the target.
metricsServer.port must differ from service.portThe metrics server would listen on the gateway's own port.Pick another metricsServer.port, for example the default 4001.
postgresql.image.tag must be pinned to an explicit version when db.deployStandalone is true ...The bundled database image tag is latest or empty, which could start a different PostgreSQL major version on your existing data.Set postgresql.image.tag to an exact version.
workflowWorker.terminationGracePeriodSeconds (...) must be at least workflowWorker.drainSeconds + 10 (...)Kubernetes would kill a draining worker before it hands its steps back.Raise the grace period, or lower workflowWorker.drainSeconds.
workflowWorker.hpa needs targetBacklogPerWorker or targetCPUUtilizationPercentageThe worker autoscaler has nothing to scale on.Set at least one of the two targets.
billingMetrics.endpoint is required when billingMetrics.enabled is true or billingMetrics.secretName is required ...Billing metrics are on without the collector address or the client certificate Secret.Set both values.
lensWorker.mode must be bundled, external or disabledAn unknown Lens mode.Use one of the three.
lensWorker.externalUrl is required for external Lens, lensWorker.publicUrl is required for external Lens, lensWorker.serviceTokenSecret.name is required for external Lens or lensWorker.gateway.secretName is required for external LensExternal Lens mode is missing a value it needs.Set the value named, see Lens on Kubernetes.
lensWorker.publicUrl is required when there is no single ingress hostname, lensWorker.ingress.host is required or ingress.hosts[0].host is requiredBundled Lens cannot work out the public address browsers use to reach it.Set lensWorker.publicUrl, or give the Ingress one host.

Logs​

Read the logs with kubectl. Each workload names its own problems.

CommandWhat a healthy start looks likeWhat to look for
kubectl -n spanway logs deploy/spanwaySpanway: Proxy initialized with Config, Set models: followed by your model names, then the server listening on port 4000ERROR lines about the database, Redis or the config file. SPANWAY_LOG (the logLevel value) controls how much is printed
kubectl -n spanway logs job/<migration job name>The migration lines, then Running 'prisma generate'..., and the Job shows Complete in kubectl get jobsThe database error and a Job that shows Failed. A 'prisma generate' exited ... WARNING alone is harmless, the image already carries the client
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
kubectl -n spanway logs deploy/spanway-admin-assistantThe worker connects to Slack and to the gateway at adminAssistant.gatewayUrlErrors about the Slack tokens or ADMIN_AGENT_SERVICE_TOKEN in adminAssistant.existingSecret

For a release with another name, replace spanway in the Deployment names with the Service name the chart gave your release.