Kubernetes
Download Helm Chart
wget https://user:[email protected]/docker/definity-chart-0.57.5.tgz
tar xzvf definity-chart-*.tgz
Config
Postgres DB
The recommended way is to use your own managed Postgres instance and set its URL in values.yaml.
Alternatively, you can use the Postgres instance configured in the Helm chart, but note:
- It is installed using a Helm pre-install hook.
- It is not managed as part of the main Definity Helm chart lifecycle.
- Enable it only during the first installation.
- It relies on a persistent volume.
Network
You can enable or disable the Ingress object via values.yaml.
With Ingress
Customize ingress.yaml as needed. To get the main IP entrypoint:
kubectl describe ingress
Without Ingress
If you prefer to use Kubernetes services directly, access the frontend via the NodePort:
kubectl port-forward svc/frontend 8001:8000
Then open http://localhost:8001/ in your browser.
Install
helm upgrade --install definity-app definity-chart
Check
Verify the database schema creation and migrations ran successfully:
kubectl get pods
kubectl describe pod init-job
kubectl logs init-job-...
Run "Hello World"
export DEFINITY_HOST=http[s]://url-of-host[:port]
bash definity-chart/server_hello_world.sh
Check UI
Log in with the default credentials:
user / pass
Maintenance
Logs
Backend services backend-app and backend-log generate 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