Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Feature - Added the option to add common labels for all resources #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions charts/cron-job/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ helm.sh/chart: {{ include "helm-chart.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- range $key, $value := .Values.commonLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}

{{/*
Expand Down
4 changes: 4 additions & 0 deletions charts/cron-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ command: |
overrideCommand: true
shell: "/bin/sh"

# commonLabels:
# label1: value1
# label2: value2

nameOverride: ""
fullnameOverride: ""

Expand Down
3 changes: 3 additions & 0 deletions charts/namespaces/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ helm.sh/chart: {{ include "helm-chart.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- range $key, $value := .Values.commonLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}

{{/*
Expand Down
3 changes: 3 additions & 0 deletions charts/onechart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ helm.sh/chart: {{ include "helm-chart.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- range $key, $value := .Values.commonLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}

{{/*
Expand Down
5 changes: 5 additions & 0 deletions charts/onechart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ image:
# vars:
# MY_VAR: "value"

# commonLabels:
# label1: value1
# label2: value2

replicas: 1

nameOverride: ""
Expand Down Expand Up @@ -80,3 +84,4 @@ monitor:

container: {}
podSpec: {}

3 changes: 3 additions & 0 deletions charts/static-site/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ Create chart name and version as used by the chart label.
Common labels
*/}}
{{- define "staticSite.labels" -}}
{{- range $key, $value := .Values.commonLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
helm.sh/chart: {{ include "staticSite.chart" . }}
{{ include "staticSite.selectorLabels" . }}
{{- if .Chart.AppVersion }}
Expand Down
4 changes: 4 additions & 0 deletions values-cron-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ volumes:
path: /data
size: 10Gi
storageClass: default

commonLabels:
label1: value1
label2: value2
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ probe:

podSpec:
hostNetwork: true

commonLabels:
label1: value1
label2: value2