In this section, you will create the database used by both the primary control plane service (FlyteAdmin) and the Flyte memoization service (Data Catalog).
- From the AWS Management console go to RDS
- Click on Create database
- From the Engine options select
Aurora (PostgreSQL compatible)
- As of this writing, select the latest Postgres version below
15.x
- Leave the Templates as
Production
- Change the DB cluster identifier to
flyteadmin
- Set the Master username to
flyteadmin
- Choose a Master password that you will later use in the Helm template
- Pick an Instance configuration that reflect your DevOps policies. If in doubt, select the default option from Burstable classes (includes t classes)
- Unless otherwise indicated by your organization's policies, select
Don't create an Aurora Replica
from the Availability and durability menu - In the Connectivity section
- Select
Don't connect to an EC2 compute resoource
- Choose
IPv4
as Network type - Make sure to select the same Virtual Private Cloud (VPC) that your EKS cluster is in
- Leave Public access by default (
No
) - In a separate tab, navigate to the EKS cluster page and make note of the security group attached to your cluster.
- Go back to the RDS page and select the EKS cluster’s security group from the Existing VPC security groups dropdown menu (feel free to leave the default as well).
- Select
- Under the top level Additional configuration (there’s a sub menu by the same name) set
flyteadmin
as Initial database name - Leave all the other settings as is and hit Create.
- Oncre created, go to RDS > Databases and click on your database
- Take note of the Endpoint name of Type
Writer instance
(<flyteadmin.cluster-UID.region.rds.amazonaws>
) .
We will use pgsql-postgres-client
to verify DB connectivity:
- Create a namespace for testing purposes:
kubectl create ns testdb
- Run the following command with the database username and password you configured, and the Endpoint name:
kubectl run pgsql-postgresql-client --rm --tty -i --restart='Never' --namespace testdb --image docker.io/bitnami/postgresql:11.7.0-debian-10-r9 --env='PGPASSWORD=<Password>' --command -- psql testdb --host <RDS-ENDPOINT-NAME> -U flyteadmin -d flyteadmin -p 5432
- If things are working fine then you should drop into a
psql
command prompt after hitting Enter - Verify connection by entering:
\conninfo
Expected output:
flyteadmin=> \conninfo
You are connected to database "flyteadmin" as user "flyteadmin" on host "flyteadmin.cluster-....rds.amazonaws.com" at port "5432".
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
- Type
\q
to quit - In case there are connectivity issues, please check the security groups on the database and the EKS cluster.
- Delete the test namespace:
kubectl delete namespace testdb
Next: Deploy with Helm