Installation guide · Kubernetes

The Helm chart, on the cluster you run.

The chart installs each component as a Deployment with its own Service, plus PostgreSQL with pgvector and Redis as subcharts that you can turn off. Chart version 0.2.64 runs the v0.2.64 images.

§ 01

Prerequisites

  • Kubernetes 1.27 or later with x86-64 (amd64) nodes, and Helm 3.13 or later.
  • A default storage class for the volumes of the bundled PostgreSQL and Redis (and for uploads with local storage).
  • An ingress controller. The chart’s default annotations are for ingress-nginx; with another controller, set the same timeouts, body size and buffering yourself.
  • cert-manager and a ClusterIssuer for automatic certificates, or an existing TLS Secret.
  • Object storage: an S3-compatible store (the chart does not install MinIO), Azure Blob Storage, or a volume.
  • The Microsoft Entra ID app registration described in What you prepare, and a DNS name for the ingress.
  • Outbound access from the cluster to ghcr.io, Docker Hub, your model endpoint, Microsoft Entra ID and https://api.mislata.eu (see Network access).

§ 02

Install the chart

The chart is public at oci://ghcr.io/victorzkov/charts/mislata-ai; no registry login is needed. The chart version has no v (0.2.64); image.tag empty means v<chart version>, so the chart version picks the matching images.

bash
helm show values oci://ghcr.io/victorzkov/charts/mislata-ai --version 0.2.64 > values-reference.yaml
cosign verify ghcr.io/victorzkov/charts/mislata-ai:0.2.64 \
  --certificate-identity-regexp '^https://github\.com/victorZKov/(ai-portal|mislata-ai)/\.github/workflows/release-selfhosted\.yml@refs/tags/v.*$' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

Write my-values.yaml. This is the smallest file that gives a working install with HTTPS, the bundled PostgreSQL and Redis, and files on a volume:

my-values.yaml
ingress:
  enabled: true
  className: nginx
  host: ai.example.com
  tls:
    enabled: true
    clusterIssuer: letsencrypt-prod   # or secretName of an existing TLS Secret
app:
  baseUrl: https://ai.example.com
  frontendUrl: https://ai.example.com
externalAuth:
  portalBaseUrl: https://ai.example.com
redis:
  auth:
    enabled: true          # new installs: Redis with a generated password
storage:
  provider: Local          # files on a volume; document export needs MinIO or azure
persistence:
  enabled: true
bash
helm install mislata-ai oci://ghcr.io/victorzkov/charts/mislata-ai --version 0.2.64 \
  -n mislata-ai --create-namespace -f my-values.yaml
kubectl -n mislata-ai get pods -w

Secrets you leave empty are generated on the first install and kept on every upgrade: the PostgreSQL and Redis passwords, the SearXNG secret, the guest sign-in signing key and the setup bootstrap token. On the first install the API applies the database migrations itself when it starts; the migrations Job runs only on upgrades.

With storage.provider: Local the document export worker is not deployed, so exports are not available. With more than one node, the uploads volume needs a ReadWriteMany storage class for more than one API pod, or use object storage.

A fuller example with an S3 store is published as values.example.yaml. Replace its __HOST__ and __STORAGE_*__ placeholders. Its setup.existingSecret reads the bootstrap token from a Secret you create first (kubectl -n mislata-ai create secret generic mislata-ai-bootstrap --from-literal=Setup__BootstrapToken=$(openssl rand -hex 32)); remove the setup block to let the chart generate the token.

§ 03

Get the bootstrap token

The chart passes one token to every pod. The install notes print the command; for the release name mislata-ai:

bash
kubectl -n mislata-ai get secret mislata-ai-secrets \
  -o jsonpath='{.data.Setup__BootstrapToken}' | base64 -d; echo

The Secret is called <release>-mislata-ai-secrets, shortened to mislata-ai-secrets when the release is called mislata-ai. With setup.existingSecret, read your own Secret instead. Set setup.bootstrapToken to choose the value. Open https://ai.example.com/setup and continue with the setup wizard.

§ 04

Ingress

Path on `ingress.host`ServicePort
/apiAPI (<release>-webapi)8080
/hubs (SignalR)API8080
/v1 (public REST API)API8080
/mcp (MCP server)API8080
/Frontend80

The default annotations set a 600-second read and send timeout, HTTP/1.1, no proxy buffering (chat answers stream), a 60 MB body limit and an HTTPS redirect. ingress.apiHost adds a second host that sends every path to the API. ingress.tls.skipTlsBlock: true leaves out the TLS block when TLS ends before the ingress. Annotations you add in ingress.annotations are merged with the defaults; set a default to null to remove it.

§ 05

Values reference

The most used values. helm show values prints all of them with comments.

