Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for postgres dns name and non-default external port #107

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion releases/xnat/charts/xnat-web/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ stringData:
# Released under the Simplified BSD.
#
datasource.driver=org.postgresql.Driver
datasource.url=jdbc:postgresql://{{ template "xnat-web.postgresql.fullname" . }}/{{ template "xnat-web.postgresql.postgresqlDatabase" . }}
datasource.url=jdbc:postgresql://{{ if .Values.global.postgresql.postgresqlExternalName }}{{ .Values.global.postgresql.postgresqlExternalName }}{{ else }}{{ template "xnat-web.postgresql.fullname" . }}{{ end }}{{ if not (has (toString .Values.global.postgresql.postgresqlExternalPort) (list "<nil>" "" "5432")) }}{{ print ":" .Values.global.postgresql.postgresqlExternalPort }}{{ end }}/{{ template "xnat-web.postgresql.postgresqlDatabase" . }}
datasource.username={{ template "xnat-web.postgresql.postgresqlUsername" . }}
datasource.password={{ template "xnat-web.postgresql.postgresqlPassword" . }}
hibernate.dialect=org.hibernate.dialect.PostgreSQL9Dialect
Expand Down
6 changes: 3 additions & 3 deletions releases/xnat/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ metadata:
labels:
{{- include "xnat.labels" . | nindent 4 }}
spec:
{{- if .Values.postgresqlExternalName }}
{{- if .Values.global.postgresql.postgresqlExternalName }}
type: ExternalName
externalName: {{ .Values.postgresqlExternalName }}
externalName: {{ .Values.global.postgresql.postgresqlExternalName }}
{{- else }}
type: ClusterIP
ports:
Expand All @@ -30,6 +30,6 @@ subsets:
- ip: {{ . | quote }}
{{- end }}
ports:
- port: 5432
- port: {{ .Values.global.postgresql.postgresqlExternalPort | default 5432 }}
{{- end }}
{{- end }}
3 changes: 2 additions & 1 deletion releases/xnat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ global:
#postgresqlUsername: ""
#postgresqlPassword: ""
#servicePort: ""
#postgresqlExternalName: ""
#postgresqlExternalPort: ""

# Set to false when using an external database, configure either postgresqlExternalName or postgresqlExternalIPs
# WARNING: Only change this post deployment if you know what you are doing
Expand All @@ -18,7 +20,6 @@ postgresql:
postgresqlUsername: "xnat"

# External Database service endpoint, ensure `postgresql.enabled: false`
postgresqlExternalName: ""
postgresqlExternalIPs: []
# - 130.95.126.8

Expand Down