We would like to have multiple instances of the same application in the same Kubernetes namespace. We can do that by using the name suffix capability of kustomize, so that hostname "X" becomes "X-something-unique" and that works well.
Unfortunately, we need the Spring Boot application to know how to reach the name suffixed Postgres database, so we cannot just hardcode the hostname into the JDBC URL in application.yaml (which is passed in as a configuration map).
I am not deeply familiar with these things, so what is the recommended way to do this?