Files
wordyne/Chart/templates/_helpers.tpl

73 lines
2.2 KiB
Smarty
Raw Normal View History

2023-03-17 23:13:46 +00:00
{{/*
2023-03-18 23:16:04 +00:00
Define the application name and fullname
2023-03-17 23:13:46 +00:00
*/}}
2023-03-18 23:16:04 +00:00
2023-03-17 23:13:46 +00:00
{{- define "..name" -}}
2023-09-12 15:45:08 +02:00
{{- .Values.site.name | trunc 63 }}
2023-03-17 23:13:46 +00:00
{{- end }}
{{- define "..fullname" -}}
2023-03-18 23:16:04 +00:00
{{ include "..name" . }}
2023-03-17 23:13:46 +00:00
{{- end }}
2023-09-12 15:45:08 +02:00
{{- define "..domains" }}
{{- if .Values.site.additionalDomains }}{{ .Values.site.additionalDomains | toYaml }}{{- end }}
- {{ .Values.site.domain | replace "www." "" }}
{{- end }}
2023-06-03 22:01:56 +00:00
{{- define "..resourcelimits" -}}
resources:
limits:
cpu: {{ .Values.site.resources.cpu.peak }}
memory: {{ .Values.site.resources.mem.peak }}
requests:
cpu: {{ .Values.site.resources.cpu.avg }}
memory: {{ .Values.site.resources.mem.avg }}
{{- end }}
2023-03-17 23:13:46 +00:00
{{/*
2023-03-18 23:16:04 +00:00
Define the chart name and version
2023-03-17 23:13:46 +00:00
*/}}
2023-03-18 23:16:04 +00:00
2023-03-17 23:13:46 +00:00
{{- define "..chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
2023-03-18 23:16:04 +00:00
Define the chart common labels
2023-03-17 23:13:46 +00:00
*/}}
{{- define "..labels" -}}
helm.sh/chart: {{ include "..chart" . }}
app.kubernetes.io/name: {{ include "..name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
2023-03-18 23:16:04 +00:00
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
2023-09-12 15:45:08 +02:00
cloudyne.systems/customer: {{ .Values.customer.legalName | replace " " "-" | replace "," "" | trunc 63 | trimSuffix "-" | quote }}
cloudyne.systems/customer-legal-id: '{{ .Values.customer.legalId }}'
cloudyne.systems/site: {{ .Values.site.domain | quote }}
{{- end }}
{{- define "..selector-labels" -}}
cloudyne.systems/customer: {{ .Values.customer.legalName | replace " " "-" | replace "," "" | trunc 63 | trimSuffix "-" | quote }}
cloudyne.systems/site: {{ .Values.site.domain | quote }}
2023-09-23 13:41:10 +00:00
cloudyne.systems/component: site
2023-03-17 23:13:46 +00:00
{{- end }}
{{- define "..affinity-labels" -}}
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
2023-09-23 13:23:44 +00:00
- key: cloudyne.systems/customer
operator: In
values:
- {{ .Values.customer.legalName | replace " " "-" | replace "," "" | trunc 63 | trimSuffix "-" | quote }}
- key: cloudyne.systems/site
operator: In
values:
- {{ .Values.site.domain | quote }}
- key: cloudyne.systems/component
operator: In
values:
- "site"
2023-09-23 13:26:34 +00:00
topologyKey: kubernetes.io/hostname
{{- end }}