openbao-helm/templates/_helpers.tpl

45 lines
1.4 KiB
Smarty
Raw Normal View History

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.
*/}}
{{- define "vault.fullname" -}}
{{- 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 -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "vault.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "vault.name" -}}
{{- 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.
*/}}
{{- define "vault.pdb.maxUnavailable" -}}
{{- if .Values.serverHA.disruptionBudget.maxUnavailable -}}
{{ .Values.serverHA.disruptionBudget.maxUnavailable -}}
2018-08-18 05:08:03 +00:00
{{- else -}}
{{- ceil (sub (div (int .Values.serverHA.replicas) 2) 1) -}}
2018-08-18 05:08:03 +00:00
{{- end -}}
{{- end -}}