diff options
author | Alexis de Talhouƫt <alexis.de_talhouet@bell.ca> | 2018-02-23 20:53:58 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-02-23 20:53:58 +0000 |
commit | f50dccfd3067116ccbf9e26aef6d9b5aa13f85fd (patch) | |
tree | 3a5369ec1040909930c97ddcc06a26b42166fdf6 /kubernetes/common/common-templates/templates | |
parent | 799ae16776823e5f12412eab4bd21368480d682e (diff) | |
parent | 3e7dc64805fbfc378290c32e8d4de39c3602e66e (diff) |
Merge "Add common helm chart"
Diffstat (limited to 'kubernetes/common/common-templates/templates')
-rw-r--r-- | kubernetes/common/common-templates/templates/_name.tpl | 15 | ||||
-rw-r--r-- | kubernetes/common/common-templates/templates/_namespace.tpl | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/kubernetes/common/common-templates/templates/_name.tpl b/kubernetes/common/common-templates/templates/_name.tpl new file mode 100644 index 0000000000..f6c221f15d --- /dev/null +++ b/kubernetes/common/common-templates/templates/_name.tpl @@ -0,0 +1,15 @@ +{{/* + Expand the name of a chart. +*/}} +{{- define "common.name" -}} + {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* + Create a default fully qualified application name. + Truncated at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "common.fullname" -}} + {{- $name := default .Chart.Name .Values.nameOverride -}} + {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}}
\ No newline at end of file diff --git a/kubernetes/common/common-templates/templates/_namespace.tpl b/kubernetes/common/common-templates/templates/_namespace.tpl new file mode 100644 index 0000000000..076fd53f7a --- /dev/null +++ b/kubernetes/common/common-templates/templates/_namespace.tpl @@ -0,0 +1,13 @@ +{{/* + Resolve the namespace to apply to a chart. The default namespace suffix + is the name of the chart. This can be overridden if necessary (eg. for subcharts) + using the following value: + + - .Values.nsPrefix : override namespace prefix + - .Values.nsSuffix : override namespace suffix +*/}} +{{- define "common.namespace" -}} + {{- $prefix := default .Release.Name .Values.nsPrefix -}} + {{- $suffix := default .Chart.Name .Values.nsSuffix -}} + {{- printf "%s-%s" $prefix $suffix -}} +{{- end -}} |