diff --git a/infrastructure/postgres/create-db.sh b/infrastructure/postgres/create-db.sh new file mode 100755 index 0000000..da8af89 --- /dev/null +++ b/infrastructure/postgres/create-db.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +SUBJECT=$1 +PGPASSWORD=$2 + +PASSWORD=$(openssl rand -hex 20) +ID=$(openssl rand -hex 5) + +kubectl run "postgres-client-$ID" --rm -i --image "bitnami/postgresql" -n postgres --env="PGPASSWORD=$PGPASSWORD" --command -- psql --host postgres-postgresql -U postgres <