ValueDefaultPurpose
image.registry, image.tagghcr.io/victorzkov, emptyRegistry of the four images (set it to your mirror) and their tag. Empty tag = v<chart version>.
image.pullSecrets[]Pull secrets for a private mirror.
app.baseUrl, app.frontendUrlemptyPublic address. Used for OAuth callbacks, webhooks, CORS and links in emails. Required.
app.regionempty (EU)US shows month/day/year dates in English.
externalAuth.signingKey, externalAuth.portalBaseUrlgenerated, emptyGuest sign-in links.
setup.bootstrapToken, setup.existingSecret, setup.existingSecretKeygeneratedSetup wizard token.
storage.providerMinIOMinIO (any S3-compatible store), azure or Local.
storage.endpoint, bucketName, exportBucketName, useSsl, accessKey, secretKeyempty, mislata-uploads, mislata-exports, trueS3-compatible store. The buckets must exist.
storage.azure.accountUrl, storage.azure.existingSecretemptyAzure Blob with a workload identity, or a Secret with key connection-string.
persistence.enabled, size, accessMode, keepOnDeletefalse, 50Gi, ReadWriteOnce, trueUploads volume for Local storage.
postgresql.enabled, postgresql.auth.username, postgresql.auth.databasetrue, aiportal, aiportalBundled PostgreSQL (20 GiB volume).
externalPostgresql.*—Your PostgreSQL, see External services.
redis.enabled, redis.auth.enabledtrue, falseBundled Redis. Set auth.enabled: true on a new install.
externalRedis.*—Your Redis.
email.smtp.host, port, enableSsl, username, password, email.fromEmail, email.fromNameempty, 587, true, …Outgoing email. 587 and 25 use STARTTLS, 465 implicit TLS.
graphApi.tenantId, clientId, clientSecretemptyMicrosoft Graph app for the Microsoft 365 connectors.
identity.provider, identity.entraId.tenantId, identity.entraId.clientIdemptyPre-configure Microsoft Entra ID (entraid). Empty: the setup wizard configures it.
license.renewalUrl, license.installToken, license.existingSecretemptyAutomatic licence renewal.
webapi.extraEnv, webapi.extraSecretEnv, webapi.envFromemptyAny other API setting, as environment variables (Section__Key).
webapi.worker.enabled, webapi.replicaCount, webapi.autoscaling.*false, 1Worker split and API scaling, see Scaling.
searxng.enabled, documentGenerator.enabled, documentExport.enabledtrueTurn components off.
backup.*offPostgreSQL backup CronJob, see Backups.
networkPolicy.enabledfalseDefault-deny NetworkPolicies; needs a policy engine.
serviceAccount.annotations, podLabels, keyVault.*emptyWorkload identity and Azure Key Vault, see Azure.
migrations.enabledtruePre-upgrade migrations Job.

§ 06

External services

PostgreSQL

Any PostgreSQL 16 or later with the vector extension. Create the extension before the first start, give the user ownership of the database (migrations run as this user), and connect directly or through a session-mode pooler. The SQL for Azure Database for PostgreSQL Flexible Server is on the Azure page.

bash
kubectl -n mislata-ai create secret generic mislata-db --from-literal=password='<password>'
yaml
postgresql:
  enabled: false
externalPostgresql:
  host: mypg.postgres.database.azure.com
  port: 5432
  database: mislata
  username: mislata
  existingSecret: mislata-db        # key "password"; or password: "..."
  sslMode: require                  # disable | allow | prefer | require | verify-ca | verify-full
  trustServerCertificate: true
  extraOptions: "Maximum Pool Size=50"

