Skip to main content

Helm Chart

Download

wget https://user:[email protected]/docker/definity-chart-0.41.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.

Otherwise, you can use the postgres configured in the Helm chart, but notice it is installed with a helm pre-install hook. It will not be part of definity Helm chart life cycle. So you should enable it only once at the first installation. This Postgres relies on a persistent volume.

Network

You can enable/disable the ingress object in values.yaml.

With ingress

Change the ingress.yaml according to the way like. Get the main IP entrypoint from the ingress object:

kubectl describe ingress

Without ingress

Some companies prefer to work with the services directly, in this case you can just use the frontend service - it exposes a NodePort on port 8000.

kubectl port-forward svc/frontend 8001:8000

And check http://localhost:8001/

Install

helm upgrade --install definity-app definity-chart

Check

Verify DB schema creation/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

Login with initial default credentials: user/pass

Maintenance

Logs

Backend services - backend-app and backend-log have rotating log files. Can look for issues there:

NAMESPACE=namespace

# go inside the pod
kubectl exec -it svc/backend-log -n $NAMESPACE -- /bin/bash
ls -l logs/
# definity-server.log
# definity-server-errors.log

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

# copy all log files to local
bash collect_k8s_logs.sh $NAMESPACE
ls -l ./definity_logs

DB Dump

Create a DB dump file:

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

Create a DB dump file from a k8s 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 from 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