dependency-track is unable to connect to bitnami postgresql on Kubernetes

I have deployed Bitnami PostgreSQL (chart: 16.7.10
, app: 17.5.0
) on my AWS EKS Kubernetes cluster under the namespace appdev-dependency-track
along with Dependency-Track (chart: 0.34.0
, app: 4.13.2
).
Problem is, API Server pod of Dependency-Track
is unable to connect to PostgreSQL.
Upon changing the URL, I either get the following error, Caused by: java.net.UnknownHostException: postgresql-postgresql
, or the pod gets restarted after printing the following log lines without printing and error with exit code 143
:
...
2024-06-18 07:01:57,587 INFO [RequirementsVerifier] Initializing requirements verifier
2024-06-18 07:01:57,587 INFO [UpgradeInitializer] Initializing upgrade framework
2024-06-18 07:01:59,593 INFO [PersistenceManagerFactory] Initializing persistence framework
2024-06-18 07:01:59,595 INFO [PersistenceManagerFactory] Creating transactional connection pool
2024-06-18 07:01:59,618 INFO [PersistenceManagerFactory] Creating non-transactional connection pool
I'm stuck.
Reference link: docs.dependencytrack.org > getting-started > database-support
Answer
After changing:
ALPINE_DATABASE_URL
tojdbc:postgresql://postgresql.appdev-dependency-track.svc.cluster.local:5432/postgres
Increasing
initialDelaySeconds
to120
in thelivenessProbe
It worked.
My API servers configuration for Dependency-Track to connect with Bitnami PostgreSQL is as follows:
apiServer:
extraEnv:
- name: SYSTEM_REQUIREMENT_CHECK_ENABLED
value: "false"
- name: ALPINE_DATABASE_MODE
value: "external"
- name: ALPINE_DATABASE_URL
value: "jdbc:postgresql://postgresql.appdev-dependency-track.svc.cluster.local:5432/postgres"
- name: ALPINE_DATABASE_DRIVER
value: "org.postgresql.Driver"
- name: "ALPINE_DATABASE_USERNAME"
value: "postgres"
- name: "ALPINE_DATABASE_PASSWORD"
valueFrom:
secretKeyRef:
key: postgres-password
name: postgresql
Enjoyed this question?
Check out more content on our blog or follow us on social media.
Browse more questions