diff --git a/charts/dependency-track/README.md b/charts/dependency-track/README.md index 6094d8b..dd56b30 100644 --- a/charts/dependency-track/README.md +++ b/charts/dependency-track/README.md @@ -33,7 +33,7 @@ Dependency-Track is an intelligent Software Supply Chain Component Analysis plat | frontend | object | `{"affinity":{},"emptyDir":{"sizeLimit":"8Gi"},"enabled":true,"env":[{"name":"API_BASE_URL","value":""}],"fullnameOverride":"","image":{"pullPolicy":"IfNotPresent","repository":"dependencytrack/frontend","tag":"4.3.1"},"initContainers":[],"livenessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"nameOverride":"","nodeSelector":{},"readinessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":60,"path":"/","periodSeconds":10,"successThreshold":1,"timeoutSeconds":2},"replicaCount":2,"resources":{"limits":{"cpu":1,"memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"securityContext":{"allowPrivilegeEscalation":false,"runAsUser":101},"service":{"annotations":{},"port":80,"type":"ClusterIP"},"serviceAccount":{"annotations":{},"create":true,"name":"frontend-serviceaccount"},"tolerations":[]}` | config of the frontend | | global | object | `{"imageRegistry":"docker.io"}` | global configuration | | ingress | object | `{"annotations":{},"enabled":false,"host":"chart-example.local","tls":{"enabled":false,"secretName":""}}` | configuration of ingress | -| postgresql | object | `{"enabled":true,"postgresqlDatabase":"deptrack","postgresqlPassword":"deptrack","postgresqlUsername":"deptrack"}` | configuration of postgres | +| postgresql | object | `{"enabled":true,"postgresqlDatabase":"deptrack","postgresqlPassword":"deptrack","postgresqlUsername":"deptrack","postgresqlHost":"" }` | configuration of postgres | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0) diff --git a/charts/dependency-track/templates/backend/deployment.yaml b/charts/dependency-track/templates/backend/deployment.yaml index 1ff074d..75f5a75 100644 --- a/charts/dependency-track/templates/backend/deployment.yaml +++ b/charts/dependency-track/templates/backend/deployment.yaml @@ -35,6 +35,7 @@ spec: - name: ALPINE_DATA_DIRECTORY value: "/data" {{- if .Values.postgresql.enabled }} + {{- if not .Values.postgresqlHost }} - name: ALPINE_DATABASE_MODE value: "external" - name: ALPINE_DATABASE_DRIVER @@ -49,6 +50,24 @@ spec: - name: ALPINE_DATABASE_USERNAME value: {{ .Values.postgresql.postgresqlUsername }} {{- end }} + {{- end }} + {{- if not .Values.postgresql.enabled }} + {{- if .Values.postgresql.postgresqlHost }} + - name: ALPINE_DATABASE_MODE + value: "external" + - name: ALPINE_DATABASE_DRIVER + value: "org.postgresql.Driver" + - name: ALPINE_DATABASE_URL + value: jdbc:postgresql://{{ .Values.postgresql.postgresqlHost}}/{{ .Values.postgresql.postgresqlDatabase }} + - name: ALPINE_DATABASE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-postgresql + key: postgresql-password + - name: ALPINE_DATABASE_USERNAME + value: {{ .Values.postgresql.postgresqlUsername }} + {{- end }} + {{- end }} {{- with .Values.apiserver.env }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/dependency-track/values.yaml b/charts/dependency-track/values.yaml index dd55ba3..516af42 100644 --- a/charts/dependency-track/values.yaml +++ b/charts/dependency-track/values.yaml @@ -175,3 +175,4 @@ postgresql: postgresqlUsername: deptrack postgresqlPassword: deptrack postgresqlDatabase: deptrack + # postgresqlHost: # configure for external postgresql database. Set enabled to false.