โ๏ธConfigure an external database
1
postgresql:
enabled: false2
CREATE USER toucan WITH PASSWORD '<password>';
-- Curity (Authentication Service)
CREATE DATABASE curity;
GRANT ALL PRIVILEGES ON DATABASE curity TO toucan;
-- Dataset
CREATE DATABASE dataset;
-- (optional) Create a schema for the dataset
CREATE SCHEMA dataset;
GRANT ALL PRIVILEGES ON DATABASE dataset TO toucan;
-- Layout
CREATE DATABASE layout;
CREATE SCHEMA layout;
CREATE SCHEMA workspace;
GRANT ALL PRIVILEGES ON DATABASE layout TO toucan;
-- SpiceDB
CREATE DATABASE spicedb;
GRANT ALL PRIVILEGES ON DATABASE spicedb TO toucan;
-- Vault
CREATE DATABASE vault;
GRANT ALL PRIVILEGES ON DATABASE vault TO toucan;3
\c "vault";
CREATE TABLE vault_kv_store (
parent_path TEXT COLLATE "C" NOT NULL,
path TEXT COLLATE "C",
key TEXT COLLATE "C",
value BYTEA,
CONSTRAINT pkey PRIMARY KEY (path, key)
);
CREATE INDEX parent_path_idx ON vault_kv_store (parent_path);
CREATE TABLE vault_ha_locks (
ha_key TEXT COLLATE "C" NOT NULL,
ha_identity TEXT COLLATE "C" NOT NULL,
ha_value TEXT COLLATE "C",
valid_until TIMESTAMP WITH TIME ZONE NOT NULL,
CONSTRAINT ha_key PRIMARY KEY (ha_key)
);4
apiVersion: v1
kind: Secret
metadata:
name: toucan-postgresql
namespace: toucan
stringData:
postgresql-password: <password>5
layout:
config:
database_postgres:
url: 'postgresql://toucan:[[ getenv "LAYOUT_POSTGRESQL_PASSWORD" ]]@postgresql.example.com:5432/layout?schema=layout'
url_admin: 'postgresql://toucan:[[ getenv "LAYOUT_POSTGRESQL_PASSWORD" ]]@postgresql.example.com:5432/layout?schema=layout'
specific:
workspace_database_postgres:
url: 'postgresql://toucan:[[ getenv "LAYOUT_POSTGRESQL_PASSWORD" ]]@postgresql.example.com:5432/layout?schema=workspace'
url_admin: 'postgresql://toucan:[[ getenv "LAYOUT_POSTGRESQL_PASSWORD" ]]@postgresql.example.com:5432/layout?schema=workspace'
initconfig:
secrets:
LAYOUT_POSTGRESQL_PASSWORD:
name: toucan-postgresql
key: postgresql-password
dataset:
config:
schema: dataset
url: 'postgresql://toucan:[[ getenv "DATASET_POSTGRESQL_PASSWORD" ]]@postgresql.example.com:5432/dataset'
url_admin: 'postgresql://toucan:[[ getenv "DATASET_POSTGRESQL_PASSWORD" ]]@postgresql.example.com:5432/dataset'
initconfig:
secrets:
DATASET_POSTGRESQL_PASSWORD:
name: toucan-postgresql
key: postgresql-password
spicedb:
config:
datastore:
uri: 'postgresql://toucan:$(PG_PASSWORD)@postgresql.example.com:5432/spicedb'
# For the init container to run migrations
migration:
extraEnvVars:
- name: PG_PASSWORD
valueFrom:
secretKeyRef:
name: toucan-postgresql
key: postgresql-password
# For the main container
extraEnvVars:
- name: PG_PASSWORD
valueFrom:
secretKeyRef:
name: toucan-postgresql
key: postgresql-password
vault:
toucanEnvVars:
- name: ADMIN_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: '{{- include "toucan-stack.curity.oauth2.secretName" . -}}'
key: curity-toucan-admin-management-client-secret
- name: MICRO_SERVICE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: '{{- include "toucan-stack.curity.oauth2.secretName" . -}}'
key: curity-toucan-micro-service-client-secret
- name: TOUCAN_VAULT_TOKEN
valueFrom:
secretKeyRef:
name: '{{- include "toucan-stack.vault.oauthapp.secretName" . -}}'
key: vault-token
- name: PG_PASSWORD
valueFrom:
secretKeyRef:
name: 'toucan-postgresql'
key: 'postgresql-password'
- name: VAULT_PG_CONNECTION_URL
value: 'postgresql://toucan:$(PG_PASSWORD)@postgresql.example.com:5432/vault'
curity:
config:
dataSource:
connectionString: 'jdbc:postgresql://postgresql.example.com:5432/curity'
username: toucan
password:
secretName: toucan-postgresql
secretKey: postgresql-password6
helm upgrade --install toucan-stack oci://quay.io/toucantoco/charts/toucan-stack \
--namespace toucan \
--values ./values.override.yamlLast updated
Was this helpful?