developmentseed / eoapi-k8s

eoAPI IaC and k8 deployments for AWS, GCP and Azure
https://eoapi.dev/
MIT License
10 stars 4 forks source link

Connect eoapi-k8s STAC FastAPI to External PostgreSQL Database #133

Open MathewNWSH opened 3 months ago

MathewNWSH commented 3 months ago

Description

Hello everyone, I have recently returned to the topic of deploying pgstack and stac-fast API on Kubernetes (my deployment using Docker Compose can no longer handle the storage needs :).

And here is where I have a problem: many thanks for creating the cloud-native PostgreSQL operator, thanks to it eoapi-k8s is really an amazing tool for working with the cloud in every regard, but we have set up our own bare-metal server dedicated to the PostgreSQL database. The server has been configured for HA (master and synchronizing read-only slaves), so I would like to use this database. This means that, I would like to keep it on a different cluster. Can this be done? i.e., is it enough in the YAML to add:

db:
  settings:
    secrets:
      PGUSER: "username"
      POSTGRES_USER: "username"
      PGPASSWORD: "password"
      POSTGRES_PASSWORD: "password"
      PGHOST: "bare metal load balancer floating IP"

Thanks for the response and the developers' work on eoapi.

Labels

ranchodeluxe commented 3 months ago

@MathewNWSH: If you are using the old and deprecated db: config and not PGO and assuming your k8s cluster can talk to external networks then, yes, setting the host env vars should work this way. Let me know how that works

ranchodeluxe commented 3 months ago

@MathewNWSH: If you are using the old and deprecated db: config and not PGO and assuming your k8s cluster can talk to external networks then, yes, setting the host env vars should work this way. Let me know how that works

That said PGO should actually support you doing this too (including specifying your own usernames/passwords and hosts) but you'd have to dig through their charts to figure out how to do that. That's probably what I'd recommend doing