Skip to content

Commit

Permalink
Merge pull request #21 from colearendt/add-generic-extra
Browse files Browse the repository at this point in the history
add extraObjecs option for deploying things alongside the generic chart
  • Loading branch information
colearendt authored Jan 19, 2022
2 parents af8aec7 + 0d42272 commit 1aff38a
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/generic/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: generic
description: A generic Helm chart for Kubernetes

type: application
version: 0.1.3
version: 0.1.4
appVersion: latest
maintainers:
- name: colearendt
Expand Down
4 changes: 4 additions & 0 deletions charts/generic/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.1.4

- Add `extraObjects` for arbitrary deployment possibilities!

# 0.1.3

- Add `storage` values for setting a PersistentVolumeClaim
Expand Down
3 changes: 2 additions & 1 deletion charts/generic/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generic

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

A generic Helm chart for Kubernetes

Expand All @@ -19,6 +19,7 @@ A generic Helm chart for Kubernetes
| autoscaling.maxReplicas | int | `100` | |
| autoscaling.minReplicas | int | `1` | |
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| extraObjects | list | `[]` | Extra kubernetes objects to deploy (value evaluted as a template) |
| fullnameOverride | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"nginx"` | |
Expand Down
15 changes: 15 additions & 0 deletions charts/generic/ci/all-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,18 @@ nodeSelector: {}
tolerations: []

affinity: {}

extraObjects:
- apiVersion: v1
kind: ConfigMap
metadata:
name: "awesome"
data:
config: data
- |
apiVersion: v1
kind: ConfigMap
metadata:
name: "templating"
data:
something: {{ printf "special" }}
14 changes: 14 additions & 0 deletions charts/generic/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,17 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/* thanks to https://github.com/bitnami/charts/blob/master/bitnami/common/templates/_tplvalues.tpl */}}
{{/*
Renders a value that contains template.
Usage:
{{ include "generic.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "generic.tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/generic/templates/extra-objects.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraObjects }}
---
{{ include "generic.tplvalues.render" (dict "value" . "context" $) }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/generic/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ nodeSelector: {}
tolerations: []

affinity: {}

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

0 comments on commit 1aff38a

Please sign in to comment.