-
-
Save junqueira/04e568d355f9228a4341b4de7920fa67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| oc project kubernauts | |
| podname=$(oc get pods | grep postgres-$(oc get dc postgres -o jsonpath='{.status.latestVersion}') | grep -v deploy | grep Running | awk '{print $1}') | |
| oc rsh -c postgres $podname | |
| OR | |
| oc get pods | grep postgres | |
| oc exec -it postgres-pod-name bash | |
| #Please change <user> to your desired name | |
| POSTGRESQL_USER=<user> | |
| POSTGRESQL_DATABASE=<user> | |
| POSTGRESQL_PASSWORD=<user> | |
| createuser $POSTGRESQL_USER ; | |
| createdb --owner=$POSTGRESQL_USER $POSTGRESQL_DATABASE ; | |
| psql --command "ALTER USER \"${POSTGRESQL_USER}\" WITH ENCRYPTED PASSWORD '${POSTGRESQL_PASSWORD}';" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment