helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

Configure SQL TLS environment variables in server-job

Open grzegorz8 opened this issue 2 years ago • 12 comments

What was changed

Added support for SQL_TLS* properties in schema jobs (server-job.yaml).

Why?

Currently, when PostgreSQL database is secured with TLS, schema jobs are not properly configured.

In the Pull Request we reuse server.config.persistence.*.sql.tls, server.config.additionalVolumes and server.config.additionalVolumeMounts properties..

Checklist

  1. Closes No related issues.

  2. How was this tested:

  1. Any docs updates needed?

No updates needed.

grzegorz8 avatar Jul 20 '23 12:07 grzegorz8

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 20 '23 12:07 CLAassistant

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jul 20 '23 12:07 CLAassistant

@grzegorz8 May I ask you - what does it mean "schema jobs are not properly configured"?

LukaGiorgadze avatar Aug 24 '23 13:08 LukaGiorgadze

@grzegorz8 May I ask you - what does it mean "schema jobs are not properly configured"?

I meant that TLS related env variables are not set (SQL_TLS_KEY_FILE, SQL_TLS_CERT_FILE, etc).

grzegorz8 avatar Aug 29 '23 08:08 grzegorz8

SQL_TLS=true is required option for connecting to Azure Postgres Flexible Servers. Probably it is required for other 'serverless' managed databases, but we only tested on Azure.

This is the error we recieved (without SQL_TLS)

2023-10-03T12:34:11.898Z	ERROR	Unable to create SQL database.	{"error": "unable to connect to DB, tried default DB names: postgres,defaultdb, errors: [pq: no pg_hba.conf entry for host \"XX.XX.XX.XX\", user \"admin\", database \"postgres\", no encryption pq: no pg_hba.conf entry for host \"XX.XX.XX.XX\", user \"admin\", database \"defaultdb\", no encryption]", "logging-call-at": "handler.go:94"}

arkoc avatar Oct 03 '23 12:10 arkoc

Hi @grzegorz8 any update on this PR ?

debugger24 avatar Oct 23 '23 04:10 debugger24

Hi everyone! Any updates for this PR?

syugoman-armenotech avatar Feb 06 '24 21:02 syugoman-armenotech

@grzegorz8 Hi! Can you please update an example? It will be helpful https://github.com/temporalio/helm-charts/blob/master/charts/temporal/values/values.postgresql.yaml

syugoman-armenotech avatar Feb 07 '24 07:02 syugoman-armenotech

@grzegorz8 Hi! Can you please update an example? It will be helpful https://github.com/temporalio/helm-charts/blob/master/charts/temporal/values/values.postgresql.yaml

Example updated. Please check if it looks fine.

grzegorz8 avatar Feb 12 '24 11:02 grzegorz8

Tested the Branch with Azure MySql with TLS enabled. Works.

ChristianGottinger avatar Feb 28 '24 09:02 ChristianGottinger

Hello! Wanted to bump this as it would be useful for us. Thank you!

devinargenta avatar Apr 05 '24 15:04 devinargenta

can someone clarify the status of this PR?

we are using these changes without issues with postgresql versions 15.x

moss2k13 avatar Apr 30 '24 08:04 moss2k13

Looks good, one tiny tweak.

robholland avatar Jun 14 '24 07:06 robholland

Thanks for your contribution :) For future reference, when you've attended to feedback in PR, if you can re-request review from the reviewer, it helps us spot when something is ready for us to look at again.

robholland avatar Jun 14 '24 11:06 robholland

Does this additionalVolumeMount nest in: server.config.additionalVolumes

Like what the original post says?

Or nested under server.additionalVolumes as per: https://github.com/temporalio/helm-charts/pull/411/files#diff-5f8eb04d49dd7caffd33da659dd7bae84435c114a6255319b2965dcf6a2536abR254

esn89 avatar Oct 02 '24 06:10 esn89

Does this additionalVolumeMount nest in: server.config.additionalVolumes

Like what the original post says?

Or nested under server.additionalVolumes as per: https://github.com/temporalio/helm-charts/pull/411/files#diff-5f8eb04d49dd7caffd33da659dd7bae84435c114a6255319b2965dcf6a2536abR254

The description is wrong, the code is right. Sorry for confusion.

grzegorz8 avatar Oct 04 '24 12:10 grzegorz8