Skip to content

Commit ff4b771

Browse files
committed
enix#84 Add labels for cluster
1 parent e13fe61 commit ff4b771

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

charts/cnpg-cluster/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: cnpg-cluster
33
description: A Helm chart to create cloudnative-pg.io clusters
44
type: application
5-
version: 2.0.1
5+
version: 2.0.2
66
appVersion: "14.5-6"

charts/cnpg-cluster/templates/_helpers.tpl

+4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ Common labels
3535
*/}}
3636
{{- define "cnpg-cluster.labels" -}}
3737
helm.sh/chart: {{ include "cnpg-cluster.chart" . }}
38+
{{- if and (hasKey .Values "labels") (.Values.labels) }}
39+
{{ toYaml .Values.labels }}
40+
{{- else }}
3841
{{ include "cnpg-cluster.selectorLabels" . }}
3942
{{- if .Chart.AppVersion }}
4043
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4144
{{- end }}
4245
app.kubernetes.io/managed-by: {{ .Release.Service }}
46+
{{- end -}}
4347
{{- end }}
4448

4549
{{/*

charts/cnpg-cluster/values.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ nameOverride: ""
2828
# -- String to fully override cnpg-cluster.fullname template with a string
2929
fullnameOverride: ""
3030

31+
# -- Labels for the cluster
32+
# This field allows adding extra labels to cluster.
33+
# Note: The following labels cannot be set through this field, as they are reserved:
34+
# - helm.sh/chart
35+
# Attempting to use these labels will be cause a conflict.
36+
labels:
37+
# app.kubernetes.io/name: monkey-cluster
38+
# app.kubernetes.io/instance: monkey-moon
39+
# env: production
40+
3141
# -- CPU/Memory resource requests/limits
3242
resources: {}
3343
# We usually recommend not to specify default resources and to leave this as a conscious

0 commit comments

Comments
 (0)