Skip to content

setup database certificates#623

Open
boddumanohar wants to merge 2 commits intodevfrom
db-certs
Open

setup database certificates#623
boddumanohar wants to merge 2 commits intodevfrom
db-certs

Conversation

@boddumanohar
Copy link
Member

@boddumanohar boddumanohar commented Feb 20, 2026

Fixes: simplyblock/vela#169

The database connection endpoint connects to PGBouncer service. So the changes in PR sets up TLS termination for at PGBouncer.

As a part of this changes, we create the certificate:

  • Create the certificate as a part of Helm chart
  • update PGBouncer Config to require certificates
  • update vm.yaml definition with certificates

On the vela-os side, we first start the PGBouncer without TLS and the then certificates are available, we reload the PGbouncer with Certificates.

It can be observed below that the PGBouncer has intially connect in TLS mode and after a minute, it's connected with TLS.

root@pgbench2:/# psql "postgresql://postgres:itoanlI07fcVZ7vT@db.01kjkn4mby3sft1eqpc4nx0z2f.pr623.dev.kernel-labs.org:31672/postgres"
psql (17.8 (Debian 17.8-1.pgdg13+1), server 18.1)
WARNING: psql major version 17, server major version 18.
         Some psql features might not work.
Type "help" for help.

postgres=> \q
root@pgbench2:/# psql "postgresql://postgres:itoanlI07fcVZ7vT@db.01kjkn4mby3sft1eqpc4nx0z2f.pr623.dev.kernel-labs.org:31672/postgres"
psql (17.8 (Debian 17.8-1.pgdg13+1), server 18.1)
WARNING: psql major version 17, server major version 18.
         Some psql features might not work.
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql)
Type "help" for help.

postgres=> \q

and on the vela-os side (PR: simplyblock/vela-os#22)

Waiting for certificates...
01/Mar/2026:02:55:56 +0000: Starting PostgREST 14.3...
01/Mar/2026:02:55:56 +0000: API server listening on 0.0.0.0:3000
01/Mar/2026:02:55:56 +0000: Listening for database notifications on the "pgrst" channel
01/Mar/2026:02:55:56 +0000: Successfully connected to PostgreSQL 18.1 on x86_64-linux, compiled by gcc-14.3.0, 64-bit
01/Mar/2026:02:55:56 +0000: Connection Pool initialized with a maximum size of 10 connections
01/Mar/2026:02:55:56 +0000: Config reloaded
01/Mar/2026:02:55:56 +0000: Schema cache queried in 927.6 milliseconds
01/Mar/2026:02:55:56 +0000: Schema cache loaded 3 Relations, 2 Relationships, 4 Functions, 0 Domain Representations, 4 Media Type Handlers, 1196 Timezones
01/Mar/2026:02:55:56 +0000: Schema cache loaded in 7.7 milliseconds
Certificates found. Enabling TLS and reloading PgBouncer...

we wait for certificate and then load then when they become available.

@boddumanohar boddumanohar marked this pull request as draft February 23, 2026 11:09
Base automatically changed from dev to main February 23, 2026 13:45
@boddumanohar boddumanohar force-pushed the db-certs branch 2 times, most recently from 88994e4 to ac9354d Compare February 25, 2026 10:29
@boddumanohar boddumanohar changed the base branch from main to dev February 25, 2026 10:29
@boddumanohar boddumanohar force-pushed the db-certs branch 2 times, most recently from e059c1e to d052469 Compare February 26, 2026 03:26
@boddumanohar boddumanohar marked this pull request as ready for review February 26, 2026 03:31
@boddumanohar boddumanohar marked this pull request as draft February 26, 2026 12:09
Base automatically changed from dev to main February 27, 2026 14:33
@boddumanohar boddumanohar changed the base branch from main to dev February 28, 2026 16:32
@boddumanohar boddumanohar marked this pull request as ready for review March 1, 2026 03:09
@boddumanohar boddumanohar requested a review from mxsrc March 1, 2026 03:09
@boddumanohar boddumanohar reopened this Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Databases should be connected via TLS

1 participant