Igor Safonov
01/24/2023, 1:44 PMAkilesh V
01/24/2023, 2:18 PMIgor Safonov
01/24/2023, 2:28 PMglobal.database.secretName = 'airbyte-my-pg-secret'
global.database.secretValue = 'pg_pass'
temporal.env_vars.VISIBILITY_DBNAME = 'my-visibility'
temporal.env_vars.DBNAME = 'my-temporal'
postgresql.enabled = false
externalDatabase.host = 'my-host'
externalDatabase.user = 'my-user'
externalDatabase.database = 'db'
externalDatabase.port = '5432
It translates to valid connection strings (e.g. jdbc:<postgresql://my-host>:my-port/<db>, but I want it to be like jdbc:<postgresql://my-host>:my-port/<db>?<extra_params> . And the question is about those extra params.Nataly Merezhuk (Airbyte)
01/24/2023, 6:18 PMIgor Safonov
01/25/2023, 4:40 PMDATABASE_URL env variable.
And it is quite painful to do for temporal service. I worked some problems out via env variables (how it is described above), but have found new ones š . They are mostly about temporal.io and the fact that airbyte uses old temoral setup docker image.Nataly Merezhuk (Airbyte)
01/25/2023, 4:53 PMIgor Safonov
01/25/2023, 5:09 PMpostgresql:
enabled: false # use external
externalDatabase:
host: "${pg_host}"
user: "${pg_user}"
existingSecret: pg-secret # gets ignored
existingSecretPasswordKey: "pg_pass" # gets ignored
database: "${pg_db_main}"
port: "${pg_port}"
global:
database:
# because externalDatabase secret ignored, need to set it up here
secretName: secret
secretValue: "pg_pass"
all services (not sure if it can't go to global, for some reason it is in this way in my code).
env_vars:
DATABASE_URL: "jdbc:postgresql://${pg_host}:${pg_port}/${pg_db}?prepareThreshold=0"
If you set env_vars anywhere you need to set them in globals like DUMMY: "" or you will get an error (something about types).
temporal
env_vars:
VISIBILITY_DBNAME: "${pg_db_temporal_visibility}"
DBNAME: "${pg_db_temporal}"
DB_PORT: "${pg_port}"
SKIP_DB_CREATE: "true"
SQL_TLS: "true" # for migrations
SQL_TLS_ENABLED: "true" # for server
SQL_CONNECT_ATTRIBUTES: "binary_parameters=yes" # to work around prepared statements in transaction pooling mode
I still can't understand about DB_PORT. If I do not set it, externalDatabase.port is ignored, if I set it, DB_PORT gets duplicated in k8s deployment (in my setup it is duplicated).
SKIP_DB_CREATE is needed if you create database in advance. This flag is absent in airbyte/temporal-auto-setup image for now but present in temoral.io
So it is still not working, because SQL_CONNECT_ATTRIBUTES work only for temporal-sql-tool , and for server you need to specify it in temporal config (which is not supported yet, so right now I am figuring out how to change that config...)Igor Safonov
01/26/2023, 1:48 AMNataly Merezhuk (Airbyte)
01/26/2023, 3:06 PMIgor Safonov
01/26/2023, 3:55 PMtemporal image even if that issue is solved.
I want to try explain it in more structural format.
Firstly about db connection. The problems are:
⢠there is no explicit way to configure parameters for connection URL for airbyte-db. One cat work aroud it using DATABASE_URL environment variable.
⢠in the issue above, there is no solution for connection parameters at all. One can implement them using SQL_CONNECT_ATTRIBUTES , but this setting works only for temporal database/schema setup. Temporal server does not use it, and the user must specify them in the config (example). But some parameters (e.g. sslmode) can be passed through environment variables.
⢠if temporal database already exists, you can get an error (airbyte uses this version of setup). "Temporal" have made it configurable, but airbyte uses old forked temporal image.
And about IPv6.
"Temporal" server listens to BIND_ON_IP (set up here in newest version). And it is IPv6 in my case. I solved it by changing hostname -> hostname -i and using my own image in helm chart.Nataly Merezhuk (Airbyte)
01/27/2023, 2:43 PMIgor Safonov
01/31/2023, 4:37 PMNataly Merezhuk (Airbyte)
02/01/2023, 3:14 PMIgor Safonov
02/02/2023, 9:54 AMuser
02/02/2023, 1:25 PM