RDS Database Setup
Teluul stores its persistent data in Amazon RDS (PostgreSQL), outside the Kubernetes cluster. The application services running on EKS connect to it over the network. See Kubernetes (EKS) overview.
- PostgreSQL managed by Amazon RDS
- Runs outside the cluster, not in Kubernetes volumes
- Connection details are provided to services as environment variables
- The password is stored in AWS Secrets Manager
Why the database is outside Kubernetes
Kubernetes is not well suited for running persistent, one-off services like a database. Amazon RDS is built for this job, so:
- Kubernetes runs our own services (API, workers, scheduler) and the Redis cache.
- RDS runs the database.
The demo ran everything on a single AWS instance with Docker Compose. For V1, the database moves to RDS, and there is no database service inside the cluster.
What we are setting up
| Item | Value |
|---|---|
| Engine | PostgreSQL on Amazon RDS |
| Database name | teluul_prod_db |
| Username | teluul_admin |
| Port | 5432 |
| Host | The RDS endpoint (your-rds-endpoint.amazonaws.com) |
| Password | Stored in AWS Secrets Manager |
Environment variables (V1)
| Variable | What it does | Value |
|---|---|---|
RDS_DATABASE_URL |
Full connection URL used by the backend | postgres://teluul_admin:YOUR_PASSWORD@HOST:5432/teluul_prod_db |
RDS_DB_NAME |
Database name | teluul_prod_db |
RDS_HOST |
RDS endpoint | your-rds-endpoint.amazonaws.com |
RDS_PORT |
PostgreSQL port | 5432 |
RDS_USERNAME |
Database login user | teluul_admin |
RDS_PASSWORD |
Database password | Stored in AWS Secrets Manager |
Setup steps
- Create the RDS PostgreSQL instance in AWS.
- Create the database
teluul_prod_dband the userteluul_admin. - Store the password in AWS Secrets Manager.
- Allow the EKS cluster to reach RDS (see the network note below).
- Add the variables above to the V1 configuration, with the password coming from the secret.
- Deploy and check that
teluul-apiconnects to the database.
Network access (recommended)
The source material doesn't cover networking, so these are suggestions to confirm with the team:
- Put the RDS instance in the same VPC as the EKS cluster.
- Use private subnets so the database is not exposed to the internet.
- Use a security group that allows port
5432only from the EKS nodes or pods.