Skip to main content

Kubernetes

Architecture

The Helm chart deploys:

  • backend-app - FastAPI backend serving the /api endpoints
  • backend-log - FastAPI backend serving the /log endpoints (data ingestion)
  • backend-worker - Background job processor (async tasks, scheduled jobs)
  • frontend - Nginx serving the React SPA
  • init-job - One-time job for database migrations (runs on install/upgrade)
  • postgres (optional) - Bundled PostgreSQL instance

Download

wget https://user:[email protected]/docker/definity-chart-0.66.1.tgz
tar xzvf definity-chart-*.tgz

Configure

See values.yaml in the chart for more configuration options.

Postgres

Use your own managed Postgres instance and set its URL in values.yaml (recommended).

Alternatively, enable the bundled Postgres in the chart:

  • Installed via Helm pre-install hook (not managed by main chart lifecycle)
  • Enable only during first installation
  • Requires a persistent volume

Base Path

To deploy Definity under a subpath (e.g., https://example.com/definity/), set the basePath value:

basePath: definity

This configures the frontend routing and backend API paths accordingly.

Install

helm upgrade --install definity-app definity-chart

Verify

export DEFINITY_HOST=http[s]://your-host[:port]
bash definity-chart/server_hello_world.sh

Login

Open the Definity URL in your browser. The default credentials are:

  • Username: user
  • Password: pass

Change these credentials after first login via the Settings page.


Maintenance

Logs

Backend services contain rotating log files.

NAMESPACE=namespace

# Enter the backend-log pod
kubectl exec -it svc/backend-log -n $NAMESPACE -- /bin/bash

# List available logs
ls -l logs/
# Example files:
# definity-server.log
# definity-server-errors.log

# Copy error log to local machine
CUR_DATE=$(date +%F)
kubectl cp -n $NAMESPACE backend-log-pod-name:logs/definity-server-errors.log ./definity-server-errors-${CUR_DATE}.log

# Collect all logs to local
bash collect_k8s_logs.sh $NAMESPACE
ls -l ./definity_logs

DB Dump

Create a PostgreSQL dump file locally:

pg_dump -Fc -U postgres postgres > pg_db_dump_$(date +%F).custom

Create a dump file from inside a Kubernetes container:

kubectl exec svc/postgres -- pg_dump -Fc -U postgres postgres -f /tmp/pg_dump.custom
kubectl cp svc/postgres:/tmp/pg_dump.custom ./pg_db_dump_$(date +%F).custom
kubectl exec svc/postgres -- rm /tmp/pg_dump.custom

Restore the database from a dump file:

psql -c "drop schema public cascade"
psql -c "create schema public"
pg_restore -v -Fc -h localhost -d $DB_NAME --no-owner pg_db_dump_${CUR_DATE}.custom