2018-08-18 05:08:03 +00:00
|
|
|
{{/*
|
|
|
|
Create a default fully qualified app name.
|
|
|
|
We truncate at 63 chars because some Kubernetes name fields are limited to
|
|
|
|
this (by the DNS naming spec). If release name contains chart name it will
|
|
|
|
be used as a full name.
|
|
|
|
*/}}
|
2018-09-28 20:56:48 +00:00
|
|
|
{{- define "vault.fullname" -}}
|
2018-08-18 21:38:33 +00:00
|
|
|
{{- if .Values.fullnameOverride -}}
|
|
|
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- else -}}
|
2018-08-18 05:08:03 +00:00
|
|
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
|
|
|
{{- if contains $name .Release.Name -}}
|
|
|
|
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2018-08-18 21:38:33 +00:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Create chart name and version as used by the chart label.
|
|
|
|
*/}}
|
2018-09-28 20:56:48 +00:00
|
|
|
{{- define "vault.chart" -}}
|
2018-08-18 21:38:33 +00:00
|
|
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/*
|
|
|
|
Expand the name of the chart.
|
|
|
|
*/}}
|
2018-09-28 20:56:48 +00:00
|
|
|
{{- define "vault.name" -}}
|
2018-08-18 21:38:33 +00:00
|
|
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
|
|
|
{{- end -}}
|
2018-08-18 05:08:03 +00:00
|
|
|
|
|
|
|
{{/*
|
|
|
|
Compute the maximum number of unavailable replicas for the PodDisruptionBudget.
|
|
|
|
This defaults to (n/2)-1 where n is the number of members of the server cluster.
|
|
|
|
*/}}
|
2018-09-28 20:56:48 +00:00
|
|
|
{{- define "vault.pdb.maxUnavailable" -}}
|
2018-11-30 22:29:46 +00:00
|
|
|
{{- if .Values.serverHA.disruptionBudget.maxUnavailable -}}
|
|
|
|
{{ .Values.serverHA.disruptionBudget.maxUnavailable -}}
|
2018-08-18 05:08:03 +00:00
|
|
|
{{- else -}}
|
2018-11-30 22:29:46 +00:00
|
|
|
{{- ceil (sub (div (int .Values.serverHA.replicas) 2) 1) -}}
|
2018-08-18 05:08:03 +00:00
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|