Skip to content

Commit

Permalink
Add parameters "extraLabels" and "extraLabelsSelector" to allow users…
Browse files Browse the repository at this point in the history
… to specify their own set of labels for the deployment and pods (#25)
  • Loading branch information
patrickdmw authored Jul 24, 2024
1 parent 6170a61 commit 924abb6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions helm/hybrid-cloud-postgresql-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ helm.sh/chart: {{ include "operator.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- range $key, $value := .Values.extraLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}

{{/*
Expand All @@ -48,6 +51,9 @@ Selector labels
{{- define "operator.selectorLabels" -}}
app.kubernetes.io/name: {{ include "operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- range $key, $value := .Values.extraLabelsSelector }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}

{{/*
Expand Down
9 changes: 9 additions & 0 deletions helm/hybrid-cloud-postgresql-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ envSecret: null
# A list of environment variables (with name, value) to provide to the operator
extraEnv: []

# provide users with the option to add additional common labels to the deployment
# NOTE that all additional selector labels from `extraLabelsSelector` are already included in the "common" labels
# and can not be added twice
extraLabels: {}
# provide users with the option to add additional selector labels to deployment and its pods
# NOTE that selector labels are immutable once the deployment was created
# so adding new ones requires deleting the deployment first
extraLabelsSelector: {}

# List of volumes to mount into the operator pod
volumes: []
# List of volume mounts for the operator pod
Expand Down

0 comments on commit 924abb6

Please sign in to comment.