ARTIFACTORY: How to log in to the database for postgresql pod for helm installation
Artifactory default Postgresql pod:
If you are not using an external database for an Artifactory helm installation, the default helm installation will create a postgresql pod with a generated database password. When running a kubectl get pods, you should see the postgresql pod that Artifactory uses.
NOTE: For production instances, it is recommended to use an externalized database. More information about setting up the external database can be found in our helm install documentation.
Logging in to the bundled postgresql database:
1. By default the postgresql password is saved as a kubernetes secret. To get the secret name you can run kubectl get secrets. To decode the password in the secret you can run the command below after providing the postgresql secret name.
kubectl get secret -n <namespace> <postgresql_secret_name> -o jsonpath="{.data.postgresql-password}" | base64 --decode2. Once you obtain the password, you can now log into the database inside the postgresql pod. Below is the command to get a shell on the running postgresql pod.
kubectl exec -it artifactory-postgresql-0 bash
3. Run psql inside the postgresql pod to login to the database using the previously retrieved password. The default username is artifactory.
psql -U artifactory password=<postgresql_password>