If we are receiving an error in the log that we are unable to connect to the database such as:
Once we have the password we can enter the postgresql pod by doing the following:
Once we are in the pod do the following to verify the password:
If we can log in then we need to verify that the correct password was in the secret at the time the pods were starting up. If the password is invalid and we need to reset please follow the next section.
server error (FATAL: password authentication failed for user "<user name>" (SQLSTATE 28P01))then we need to validate the database password. We can do this by running the following kubernetes command to get the password from the secret:
kubectl get secret -n <namespace> <postgres secret name> -o jsonpath="{.data.postgresql-password}" | base64 --decode
Once we have the password we can enter the postgresql pod by doing the following:
kubectl exec -it <postgres pod name> -n <namespace> -- bash
Once we are in the pod do the following to verify the password:
psql -h xray-postgresql -U <user_name> -d <database_name>
If we can log in then we need to verify that the correct password was in the secret at the time the pods were starting up. If the password is invalid and we need to reset please follow the next section.