Skip to main content
Version: 2.0

Installing on Kubernetes with Helm

The Milvaion Helm chart installs the API (which also serves the dashboard) and, if you want them, the built-in workers. It is published to GitHub Container Registry as oci://ghcr.io/milvasoft/charts/milvaion, and its source is in deploy/helm/milvaion.

You need Kubernetes 1.25 or later and Helm 3.8 or later.

What gets installed​

ResourceNotes
API Deployment and ServiceStartup, liveness and readiness probes on /api/v1/healthcheck/*. Runs as a non-root user with a read-only root filesystem.
ConfigMap and SecretYour appsettings overrides, and the JWT key, API key secret and root password.
PodDisruptionBudgetOnly when more than one API pod can run.
HorizontalPodAutoscalerOptional.
IngressOptional, with TLS.
ServiceAccountWithout a mounted token: Milvaion never calls the Kubernetes API.
Worker DeploymentsOptional: HTTP, SQL, Email, Command, Maintenance and AI workers.
PostgreSQL, RabbitMQ, RedisOptional single-pod StatefulSets for evaluation. Off by default.

Try it out​

This installs everything in one namespace, including small PostgreSQL, RabbitMQ and Redis pods:

helm install milvaion oci://ghcr.io/milvasoft/charts/milvaion \
--namespace milvaion --create-namespace \
--set postgresql.enabled=true \
--set rabbitmq.enabled=true \
--set redis.enabled=true \
--set workers.http.enabled=true

Open the dashboard through a port-forward:

kubectl -n milvaion port-forward svc/milvaion-api 5000:80

Then go to http://localhost:5000 and sign in as rootuser. The chart generated the password; read it with:

kubectl -n milvaion get secret milvaion -o jsonpath="{.data.root-password}" | base64 -d

Check the installation at any time with helm test milvaion -n milvaion.

warning

The bundled PostgreSQL, RabbitMQ and Redis have no replication, failover or backups. Use them to evaluate Milvaion. In production, use managed services or operators (for example CloudNativePG and the RabbitMQ Cluster Operator) and the external* settings below.

PostgreSQL only​

With transport: postgres and coordination: postgres the release needs nothing but PostgreSQL: the queue and the shared state are tables of the application database, and the built-in workers connect to the API's worker gateway over HTTP.

transport: postgres
coordination: postgres
externalDatabase:
host: postgres.internal
existingSecret: milvaion-external

The workers need an API key with the WorkerGateway.Connect permission, which can only be created in the dashboard. Install without workers, sign in, create the key, store it in a Secret and upgrade:

kubectl -n milvaion create secret generic milvaion-gateway --from-literal=worker-gateway-api-key='...'
helm upgrade milvaion oci://ghcr.io/milvasoft/charts/milvaion -n milvaion --reuse-values \
--set workerGateway.existingSecret=milvaion-gateway \
--set workers.http.enabled=true

coordination: postgres also works with RabbitMQ or Kafka. Their workers still need Redis, and a running job of theirs cannot be cancelled then. See Coordination for the connection requirements.

Production install​

1. Store the passwords in a Secret​

kubectl create namespace milvaion
kubectl -n milvaion create secret generic milvaion-external \
--from-literal=db-password='...' \
--from-literal=rabbitmq-password='...' \
--from-literal=redis-password='...'

The JWT signing key, the API key secret and the root password are generated by the chart and kept across upgrades. To manage them yourself, create a Secret with the keys jwt-signing-key, api-key-secret, root-password and secrets-encryption-key (the key the Secrets page encrypts with) and set auth.existingSecret.

2. Write your values​

# values-production.yaml
externalDatabase:
host: postgres.internal
database: MilvaionDb
username: milvaion
existingSecret: milvaion-external
externalRabbitmq:
host: rabbitmq.internal
username: milvaion
existingSecret: milvaion-external
externalRedis:
host: redis.internal
existingSecret: milvaion-external

ingress:
enabled: true
className: nginx
annotations:
cert-manager.io/cluster-issuer: letsencrypt
hosts:
- host: jobs.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: jobs-example-com-tls
hosts: [jobs.example.com]

config:
MilvaionConfig:
Alerting:
MilvaionAppUrl: https://jobs.example.com

workers:
http:
enabled: true
replicaCount: 2
maintenance:
enabled: true

3. Install​

helm install milvaion oci://ghcr.io/milvasoft/charts/milvaion -n milvaion -f values-production.yaml

If a required setting is missing, for example the database host, the install stops and names it.

Configuring Milvaion​

Any setting from the API's appsettings.json goes under config, with the same structure. See Configuration for the settings themselves.

config:
MilvaionConfig:
JobDispatcher:
BatchSize: 500
Logging:
Seq:
Enabled: true
Uri: http://seq.logging:5341

By default these become environment variables (MilvaionConfig__JobDispatcher__BatchSize=500) in a ConfigMap. Set configFormat: file to mount them as appsettings.Production.json instead. Either way, changing them rolls the API pods.

To serve Milvaion under a path such as https://example.com/milvaion, set config.MilvaionConfig.BasePath to /milvaion and use the same path in the Ingress.

Database migrations​

The API migrates and seeds the database itself when it starts, before it accepts traffic, so there is no separate migration Job. The startup probe allows five minutes for this. For the first install keep api.replicaCount: 1 (the default) so one pod initialises the database, then scale out with helm upgrade. Upgrades replace one pod at a time.

Scaling the API​

api:
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 5
targetCPUUtilizationPercentage: 70
service:
sessionAffinity: ClientIP
ingress:
annotations:
nginx.ingress.kubernetes.io/affinity: cookie

API pods coordinate through Redis. The dashboard's live updates use SignalR, which needs each browser to stay on one pod, hence the session affinity settings above.

Workers​

Each built-in worker is its own Deployment with its own replicas, resources and settings. The chart wires up RabbitMQ and Redis for them. Pass worker settings under config and secrets through extraEnv:

workers:
sql:
enabled: true
config:
SqlExecutorConfig:
Connections:
Reporting:
Provider: PostgreSql
extraEnv:
- name: SqlExecutorConfig__Connections__Reporting__ConnectionString
valueFrom:
secretKeyRef:
name: reporting-db
key: connection-string

Your own workers, built with the SDKs, are usually deployed from their own charts or manifests. They only need the RabbitMQ and Redis connection settings; see Your First Worker.

Monitoring​

Set metrics.serviceMonitor.enabled: true to let the Prometheus Operator scrape /api/metrics. See Monitoring.

All values​

The chart's README lists every value.