I am starting to write steering charts for our services.
There are two things that I don’t know how they should work or what to do with them.
First: release name. When you install the chart, you specify the name that helm uses to create the release. Is this release name often referenced in the chart to properly isolate the chart settings from each other? For example, a postgres diagram contains:
{{- define "postgresql.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Which is then used for the service:
metadata:
name: {{ template "postgresql.fullname" . }}
After all, in kubernetes it looks like "myrelease-postgresql". I wonder what a good release name is? What is commonly used for this? Version? Or some codename like Ubuntu releases?
Second: value references.
postgresql -. postgresql (. ).
, {{template "postgresql.fullname". }} ? ( , , ).
:
env:
- name: DB_HOST
value: {{ template "mychart.postgresql.fullname" . }}
:
template "mychart.postgresql.fullname" not defined
, , , odoo. postgresql .
? ?
!
:
Subcharts Globals .
:
_helpers.tpl () postgres:
{{- define "postgresql.fullname" -}}
{{- $name := .Values.global.name -}}
{{- printf "%s-%s" $name "postgresql" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
, . , - - .
, , .
, : -/