1. Create the database in Postgres
Follow this guide to create the db in Postgres already deployed in the ef-external namespace. Follow the steps below to create one.
-
execinto theef-postgresql-0pod in theef-externalnamespace
kubectl -n ef-external exec -it ef-postgresql-0 -- bash
-
execute the environment setup for
ef-postgresql-0( Only needed when the postgresql is running in non-HA mode , like no pgpool and multiple replicas of postgresql are running )
/opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash
-
Log into Postgres using the following command
psql --host ef-postgresql -U sa postgres -p 5432
-
The system will ask for the password for the user
sa. Enter the password, configured during deployment of Postgres. You should now be logged into the Postgres shell. -
Create the required database and extensions using the following commands.
the name of the db must be same as tenant name.
CREATE DATABASE <DBName>?;
\c qm_db;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-
Then to exit from the shell
\q
exit
exit