Created
July 4, 2021 02:26
-
-
Save nakamasato/4cd043c6cb757cca7acd518093cbafef to your computer and use it in GitHub Desktop.
Helm helpers example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{/* | |
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 "helm-example.fullname" -}} | |
{{- if .Values.fullnameOverride }} | |
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | |
{{- else }} | |
{{- $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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
metadata: | |
name: {{ include "helm-example.fullname" . }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment