Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure SQL TLS environment variables in server-job #411

Merged
merged 3 commits into from
Jun 14, 2024

Conversation

grzegorz8
Copy link
Contributor

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 grzegorz8 requested review from a team as code owners July 20, 2023 12:01
@CLAassistant
Copy link

CLAassistant commented Jul 20, 2023

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

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.

@LukaGiorgadze
Copy link

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

@grzegorz8
Copy link
Contributor Author

@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).

@arkoc
Copy link

arkoc commented Oct 3, 2023

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"}

@debugger24
Copy link
Contributor

Hi @grzegorz8 any update on this PR ?

Copy link
Contributor

@debugger24 debugger24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@MasonLegere MasonLegere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me - tested with Postgres 15 on RDS

@syugoman-armenotech
Copy link

Hi everyone! Any updates for this PR?

@syugoman-armenotech
Copy link

@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

@grzegorz8
Copy link
Contributor Author

@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.

@ChristianGottinger
Copy link

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

@devinargenta
Copy link

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

@moss2k13
Copy link

can someone clarify the status of this PR?

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

# certFile: /path/to/certs/<client-cert-file>
# keyFile: /path/to/certs/<client-key-file>

# additionalVolumes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be indented so that they are under server.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robholland Thanks, fixed.

@robholland
Copy link
Contributor

Looks good, one tiny tweak.

@robholland robholland requested review from a team and removed request for a team June 14, 2024 07:56
@robholland robholland added the needs revision Team has requested some changes label Jun 14, 2024
@grzegorz8 grzegorz8 requested a review from tsurdilo as a code owner June 14, 2024 11:02
@robholland robholland merged commit b9df837 into temporalio:master Jun 14, 2024
2 checks passed
@robholland
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet