Configuring an External PostgreSQL Instance
If needed, you can configure AtScale to use an external instance of the PostgreSQL database it uses for data storage. This can be done before or after installing AtScale.
To configure AtScale to use an external PostgreSQL instance:
-
Create a new PostgreSQL instance.
-
Connect to the new PostgreSQL instance and create the following users and schemas:
-
Create an
atscale_metadata
user and corresponding schema:CREATE DATABASE pgwire;
\c pgwire;
CREATE USER atscale_metadata WITH LOGIN PASSWORD 'xxxxxxx';
GRANT ALL PRIVILEGES ON DATABASE pgwire TO atscale_metadata;
ALTER DATABASE pgwire OWNER TO atscale_metadata;
SET ROLE atscale_metadata; -
Create a
keycloak
user and corresponding schema:CREATE DATABASE keycloak;
\c keycloak;
CREATE USER keycloak WITH LOGIN PASSWORD 'xxxxxxxxx';
GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak;
ALTER DATABASE keycloak OWNER TO keycloak;
SET ROLE keycloak; -
Create an
atscale
user and corresponding schema:CREATE DATABASE atscale;
\c atscale;
CREATE USER atscale WITH LOGIN PASSWORD 'xxxxxxx';
GRANT ALL PRIVILEGES ON DATABASE atscale TO atscale;
ALTER DATABASE atscale OWNER TO atscale;
SET ROLE atscale;
CREATE SCHEMA IF NOT EXISTS atscale;
CREATE SCHEMA IF NOT EXISTS modeler_backend;
CREATE SCHEMA IF NOT EXISTS engine_settings;
CREATE SCHEMA IF NOT EXISTS engine;
CREATE SCHEMA IF NOT EXISTS api;
-
-
On your Kubernetes cluster, create a new secret file as shown below. Be sure to replace the
namespace
values with the namespace in which AtScale is or will be installed, and thehost
,port
, andpassword
values with those appropriate for your system.apiVersion: v1
kind: Secret
metadata:
name: keycloak-postgres-external
namespace: atscale
type: Opaque
stringData:
host: xxxx
port: "xxxx"
user: keycloak
password: "xxxx"
database: keycloak
---
apiVersion: v1
kind: Secret
metadata:
name: atscale-postgres-external
namespace: atscale
type: Opaque
stringData:
host: xxxx
port: "xxxx"
user: atscale
password: "xxxx"
database: atscale
---
apiVersion: v1
kind: Secret
metadata:
name: pgwire-postgres-external
namespace: atscale
type: Opaque
stringData:
host: xxxx
port: "xxxx"
user: atscale_metadata
password: "xxxx"
database: pgwire -
Apply the new secret. This creates three additional secrets:
atscale-postgres-external
,keycloak-postgres-external
, andpgwire-postgres-external
.kubectl apply -f filename -n namespace
Where
filename
is the name of the secret file you created above, andnamespace
is the namespace in which AtScale is or will be installed. -
Make the following changes to AtScale's
values.yaml
file (or your values override file, if you created one).These changes disable the default PostgreSQL database installed with AtScale and point the AtScale services to the new secrets. This step is important because the default versions of the
atscale-postgres
,keycloak-postgres
, andpgwire-postgres
secrets will be removed in the next step.postgres:
enabled: false
atscale-engine:
externalDatabase:
existingSecret: "atscale-postgres-external"
existingSecretHostKey: "host"
existingSecretPortKey: "port"
existingSecretUserKey: "user"
existingSecretPasswordKey: "password"
existingSecretDatabaseKey: "database"
externalPgwire:
existingSecret: "pgwire-postgres-external"
existingSecretHostKey: "host"
existingSecretPortKey: "port"
existingSecretUserKey: "user"
existingSecretPasswordKey: "password"
existingSecretDatabaseKey: "database"
atscale-api:
externalDatabase:
existingSecret: "atscale-postgres-external"
existingSecretHostKey: "host"
existingSecretPortKey: "port"
existingSecretUserKey: "user"
existingSecretPasswordKey: "password"
existingSecretDatabaseKey: "database"
atscale-entitlement:
externalDatabase:
existingSecret: "atscale-postgres-external"
existingSecretHostKey: "host"
existingSecretPortKey: "port"
existingSecretUserKey: "user"
existingSecretDatabaseKey: "database"
existingSecretPasswordKey: "password"
keycloak:
externalDatabase:
existingSecret: "keycloak-postgres-external"
existingSecretHostKey: "host"
existingSecretPortKey: "port"
existingSecretUserKey: "user"
existingSecretDatabaseKey: "database"
existingSecretPasswordKey: "password" -
If you have not yet installed AtScale, continue on with the installation procedure.
If you have already installed AtScale, apply the updated values file:
helm upgrade atscale oci://docker.io/atscaleinc/atscale --version version_number -n namespace -f values_file
Where
version_number
is the version of AtScale you're currently on,namespace
is the namespace in which AtScale is installed, andvalues_file
is your updated values file. -
Restart the AtScale services to apply the new secrets.