#!/bin/bash DATABASE=mainscnt LOGIN=sink PASSWORD=`openssl rand -base64 24` SUPERUSER_LOGIN=$(kubectl get secret -n mainscnt database -o jsonpath="{.data.superuser-username}" | base64 --decode) SUPERUSER_PASSWORD=$(kubectl get secret -n mainscnt database -o jsonpath="{.data.superuser-password}" | base64 --decode) kubectl run psql \ --stdin=true \ --tty=true \ --rm=true \ --image=postgres:15-alpine \ -n $NAMESPACE \ --restart=Never \ --env="PGPASSWORD=$SUPERUSER_PASSWORD" \ --env="PGUSER=$SUPERUSER_LOGIN" \ -- \ psql -h database.mainscnt.svc.cluster.local <