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

our own postgres #4

Open
segator opened this issue Feb 17, 2022 · 7 comments
Open

our own postgres #4

segator opened this issue Feb 17, 2022 · 7 comments

Comments

@segator
Copy link

segator commented Feb 17, 2022

if we already have a postgres server, can we configure it instead of deploying a new one?

@evandam
Copy link

evandam commented Jun 17, 2022

👍 for this, I would really like to be able to point to a separately managed database rather than running postgres in our cluster.

@scalp42
Copy link

scalp42 commented Jun 22, 2022

Same here, it seems to be all hardcoded 😢

@afeiszli
Copy link
Contributor

Deploying postgres is hardcoded with helm. You may want to follow the manual deploy steps instead. Otherwise you will need to remove postgres after helm install and then change the connection details: https://github.com/gravitl/netmaker/tree/master/k8s/server

@jensjohansen
Copy link

The problem is the postgres instalation fails in this helm chart

2022-12-03 13:35:27.042 GMT [163] FATAL: password authentication failed for user "postgres"
2022-12-03 13:35:27.042 GMT [163] DETAIL: User "postgres" has no password assigned.
Connection matched pg_hba.conf line 10: "local all all md5"
2022-12-03 13:35:27.042 GMT [163] LOG: could not send data to client: Broken pipe
postgresql-repmgr 13:35:27.04 INFO ==> ** Starting repmgrd **
[2022-12-03 13:35:27] [NOTICE] repmgrd (repmgrd 5.2.1) starting up
[2022-12-03 13:35:27] [ERROR] connection to database failed
[2022-12-03 13:35:27] [DETAIL]
FATAL: password authentication failed for user "repmgr"

We've had similar problems with third-party products that rely on the Mitnami HA Postgresql installation - it looks like Bitnami broker their helm chart, and everyone has to update their helm charts if they are using it as a subchart.

afeiszli pushed a commit that referenced this issue Jan 10, 2023
* fix: templating of wireguard service annotation

* chore: package new chart
@anjomro
Copy link

anjomro commented Jan 31, 2023

For anyone looking: You can now use your own Postgres DB.
The configuration isn't documented though, however from the Helm-Chart you should be able to disable the attached bitname postgres-ha and configure the connection to another Postgres instance.

wireguard:
  dbHost: YOUR-POSTGRES-HOST

postgresql-ha:
  enabled: false
  postgresql:
    username: YOUR-POSTGRES-USER
    password: YOUR-POSTGRES-PW
    database: YOUR-POSTGRES-DB

The Postgres port is hardcoded to be 5432

@maaft
Copy link

maaft commented Feb 9, 2023

@anjomro sorry to say, but this is rather useless in its current state.

  • why not support complete configuration, including port?
  • unfortunately, I see it waaaay to often, but secrets in plain yaml gives me headaches. They are a nightmare (or even impossible) to manager securely with GitOps. Other helm-charts support "secretKeyRef", where the corresponding env vars are then read from secrets.

Here's what would make sense:

postgresql-ha:
  enabled: false
  postgresql:
    username:
      secretKeyRef:
        name: db-credentials
        key: username
    password:
      secretKeyRef:
        name: db-credentials
        key: password
    database: YOUR-POSTGRES-DB

Edit: Where do I even set the URL for my DB?

@jessebot
Copy link

jessebot commented Jul 9, 2023

looks like the work for this was submitted in PR #35

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

No branches or pull requests

8 participants