-
Notifications
You must be signed in to change notification settings - Fork 27
/
state-manager-postgres.yaml
39 lines (39 loc) · 1.61 KB
/
state-manager-postgres.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Override file suitable for local deployment of State Manager Bitnami Postgres
#
# NOTE: The below assumes you deploy Kafka and the PostgreSQL database in the same namespace, so that domain names containing just the service name are resolved (i.e. prereqs-postgresql instead of prereqs-postgresql.<namespace>)
# If that is not the case, you might need to add the namespace as a suffix.
auth:
# -- name of database to be created.
database: state-manager
# -- name of the user to be created.
username: state-manager-user
# -- password of the user to be created (if left blank, auto-generated)
password:
image:
tag: 14.4.0-debian-11-r23
# values configuring the permissions of volumes.
volumePermissions:
# -- enable/disable an init container which changes ownership of the mounted volumes.
enabled: true
# Configuring TLS
tls:
# -- enable TLS for postgres.
enabled: true
# -- enable automatic certificate generation for postgres.
autoGenerated: true
# primary (read/write instance) configuration.
primary:
# Custom init configuration..
initdb:
# -- ConfigMap-like object containing scripts to be executed on startup.
# @default -- corda_user_init.sh
scripts:
corda_user_init.sh: |
export PGPASSFILE=/tmp/pgpasswd$$
touch $PGPASSFILE
chmod 600 $PGPASSFILE
trap "rm $PGPASSFILE" EXIT
echo "localhost:${POSTGRES_PORT_NUMBER:-5432}:$POSTGRESQL_DATABASE:postgres:$POSTGRES_POSTGRES_PASSWORD" > $PGPASSFILE
psql -v ON_ERROR_STOP=1 $POSTGRESQL_DATABASE <<-EOF
ALTER ROLE "$POSTGRES_USER" NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;
EOF