Add named sizes table (tiny/small/medium/large)

This commit is contained in:
git_admin
2026-04-26 20:04:39 +03:00
parent a915b31588
commit 97666c4e2f
4 changed files with 58 additions and 16 deletions

View File

@@ -18,6 +18,18 @@ app.kubernetes.io/version: {{ .Values.odoo.tag | quote }}
odoosky.io/component: instance
{{- end -}}
{{/*
Resources for a given role (`odoo` | `postgres`), looked up against
the `sizes` table by `instance.size`. Falls back to "small" if the
operator picked a name that doesn't exist (defensive: a typo
shouldn't blow up the rendered chart).
*/}}
{{- define "instance.resources" -}}
{{- $size := .Values.instance.size | default "small" -}}
{{- $cfg := index .Values.sizes $size | default (index .Values.sizes "small") -}}
{{- toYaml (index $cfg .role) -}}
{{- end -}}
{{/*
Postgres password. Looks up the existing Secret on upgrades; uses
.Values.postgres.password if set; otherwise generates a 32-char