Skip to content

Commit

Permalink
Tenant chart: : add extra resources capability (#1643)
Browse files Browse the repository at this point in the history
This commit introduces an extraResources value which is directly
rendered as part of the chart like a regular Helm template.
This allows users to add some Kubernetes object they might need as part
of their cluster configuration.
I added in the comment an example of my use case because I use a
different type of ingress and it is easier to configure it this way.

Closes: #1642

Co-authored-by: Pedro Juarez <pjuarezd@users.noreply.github.com>
  • Loading branch information
IxDay and pjuarezd authored Jun 27, 2023
1 parent 40465cb commit c737cd0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions helm/tenant/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,17 @@ Selector labels Operator
app.kubernetes.io/name: {{ include "minio-operator.name" . }}
app.kubernetes.io/instance: {{ printf "%s-%s" .Release.Name "console" }}
{{- end -}}


{{/*
Renders a value that contains template.
Usage:
{{ include "minio-operator.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "minio-operator.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions helm/tenant/templates/extra-resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraResources }}
---
{{- include "minio-operator.render" (dict "value" . "context" $) }}
{{- end }}

0 comments on commit c737cd0

Please sign in to comment.