mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
@@ -5,4 +5,49 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
||||
{{- define "content-services.fullname" -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the Database hostname depending on the Database type
|
||||
*/}}
|
||||
{{- define "database.hostname" -}}
|
||||
{{- if eq ( .Values.database.type | toString ) "postgresql" }}
|
||||
{{- printf "%s-%s" .Release.Name .Values.postgresql.nameOverride -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the Database port depending on the Database type
|
||||
*/}}
|
||||
{{- define "database.port" -}}
|
||||
{{- if eq ( .Values.database.type | toString ) "postgresql" }}
|
||||
{{- print .Values.postgresql.service.port -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the Database driver depending on the Database type
|
||||
*/}}
|
||||
{{- define "database.driver" -}}
|
||||
{{- if eq ( .Values.database.type | toString ) "postgresql" }}
|
||||
{{- print .Values.postgresql.driver -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the Database user depending on the Database type
|
||||
*/}}
|
||||
{{- define "database.user" -}}
|
||||
{{- if eq ( .Values.database.type | toString ) "postgresql" }}
|
||||
{{- print .Values.postgresql.postgresUser -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Get the Database password depending on the Database type
|
||||
*/}}
|
||||
{{- define "database.password" }}
|
||||
{{- if eq ( .Values.database.type | toString ) "postgresql" -}}
|
||||
{{- print .Values.postgresql.postgresPassword -}}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
@@ -17,9 +17,9 @@ data:
|
||||
-Dalfresco.port={{ .Values.repository.service.externalPort }}
|
||||
-Dshare.host={{ template "content-services.fullname" . }}-share
|
||||
-Dshare.port={{ .Values.share.service.externalPort }}
|
||||
-Ddb.driver=org.postgresql.Driver
|
||||
-Ddb.username={{ .Values.postgresql.postgresUser }}
|
||||
-Ddb.password={{ .Values.postgresql.postgresPassword }}
|
||||
-Ddb.url=jdbc:postgresql://{{ .Release.Name }}-postgresql-acs:5432/{{ .Values.postgresql.postgresDatabase }}
|
||||
-Ddb.driver={{ template "database.driver" . }}
|
||||
-Ddb.username={{ template "database.user" . }}
|
||||
-Ddb.password={{ template "database.password" . }}
|
||||
-Ddb.url=jdbc:{{ .Values.database.type }}://{{ template "database.hostname" . }}:{{ template "database.port" . }}/{{ .Values.postgresql.postgresDatabase }}
|
||||
-Dsolr.host={{ template "content-services.fullname" . }}-solr
|
||||
-Dsolr.port={{ .Values.solr.service.externalPort }}"
|
||||
-Dsolr.port={{ .Values.solr.service.externalPort }}"
|
||||
|
@@ -29,6 +29,6 @@ spec:
|
||||
resources:
|
||||
{{ toYaml .Values.repository.resources | indent 12 }}
|
||||
initContainers:
|
||||
- name: init-postgres
|
||||
- name: init-db
|
||||
image: busybox
|
||||
command: ['sh', '-c', 'until nslookup {{ .Release.Name }}-postgresql-acs; do echo "waiting for postgres"; sleep 2; done;']
|
||||
command: ['sh', '-c', 'until nc -w1 {{ template "database.hostname" . }} {{ template "database.port" . }}; do echo "waiting for {{ .Values.database.type }}"; sleep 2; done;']
|
||||
|
@@ -82,5 +82,9 @@ postgresql:
|
||||
memory: "250Mi"
|
||||
limits:
|
||||
memory: "500Mi"
|
||||
driver: org.postgresql.Driver
|
||||
|
||||
database:
|
||||
type: postgresql
|
||||
|
||||
replicaCount: 1
|
||||
|
Reference in New Issue
Block a user