2021-09-30 14:37:30 +02:00
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create the name of the service account to use
|
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "dashboard.serviceAccountName" -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- if .Values.serviceAccount.create -}}
|
|
|
|
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
|
|
|
|
{{- else -}}
|
|
|
|
{{ default "default" .Values.serviceAccount.name }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
2021-10-06 14:33:05 +02:00
|
|
|
Return the proper container image registry secret names
|
2021-09-30 14:37:30 +02:00
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "dashboard.imagePullSecrets" -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{ include "common.images.pullSecrets" (dict "images" (list .Values.image) "global" .Values.global) }}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
2021-10-06 14:38:20 +02:00
|
|
|
Return true if a secret object for backend should be created
|
2021-09-30 14:37:30 +02:00
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "backend.createSecret" -}}
|
|
|
|
{{- if or (not .Values.backend.existingSecret) (and (not .Values.backend.smtp.existingSecret) .Values.backend.smtp.password .Values.backend.smtp.enabled) }}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- true -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
2021-10-06 14:38:20 +02:00
|
|
|
Return the backend secret name
|
2021-09-30 14:37:30 +02:00
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "backend.secretName" -}}
|
|
|
|
{{- if .Values.backend.existingSecret }}
|
|
|
|
{{- printf "%s" .Values.backend.existingSecret -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- else -}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- printf "%s-backend" (include "common.names.fullname" .) -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
2021-10-06 14:38:20 +02:00
|
|
|
Return the backend SMTP secret name
|
2021-09-30 14:37:30 +02:00
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "backend.smtp.secretName" -}}
|
|
|
|
{{- if .Values.backend.smtp.existingSecret }}
|
|
|
|
{{- printf "%s" .Values.backend.smtp.existingSecret -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- else -}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- printf "%s-backend" (include "common.names.fullname" .) -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
2021-10-06 14:38:20 +02:00
|
|
|
Return true if backend SMTP uses password authentication
|
2021-09-30 14:37:30 +02:00
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "backend.smtp.password.enabled" -}}
|
|
|
|
{{- if and (or .Values.backend.smtp.password .Values.backend.smtp.existingSecret) .Values.backend.smtp.enabled }}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- true -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Get the user defined LoadBalancerIP for this release
|
|
|
|
Note, returns 127.0.0.1 if using ClusterIP.
|
|
|
|
*/}}
|
2021-11-22 15:43:51 +01:00
|
|
|
{{- define "dashboard.serviceIP" -}}
|
|
|
|
{{- if eq .Values.dashboard.service.type "ClusterIP" -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
127.0.0.1
|
|
|
|
{{- else -}}
|
2021-11-22 15:43:51 +01:00
|
|
|
{{- .Values.dashboard.service.loadBalancerIP | default "" -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Gets the host to be used for this application.
|
|
|
|
If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value will be empty
|
|
|
|
*/}}
|
2021-11-22 15:43:51 +01:00
|
|
|
{{- define "dashboard.host" -}}
|
|
|
|
{{- $host := .Values.dashboard.host | default "" -}}
|
|
|
|
{{- default (include "dashboard.serviceIP" .) $host -}}
|
2021-10-04 13:53:13 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Service name for the backend service
|
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "backend.serviceName" -}}
|
2021-10-04 13:53:13 +02:00
|
|
|
{{ include "common.names.fullname" . }}-backend
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
2021-11-22 15:43:51 +01:00
|
|
|
Service name for the dashboard service
|
2021-10-04 13:53:13 +02:00
|
|
|
*/}}
|
2021-11-22 15:43:51 +01:00
|
|
|
{{- define "dashboard.serviceName" -}}
|
2021-11-22 15:40:13 +01:00
|
|
|
{{ include "common.names.fullname" . }}
|
2021-10-04 13:53:13 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Get the user defined LoadBalancerIP for this release
|
|
|
|
Note, returns 127.0.0.1 if using ClusterIP.
|
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "backend.serviceIP" -}}
|
|
|
|
{{- if eq .Values.backend.service.type "ClusterIP" -}}
|
2021-10-04 13:53:13 +02:00
|
|
|
127.0.0.1
|
|
|
|
{{- else -}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- .Values.backend.service.loadBalancerIP | default "" -}}
|
2021-10-04 13:53:13 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Gets the host to be used for this application.
|
|
|
|
If not using ClusterIP, or if a host or LoadBalancerIP is not defined, the value will be empty
|
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "backend.host" -}}
|
|
|
|
{{- $host := .Values.backend.host | default "" -}}
|
|
|
|
{{- default (include "backend.serviceIP" .) $host -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
2021-11-22 15:43:51 +01:00
|
|
|
Return the proper dashboard image name
|
2021-09-30 14:37:30 +02:00
|
|
|
*/}}
|
2021-11-22 15:43:51 +01:00
|
|
|
{{- define "dashboard.image" -}}
|
|
|
|
{{ include "common.images.image" (dict "imageRoot" .Values.dashboard.image "global" .Values.global) }}
|
2021-09-30 16:03:54 +02:00
|
|
|
{{- end -}}
|
|
|
|
{{/*
|
2021-10-06 14:38:20 +02:00
|
|
|
Return the proper backend image name
|
2021-09-30 16:03:54 +02:00
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "backend.image" -}}
|
|
|
|
{{ include "common.images.image" (dict "imageRoot" .Values.backend.image "global" .Values.global) }}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Return the proper Storage Class
|
|
|
|
*/}}
|
2021-10-05 16:39:47 +02:00
|
|
|
{{- define "dashboard.storageClass" -}}
|
2021-09-30 14:37:30 +02:00
|
|
|
{{- include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) -}}
|
|
|
|
{{- end -}}
|