Instead, externalPostgresql.connectionStringSecret.name can name a Secret with complete connection strings: key connection-string (Npgsql format, read by the API) and key database-url (postgresql://… with the password URL-encoded, read by the document generator). The backup job still uses host, username, database and the password.

Redis

yaml
redis:
  enabled: false
externalRedis:
  host: myredis.redis.cache.windows.net
  port: 6380                     # Azure Cache for Redis TLS port
  ssl: true
  existingSecret: mislata-redis  # or password: "..."
  existingSecretPasswordKey: redis-password

The password must not contain , or =. Without a password the chart sets none, and a Redis that requires one answers NOAUTH. Keep Redis for more than one API replica: it carries the SignalR messages between pods.

Object storage

S3-compatible store (buckets must exist)
storage:
  provider: MinIO
  endpoint: s3.eu-west-1.amazonaws.com   # host[:port], no scheme
  useSsl: true
  bucketName: mislata-uploads
  exportBucketName: mislata-exports
  accessKey: "<access key>"
  secretKey: "<secret key>"
bash
kubectl -n mislata-ai create secret generic mislata-azure-storage \
  --from-literal=connection-string='DefaultEndpointsProtocol=https;AccountName=<account>;AccountKey=<key>;EndpointSuffix=core.windows.net'
Azure Blob Storage
storage:
  provider: azure
  azure:
    existingSecret: mislata-azure-storage    # key connection-string
    # or, with workload identity (role Storage Blob Data Contributor):
    # accountUrl: https://<account>.blob.core.windows.net
    containerName: mislata-documents
    exportsContainerName: mislata-exports

The Azure containers are created on first use. To move existing files from S3 to Azure, run dotnet AiPortal.WebApi.dll --migrate-storage --dry-run, then without --dry-run, once in an API pod that has both the Azure settings and the old MinIOStorage__* credentials.

§ 07

Scaling the API and the workers

By default one API Deployment runs the HTTP API, SignalR and every background worker. For many users, move the workers into their own Deployment; the API pods can then scale.

yaml
webapi:
  worker:
    enabled: true          # adds <release>-webapi-worker with App__Role=worker
    replicaCount: 1
  replicaCount: 3          # API pods (App__Role=api)
  # or an HPA (needs metrics-server; replicaCount is then ignored):
  # autoscaling:
  #   enabled: true
  #   minReplicas: 2
  #   maxReplicas: 6
  #   targetCPUUtilizationPercentage: 70
  • Document indexing uses a queue in PostgreSQL; periodic jobs take a PostgreSQL advisory lock, so more than one worker replica is safe.
  • Keep Redis on: notifications raised by a worker reach browsers through the SignalR Redis backplane.
  • Known limit with more than one API replica: the document editor’s editing lock is kept per pod.

§ 08

Backups

The chart can run pg_dump -Fc of the whole database on a schedule and upload it to Azure Blob Storage or an S3 bucket, deleting uploads older than retentionDays. The dump includes the DataProtectionKeys table, which must be restored with the data.

bash
kubectl -n mislata-ai create secret generic mislata-backup \
  --from-literal=AZURE_STORAGE_CONNECTION_STRING='<connection string>'
# S3: --from-literal=AWS_ACCESS_KEY_ID=... --from-literal=AWS_SECRET_ACCESS_KEY=...
yaml
backup:
  enabled: true
  schedule: "0 2 * * *"     # UTC
  retentionDays: 14
  existingSecret: mislata-backup
  target: azure             # or s3
  azure:
    container: pgbackups
  # s3: { bucket: my-bucket, region: eu-west-1, endpointUrl: "" }
  preUpgrade: true          # also dump before every helm upgrade; a failed dump stops the upgrade
Run it once and read the logs
kubectl -n mislata-ai create job --from=cronjob/mislata-ai-backup backup-test
kubectl -n mislata-ai logs job/backup-test -c dump
kubectl -n mislata-ai logs job/backup-test -c upload

A one-off dump of the bundled PostgreSQL (default user and database aiportal):

bash
PGPASS=$(kubectl -n mislata-ai get secret mislata-ai-postgresql -o jsonpath='{.data.password}' | base64 -d)
kubectl -n mislata-ai exec mislata-ai-postgresql-0 -- env PGPASSWORD="$PGPASS" \
  pg_dump -h 127.0.0.1 -U aiportal -d aiportal -Fc > mislata-$(date +%F).dump

To restore: scale the Deployments to zero (kubectl -n mislata-ai scale deploy -l app.kubernetes.io/instance=mislata-ai --replicas=0), restore the dump with pg_restore --no-owner --exit-on-error into an empty database that has the vector extension, then run helm upgrade again to restore the replica counts. Back up object storage with your provider’s versioning or replication, and keep your values file and Secrets.

§ 09

Upgrade and rollback

bash
helm upgrade mislata-ai oci://ghcr.io/victorzkov/charts/mislata-ai --version <new chart version> \
  -n mislata-ai -f my-values.yaml
kubectl -n mislata-ai get jobs
kubectl -n mislata-ai logs job/mislata-ai-migrations

Before the new pods start, a pre-upgrade Job applies the database migrations (and, with backup.preUpgrade, a dump runs first). If the Job fails, the upgrade stops and the previous pods keep serving.

bash
helm history mislata-ai -n mislata-ai
helm rollback mislata-ai <revision> -n mislata-ai

Uninstall with helm uninstall mislata-ai -n mislata-ai. The volumes of the bundled PostgreSQL and Redis, and the uploads volume with persistence.keepOnDelete, are kept; delete them with kubectl -n mislata-ai delete pvc -l app.kubernetes.io/instance=mislata-ai.

§ 10

Troubleshooting

SymptomLikely cause
Migrations Job in ErrorWrong PostgreSQL password, or the vector extension is missing on an external database.
API CrashLoopBackOff with MinIOStorage 4xxstorage.accessKey or storage.secretKey empty, or the bucket does not exist.
Uploads and exports fail, install notes warn about storagestorage.provider is MinIO (the default) but storage.endpoint is empty.
Word or PowerPoint export stays “processing”The document-export pod is not running (documentExport.enabled=false, storage.provider=Local, or the image is missing from a mirror).
Ingress 404 on /apiingress.className does not match the installed controller.
Sign-in returns to the portal again and againhttps://<host>/callback is not a redirect URI of the app registration, or identity.* does not match it.
Bundled PostgreSQL: “could not create lock file”postgresql.primary.containerSecurityContext.readOnlyRootFilesystem must stay false.
Install fails with “known default”postgresql.auth.password or searxng.secret is set to an old default value; leave them empty.
Worker pod answers 404Expected: a worker serves only /api/health and /api/version.