Closed jiaqing-tee closed 3 months ago
kubectl exec -it postgres-64d86fbbc8-7bd4j -- psql -h localhost -U ps_user --password -p 5432 ps_db
\conninfo
auth
databaseCREATE USER auth_user WITH PASSWORD 'Input auth_user password';
CREATE DATABASE auth;
GRANT ALL PRIVILEGES ON DATABASE auth TO auth_user;
GRANT ALL ON SCHEMA public TO auth_user;
\l
auth
database\c auth
CREATE TABLE users (
id serial primary key,
email VARCHAR(255) NOT NULL UNIQUE,
password_hash VARCHAR(162) NOT NULL
);
users
tableGRANT ALL PRIVILEGES ON TABLE users TO auth_user;
INSERT INTO users (email, password_hash) VALUES ('test@domain.com', 'Input_User_Password');
Create the Postgres DB in a separate container to decouple stuff Reference: https://www.digitalocean.com/community/tutorials/how-to-deploy-postgres-to-kubernetes-cluster#connect-to-postgresql-via-kubectl