Skip to content

Commit

Permalink
Extra objects templating (#284)
Browse files Browse the repository at this point in the history
* Template priorityexpander values

* Add extraObjects values

* Upgrade helm chart to 3.0.0
  • Loading branch information
vincentmrg authored Apr 22, 2024
1 parent 6d60560 commit 29dec5b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion helm/kubestitute/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: kubestitute
type: application
version: 2.3.0
version: 3.0.0
appVersion: "2.2.0"
description: Kubestitute is an event based instances lifecycle manager for Kubernetes.
home: https://github.com/quortex/kubestitute
Expand Down
3 changes: 2 additions & 1 deletion helm/kubestitute/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# kubestitute

![Version: 2.3.0](https://img.shields.io/badge/Version-2.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.2.0](https://img.shields.io/badge/AppVersion-2.2.0-informational?style=flat-square)
![Version: 3.0.0](https://img.shields.io/badge/Version-3.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.2.0](https://img.shields.io/badge/AppVersion-2.2.0-informational?style=flat-square)

Kubestitute is an event based instances lifecycle manager for Kubernetes.

Expand Down Expand Up @@ -117,6 +117,7 @@ helm install kubestitute kubestitute/kubestitute -n kubestitute-system
| serviceMonitor.interval | string | `""` | Override prometheus operator scrapping interval. |
| serviceMonitor.scrapeTimeout | string | `""` | Override prometheus operator scrapping timeout. |
| serviceMonitor.relabelings | list | `[]` | Relabellings to apply to samples before scraping. |
| extraObjects | list | `[]` | Extra objects to deploy (value evaluated as a template). |

## Maintainers

Expand Down
11 changes: 11 additions & 0 deletions helm/kubestitute/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,14 @@ app.kubernetes.io/name: {{ include "kubestitute.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
control-plane: controller-manager
{{- end -}}

{{/*
Renders a complete tree, even values that contains template.
*/}}
{{- define "kubestitute.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{ else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions helm/kubestitute/templates/extraObjects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraObjects }}
---
{{ include "kubestitute.render" (dict "value" . "context" $) }}
{{- end }}
2 changes: 1 addition & 1 deletion helm/kubestitute/templates/priorityexpander.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
name: {{ .name }}
namespace: {{ .namespace }}
spec:
template: {{ toYaml .template | indent 4 }}
template: {{ toYaml (tpl .template $) | indent 4 }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions helm/kubestitute/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,6 @@ serviceMonitor:
scrapeTimeout: ""
# -- Relabellings to apply to samples before scraping.
relabelings: []

# -- Extra objects to deploy (value evaluated as a template).
extraObjects: []

0 comments on commit 29dec5b

Please sign in to comment.