diff --git a/kubernetes/helm/docspell/templates/_configs.tpl b/kubernetes/helm/docspell/templates/_configs.tpl index ccfcf1cb..535851a3 100644 --- a/kubernetes/helm/docspell/templates/_configs.tpl +++ b/kubernetes/helm/docspell/templates/_configs.tpl @@ -1,3 +1,12 @@ +{{/*Postgres Access*/}} +{{- define "postgresql.jdbcUrl" -}} +{{- if (index .Values "postgresql").enabled -}} +{{- $port := .Values.postgresql.global.postgresql.service.postgresql | toString -}} +{{- $database := .Values.postgresql.global.postgresql.auth.database -}} +{{- printf "jdbc:postgresql://%s-postgresql:%s/%s" .Release.Name $port $database -}} +{{- end -}} +{{- end -}} + {{/*JDBC Connection*/}} {{- define "docspell.secrets.JDBC" -}} {{- if .context.Values.postgresql.enabled -}} diff --git a/kubernetes/helm/docspell/templates/_helpers.tpl b/kubernetes/helm/docspell/templates/_helpers.tpl index 611aef1b..aef2b553 100644 --- a/kubernetes/helm/docspell/templates/_helpers.tpl +++ b/kubernetes/helm/docspell/templates/_helpers.tpl @@ -1,6 +1,4 @@ -{{/* -Expand the name of the chart. -*/}} +{{/*Expand the name of the chart.*/}} {{- define "docspell.name" -}} {{- .Chart.Name | trunc 63 | trimSuffix "-" }} {{- end }} @@ -19,16 +17,12 @@ If release name contains chart name it will be used as a full name. {{- end }} {{- end }} -{{/* -Create chart name and version as used by the chart label. -*/}} +{{/*Create chart name and version as used by the chart label.*/}} {{- define "docspell.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} -{{/* -Docker Image Registry Secret Names evaluating values as templates -*/}} +{{/*Docker Image Registry Secret Names evaluating values as templates*/}} {{- define "docspell.images.pullSecrets" -}} {{- $pullSecrets := .Values.global.imagePullSecrets -}} {{- range .Values.global.imagePullSecrets -}} @@ -40,9 +34,7 @@ imagePullSecrets: {{- end -}} {{- end -}} -{{/* -Common labels -*/}} +{{/*Common labels*/}} {{- define "docspell.labels" -}} helm.sh/chart: {{ include "docspell.chart" . }} {{ include "docspell.selectorLabels" . }} @@ -52,29 +44,13 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} -{{/* -Selector labels -*/}} +{{/*Selector labels*/}} {{- define "docspell.selectorLabels" -}} app.kubernetes.io/name: {{ include "docspell.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{/* -Postgres Access -*/}} - -{{- define "postgresql.jdbcUrl" -}} -{{- if (index .Values "postgresql").enabled -}} -{{- $port := .Values.postgresql.global.postgresql.service.postgresql | toString -}} -{{- $database := .Values.postgresql.global.postgresql.auth.database -}} -{{- printf "jdbc:postgresql://%s-postgresql:%s/%s" .Release.Name $port $database -}} -{{- end -}} -{{- end -}} - -{{/* -Create the name of the service account to use -*/}} +{{/*Create the name of the service account to use*/}} {{- define "docspell.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} {{- default (include "docspell.fullname" .) .Values.serviceAccount.name }} diff --git a/kubernetes/helm/docspell/templates/db-secret.yaml b/kubernetes/helm/docspell/templates/db-secret.yaml deleted file mode 100644 index 6305edeb..00000000 --- a/kubernetes/helm/docspell/templates/db-secret.yaml +++ /dev/null @@ -1,10 +0,0 @@ -kind: Secret -apiVersion: v1 -metadata: - name: {{ include "docspell.fullname" . }}-db-secret - labels: - {{- include "docspell.labels" . | nindent 4 }} -stringData: - postgres-database: {{ .Values.postgresql.global.postgresql.auth.database }} - postgres-username: {{ .Values.postgresql.global.postgresql.auth.username }} - postgres-password: {{ .Values.postgresql.global.postgresql.auth.password }} \ No newline at end of file diff --git a/kubernetes/helm/docspell/templates/joex/_helpers.tpl b/kubernetes/helm/docspell/templates/joex/_helpers.tpl index 637ae330..dd95d8af 100644 --- a/kubernetes/helm/docspell/templates/joex/_helpers.tpl +++ b/kubernetes/helm/docspell/templates/joex/_helpers.tpl @@ -1,6 +1,4 @@ -{{/* -Common labels -*/}} +{{/*Common labels*/}} {{- define "joex.labels" -}} helm.sh/chart: {{ include "docspell.chart" . }} app: {{ include "docspell.name" . }}-joex @@ -10,17 +8,13 @@ version: {{ .Values.joex.image.tag | default .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} -{{/* -Selector labels -*/}} +{{/*Selector labels*/}} {{- define "joex.selectorLabels" -}} app.kubernetes.io/name: {{ include "docspell.name" . }}-joex app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{/* -Create joex image name and tag used by the deployment -*/}} +{{/*Create joex image name and tag used by the deployment*/}} {{- define "joex.image" -}} {{- $registry := .Values.global.imageRegistry | default .Values.joex.image.registry -}} {{- $repository := .Values.joex.image.repository -}} diff --git a/kubernetes/helm/docspell/templates/restserver/_helpers.tpl b/kubernetes/helm/docspell/templates/restserver/_helpers.tpl index b94b0c18..47b84c6d 100644 --- a/kubernetes/helm/docspell/templates/restserver/_helpers.tpl +++ b/kubernetes/helm/docspell/templates/restserver/_helpers.tpl @@ -1,6 +1,4 @@ -{{/* -Common labels -*/}} +{{/*Common labels*/}} {{- define "restserver.labels" -}} helm.sh/chart: {{ include "docspell.chart" . }} app: {{ include "docspell.name" . }}-restserver @@ -10,17 +8,13 @@ version: {{ .Values.restserver.image.tag | default .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} -{{/* -Selector labels -*/}} +{{/*Selector labels*/}} {{- define "restserver.selectorLabels" -}} app.kubernetes.io/name: {{ include "docspell.name" . }}-restserver app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{/* -Create restserver image name and tag used by the deployment -*/}} +{{/*Create restserver image name and tag used by the deployment*/}} {{- define "restserver.image" -}} {{- $registry := .Values.global.imageRegistry | default .Values.restserver.image.registry -}} {{- $repository := .Values.restserver.image.repository -}} diff --git a/kubernetes/helm/docspell/templates/solr/_helpers.tpl b/kubernetes/helm/docspell/templates/solr/_helpers.tpl index 5196d57d..e294743d 100644 --- a/kubernetes/helm/docspell/templates/solr/_helpers.tpl +++ b/kubernetes/helm/docspell/templates/solr/_helpers.tpl @@ -1,6 +1,4 @@ -{{/* -Common labels -*/}} +{{/*Common labels*/}} {{- define "solr.labels" -}} helm.sh/chart: {{ include "docspell.chart" . }} app: {{ include "docspell.name" . }}-solr @@ -10,17 +8,13 @@ version: {{ .Values.solr.image.tag | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} -{{/* -Selector labels -*/}} +{{/*Selector labels*/}} {{- define "solr.selectorLabels" -}} app.kubernetes.io/name: {{ include "docspell.name" . }}-solr app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{/* -Create solr image name and tag used by the deployment -*/}} +{{/*Create solr image name and tag used by the deployment*/}} {{- define "solr.image" -}} {{- $registry := .Values.global.imageRegistry | default .Values.solr.image.registry -}} {{- $repository := .Values.solr.image.repository -}} @@ -33,18 +27,14 @@ Create solr image name and tag used by the deployment {{- end -}} {{- end -}} -{{/* -Connection URL -*/}} +{{/*Connection URL*/}} {{- define "solr.url" -}} {{- $port := .Values.solr.service.port | toString -}} {{- $service := printf "%s-solr" (include "docspell.fullname" .) -}} {{- printf "http://%s:%s/solr/docspell" $service $port -}} {{- end }} -{{/* -Storage Class -*/}} +{{/*Storage Class*/}} {{- define "solr.persistence.storageClass" -}} {{- $storageClass := .Values.solr.persistence.storageClass | default .Values.global.storageClass -}} {{- if $storageClass -}}