Skip to content

Commit 3af35f9

Browse files
authoredAug 22, 2023
[bitnami/metallb] Support for customizing standard labels (#18333)
1 parent ad24bd1 commit 3af35f9

20 files changed

+74
-177
lines changed
 

‎bitnami/metallb/Chart.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: common
33
repository: oci://registry-1.docker.io/bitnamicharts
4-
version: 2.8.0
5-
digest: sha256:0119fce6b509ebf3eaf5218f87f6ec0af64ec7da15f272115673b0716c4b6919
6-
generated: "2023-08-17T14:13:09.423737398Z"
4+
version: 2.9.0
5+
digest: sha256:416ad278a896f0e9b51d5305bef5d875c7cca6fbb64b75e1f131b04763e2aff9
6+
generated: "2023-08-22T14:16:03.110856+02:00"

‎bitnami/metallb/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ maintainers:
3434
url: https://github.com/bitnami/charts
3535
name: metallb
3636
sources:
37-
- https://github.com/bitnami/charts/tree/main/bitnami/metallb
38-
version: 4.6.5
37+
- https://github.com/bitnami/charts/tree/main/bitnami/metallb
38+
version: 4.7.0

‎bitnami/metallb/templates/controller/configmap.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ kind: ConfigMap
99
metadata:
1010
name: {{ include "metallb.configMapName" . }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" . | nindent 4 }}
13-
{{- if .Values.commonLabels }}
14-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
15-
{{- end }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1613
{{- if .Values.commonAnnotations }}
1714
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1815
{{- end }}

‎bitnami/metallb/templates/controller/deployment.yaml

+6-11
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ kind: Deployment
88
metadata:
99
name: {{ printf "%s-controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
1010
namespace: {{ include "common.names.namespace" . | quote }}
11-
labels: {{- include "common.labels.standard" . | nindent 4 }}
11+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1212
app.kubernetes.io/component: controller
13-
{{- if .Values.commonLabels }}
14-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
15-
{{- end }}
1613
{{- if .Values.commonAnnotations }}
1714
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1815
{{- end }}
@@ -22,16 +19,14 @@ spec:
2219
strategy: {{- toYaml .Values.controller.updateStrategy | nindent 4 }}
2320
{{- end }}
2421
revisionHistoryLimit: {{ .Values.controller.revisionHistoryLimit }}
22+
{{- $podLabels := merge .Values.controller.podLabels .Values.commonLabels }}
2523
selector:
26-
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
24+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
2725
app.kubernetes.io/component: controller
2826
template:
2927
metadata:
30-
labels: {{- include "common.labels.standard" . | nindent 8 }}
28+
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
3129
app.kubernetes.io/component: controller
32-
{{- if .Values.controller.podLabels }}
33-
{{- include "common.tplvalues.render" (dict "value" .Values.controller.podLabels "context" $) | nindent 8 }}
34-
{{- end }}
3530
{{- if .Values.controller.podAnnotations }}
3631
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.controller.podAnnotations "context" $) | nindent 8 }}
3732
{{- end }}
@@ -50,8 +45,8 @@ spec:
5045
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.controller.affinity "context" $) | nindent 8 }}
5146
{{- else }}
5247
affinity:
53-
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.controller.podAffinityPreset "component" "controller" "context" $) | nindent 10 }}
54-
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.controller.podAntiAffinityPreset "component" "controller" "context" $) | nindent 10 }}
48+
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.controller.podAffinityPreset "component" "controller" "customLabels" $podLabels "context" $) | nindent 10 }}
49+
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.controller.podAntiAffinityPreset "component" "controller" "customLabels" $podLabels "context" $) | nindent 10 }}
5550
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.controller.nodeAffinityPreset.type "key" .Values.controller.nodeAffinityPreset.key "values" .Values.controller.nodeAffinityPreset.values) | nindent 10 }}
5651
{{- end }}
5752
{{- if .Values.controller.tolerations }}

‎bitnami/metallb/templates/networkpolicy.yaml ‎bitnami/metallb/templates/controller/networkpolicy.yaml

+3-5
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }}
99
metadata:
1010
name: {{ printf "%s-controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" . | nindent 4 }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1313
app.kubernetes.io/component: controller
14-
{{- if .Values.commonLabels }}
15-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
16-
{{- end }}
1714
{{- if .Values.commonAnnotations }}
1815
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1916
{{- end }}
2017
spec:
18+
{{- $podLabels := merge .Values.controller.podLabels .Values.commonLabels }}
2119
podSelector:
22-
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
20+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
2321
app.kubernetes.io/component: controller
2422
policyTypes:
2523
- Ingress

‎bitnami/metallb/templates/controller/psp.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ kind: PodSecurityPolicy
1010
metadata:
1111
name: {{ printf "%s-controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
1212
namespace: {{ include "common.names.namespace" . | quote }}
13-
labels: {{- include "common.labels.standard" . | nindent 4 }}
13+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1414
app.kubernetes.io/component: controller
15-
{{- if .Values.commonLabels }}
16-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
17-
{{- end }}
1815
{{- if .Values.commonAnnotations }}
1916
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
2017
{{- end }}

‎bitnami/metallb/templates/controller/rbac.yaml

+4-16
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
88
kind: ClusterRole
99
metadata:
1010
name: {{ printf "%s:controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
11-
labels: {{- include "common.labels.standard" . | nindent 4 }}
11+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1212
app.kubernetes.io/component: controller
13-
{{- if .Values.commonLabels }}
14-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
15-
{{- end }}
1613
{{- if .Values.commonAnnotations }}
1714
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1815
{{- end }}
@@ -93,11 +90,8 @@ kind: Role
9390
metadata:
9491
name: {{ printf "%s-controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
9592
namespace: {{ include "common.names.namespace" . | quote }}
96-
labels: {{- include "common.labels.standard" . | nindent 4 }}
93+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
9794
app.kubernetes.io/component: controller
98-
{{- if .Values.commonLabels }}
99-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
100-
{{- end }}
10195
{{- if .Values.commonAnnotations }}
10296
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
10397
{{- end }}
@@ -198,11 +192,8 @@ apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
198192
kind: ClusterRoleBinding
199193
metadata:
200194
name: {{ printf "%s:controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
201-
labels: {{- include "common.labels.standard" . | nindent 4 }}
195+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
202196
app.kubernetes.io/component: controller
203-
{{- if .Values.commonLabels }}
204-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
205-
{{- end }}
206197
{{- if .Values.commonAnnotations }}
207198
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
208199
{{- end }}
@@ -220,11 +211,8 @@ kind: RoleBinding
220211
metadata:
221212
name: {{ printf "%s-controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
222213
namespace: {{ include "common.names.namespace" . | quote }}
223-
labels: {{- include "common.labels.standard" . | nindent 4 }}
214+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
224215
app.kubernetes.io/component: controller
225-
{{- if .Values.commonLabels }}
226-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
227-
{{- end }}
228216
{{- if .Values.commonAnnotations }}
229217
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
230218
{{- end }}

‎bitnami/metallb/templates/controller/service.yaml

+7-12
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,17 @@ kind: Service
99
metadata:
1010
name: {{ printf "%s-controller-metrics" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" . | nindent 4 }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1313
app.kubernetes.io/component: controller
14-
{{- if .Values.commonLabels }}
15-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
16-
{{- end }}
17-
annotations:
18-
{{- if .Values.commonAnnotations }}
19-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
20-
{{- end }}
21-
{{- if .Values.controller.metrics.service.annotations }}
22-
{{- include "common.tplvalues.render" ( dict "value" .Values.controller.metrics.service.annotations "context" $ ) | nindent 4 }}
23-
{{- end }}
14+
{{- if or .Values.controller.metrics.service.annotations .Values.commonAnnotations }}
15+
{{- $annotations := merge .Values.controller.metrics.service.annotations .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
17+
{{- end }}
2418
spec:
2519
type: ClusterIP
2620
clusterIP: "None"
27-
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
21+
{{- $podLabels := merge .Values.controller.podLabels .Values.commonLabels }}
22+
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
2823
app.kubernetes.io/component: controller
2924
ports:
3025
- name: metrics

‎bitnami/metallb/templates/controller/serviceaccount.yaml

+3-11
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,11 @@ kind: ServiceAccount
99
metadata:
1010
name: {{ include "metallb.controller.serviceAccountName" . }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" . | nindent 4 }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1313
app.kubernetes.io/component: controller
14-
{{- if .Values.commonLabels }}
15-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
16-
{{- end }}
1714
{{- if or .Values.controller.serviceAccount.annotations .Values.commonAnnotations }}
18-
annotations:
19-
{{- if .Values.commonAnnotations }}
20-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
21-
{{- end }}
22-
{{- if .Values.controller.serviceAccount.annotations }}
23-
{{- include "common.tplvalues.render" (dict "value" .Values.controller.serviceAccount.annotations "context" $) | nindent 4 }}
24-
{{- end }}
15+
{{- $annotations := merge .Values.controller.serviceAccount.annotations .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
2517
{{- end }}
2618
automountServiceAccountToken: {{ .Values.controller.serviceAccount.automountServiceAccountToken }}
2719
{{- end -}}

‎bitnami/metallb/templates/controller/servicemonitor.yaml

+7-17
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,17 @@ apiVersion: monitoring.coreos.com/v1
88
kind: ServiceMonitor
99
metadata:
1010
name: {{ printf "%s-controller" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
11-
{{- if .Values.controller.metrics.serviceMonitor.namespace }}
12-
namespace: {{ .Values.controller.metrics.serviceMonitor.namespace | quote }}
13-
{{- else }}
14-
namespace: {{ include "common.names.namespace" . | quote }}
15-
{{- end }}
16-
labels: {{- include "common.labels.standard" . | nindent 4 }}
11+
namespace: {{ default .Release.Namespace .Values.controller.metrics.serviceMonitor.namespace | quote }}
12+
{{- $labels := merge .Values.controller.metrics.serviceMonitor.labels .Values.commonLabels }}
13+
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
1714
app.kubernetes.io/component: controller
18-
{{- if .Values.commonLabels }}
19-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
20-
{{- end }}
21-
{{- if .Values.controller.metrics.serviceMonitor.labels }}
22-
{{- include "common.tplvalues.render" ( dict "value" .Values.controller.metrics.serviceMonitor.labels "context" $ ) | nindent 4 }}
23-
{{- end }}
24-
annotations:
25-
{{- if .Values.commonAnnotations }}
26-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
27-
{{- end }}
15+
{{- if .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
17+
{{- end }}
2818
spec:
2919
jobLabel: {{ .Values.controller.metrics.serviceMonitor.jobLabel | quote }}
3020
selector:
31-
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
21+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
3222
app.kubernetes.io/component: controller
3323
{{- if .Values.controller.metrics.serviceMonitor.selector }}
3424
{{- include "common.tplvalues.render" (dict "value" .Values.controller.metrics.serviceMonitor.selector "context" $) | nindent 6 }}

‎bitnami/metallb/templates/controller/webhooks.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ apiVersion: admissionregistration.k8s.io/v1
77
kind: ValidatingWebhookConfiguration
88
metadata:
99
name: metallb-webhook-configuration
10-
labels: {{- include "common.labels.standard" . | nindent 4 }}
10+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1111
webhooks:
1212
- admissionReviewVersions:
1313
- v1
@@ -154,18 +154,18 @@ kind: Service
154154
metadata:
155155
name: metallb-webhook-service
156156
namespace: {{ include "common.names.namespace" . | quote }}
157-
labels: {{- include "common.labels.standard" . | nindent 4 }}
157+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
158158
spec:
159159
ports:
160160
- port: 443
161161
targetPort: 9443
162-
selector:
163-
{{- include "common.labels.matchLabels" . | nindent 4 }}
162+
{{- $podLabels := merge .Values.controller.podLabels .Values.commonLabels }}
163+
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
164164
app.kubernetes.io/component: controller
165165
---
166166
apiVersion: v1
167167
kind: Secret
168168
metadata:
169169
name: webhook-server-cert
170170
namespace: {{ include "common.names.namespace" . | quote }}
171-
labels: {{- include "common.labels.standard" . | nindent 4 }}
171+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}

‎bitnami/metallb/templates/prometheus/metallb.alerts.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ kind: PrometheusRule
99
metadata:
1010
name: {{ include "common.names.fullname" . }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" . | nindent 4 }}
13-
{{- if .Values.commonLabels }}
14-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
15-
{{- end }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1613
{{- if .Values.commonAnnotations }}
1714
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1815
{{- end }}

‎bitnami/metallb/templates/rbac.yaml

+2-8
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ kind: Role
99
metadata:
1010
name: {{ printf "%s-config-watcher" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" . | nindent 4 }}
13-
{{- if .Values.commonLabels }}
14-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
15-
{{- end }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1613
{{- if .Values.commonAnnotations }}
1714
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1815
{{- end }}
@@ -31,10 +28,7 @@ kind: RoleBinding
3128
metadata:
3229
name: {{ printf "%s-config-watcher" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
3330
namespace: {{ include "common.names.namespace" . | quote }}
34-
labels: {{- include "common.labels.standard" . | nindent 4 }}
35-
{{- if .Values.commonLabels }}
36-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
37-
{{- end }}
31+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
3832
{{- if .Values.commonAnnotations }}
3933
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
4034
{{- end }}

‎bitnami/metallb/templates/speaker/daemonset.yaml

+6-11
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,23 @@ kind: DaemonSet
99
metadata:
1010
name: {{ printf "%s-speaker" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" . | nindent 4 }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1313
app.kubernetes.io/component: speaker
14-
{{- if .Values.commonLabels }}
15-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
16-
{{- end }}
1714
{{- if .Values.commonAnnotations }}
1815
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1916
{{- end }}
2017
spec:
2118
{{- if .Values.speaker.updateStrategy }}
2219
updateStrategy: {{- toYaml .Values.speaker.updateStrategy | nindent 4 }}
2320
{{- end }}
21+
{{- $podLabels := merge .Values.speaker.podLabels .Values.commonLabels }}
2422
selector:
25-
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
23+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
2624
app.kubernetes.io/component: speaker
2725
template:
2826
metadata:
29-
labels: {{- include "common.labels.standard" . | nindent 8 }}
27+
labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
3028
app.kubernetes.io/component: speaker
31-
{{- if .Values.speaker.podLabels }}
32-
{{- include "common.tplvalues.render" (dict "value" .Values.speaker.podLabels "context" $) | nindent 8 }}
33-
{{- end }}
3429
{{- if .Values.speaker.podAnnotations }}
3530
annotations: {{- include "common.tplvalues.render" (dict "value" .Values.speaker.podAnnotations "context" $) | nindent 8 }}
3631
{{- end }}
@@ -44,8 +39,8 @@ spec:
4439
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.speaker.affinity "context" $) | nindent 8 }}
4540
{{- else }}
4641
affinity:
47-
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.speaker.podAffinityPreset "component" "speaker" "context" $) | nindent 10 }}
48-
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.speaker.podAntiAffinityPreset "component" "speaker" "context" $) | nindent 10 }}
42+
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.speaker.podAffinityPreset "component" "speaker" "customLabels" $podLabels "context" $) | nindent 10 }}
43+
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.speaker.podAntiAffinityPreset "component" "speaker" "customLabels" $podLabels "context" $) | nindent 10 }}
4944
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.speaker.nodeAffinityPreset.type "key" .Values.speaker.nodeAffinityPreset.key "values" .Values.speaker.nodeAffinityPreset.values) | nindent 10 }}
5045
{{- end }}
5146
nodeSelector:

‎bitnami/metallb/templates/speaker/psp.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ kind: PodSecurityPolicy
1111
metadata:
1212
name: {{ printf "%s-speaker" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
1313
namespace: {{ include "common.names.namespace" . | quote }}
14-
labels: {{- include "common.labels.standard" . | nindent 4 }}
14+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1515
app.kubernetes.io/component: speaker
16-
{{- if .Values.commonLabels }}
17-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
18-
{{- end }}
1916
{{- if .Values.commonAnnotations }}
2017
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
2118
{{- end }}

‎bitnami/metallb/templates/speaker/rbac.yaml

+4-16
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
88
kind: ClusterRole
99
metadata:
1010
name: {{ printf "%s-speaker" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
11-
labels: {{- include "common.labels.standard" . | nindent 4 }}
11+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1212
app.kubernetes.io/component: speaker
13-
{{- if .Values.commonLabels }}
14-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
15-
{{- end }}
1613
{{- if .Values.commonAnnotations }}
1714
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
1815
{{- end }}
@@ -57,11 +54,8 @@ kind: Role
5754
metadata:
5855
name: {{ printf "%s-pod-lister" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
5956
namespace: {{ include "common.names.namespace" . | quote }}
60-
labels: {{- include "common.labels.standard" . | nindent 4 }}
57+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
6158
app.kubernetes.io/component: speaker
62-
{{- if .Values.commonLabels }}
63-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
64-
{{- end }}
6559
{{- if .Values.commonAnnotations }}
6660
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
6761
{{- end }}
@@ -141,11 +135,8 @@ apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
141135
kind: ClusterRoleBinding
142136
metadata:
143137
name: {{ printf "%s-speaker" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
144-
labels: {{- include "common.labels.standard" . | nindent 4 }}
138+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
145139
app.kubernetes.io/component: speaker
146-
{{- if .Values.commonLabels }}
147-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
148-
{{- end }}
149140
{{- if .Values.commonAnnotations }}
150141
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
151142
{{- end }}
@@ -163,11 +154,8 @@ kind: RoleBinding
163154
metadata:
164155
name: {{ printf "%s-pod-lister" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
165156
namespace: {{ include "common.names.namespace" . | quote }}
166-
labels: {{- include "common.labels.standard" . | nindent 4 }}
157+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
167158
app.kubernetes.io/component: speaker
168-
{{- if .Values.commonLabels }}
169-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
170-
{{- end }}
171159
{{- if .Values.commonAnnotations }}
172160
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
173161
{{- end }}

‎bitnami/metallb/templates/speaker/secret.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ kind: Secret
1010
metadata:
1111
name: {{ include "metallb.speaker.secretName" . }}
1212
namespace: {{ include "common.names.namespace" . | quote }}
13-
labels: {{- include "common.labels.standard" . | nindent 4 }}
13+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1414
app.kubernetes.io/component: speaker
15-
{{- if .Values.commonLabels }}
16-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
17-
{{- end }}
1815
annotations:
1916
"helm.sh/hook": "pre-install"
2017
"helm.sh/hook-delete-policy": "before-hook-creation"

‎bitnami/metallb/templates/speaker/service.yaml

+7-12
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,17 @@ kind: Service
99
metadata:
1010
name: {{ printf "%s-speaker-metrics" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" . | nindent 4 }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1313
app.kubernetes.io/component: speaker
14-
{{- if .Values.commonLabels }}
15-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
16-
{{- end }}
17-
annotations:
18-
{{- if .Values.commonAnnotations }}
19-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
20-
{{- end }}
21-
{{- if .Values.speaker.metrics.service.annotations }}
22-
{{- include "common.tplvalues.render" ( dict "value" .Values.speaker.metrics.service.annotations "context" $ ) | nindent 4 }}
23-
{{- end }}
14+
{{- if or .Values.speaker.metrics.service.annotations .Values.commonAnnotations }}
15+
{{- $annotations := merge .Values.speaker.metrics.service.annotations .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
17+
{{- end }}
2418
spec:
2519
type: ClusterIP
2620
clusterIP: "None"
27-
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
21+
{{- $podLabels := merge .Values.speaker.podLabels .Values.commonLabels }}
22+
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
2823
app.kubernetes.io/component: speaker
2924
ports:
3025
- name: metrics

‎bitnami/metallb/templates/speaker/serviceaccount.yaml

+3-11
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,11 @@ kind: ServiceAccount
99
metadata:
1010
name: {{ include "metallb.speaker.serviceAccountName" . }}
1111
namespace: {{ include "common.names.namespace" . | quote }}
12-
labels: {{- include "common.labels.standard" . | nindent 4 }}
12+
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
1313
app.kubernetes.io/component: speaker
14-
{{- if .Values.commonLabels }}
15-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
16-
{{- end }}
1714
{{- if or .Values.speaker.serviceAccount.annotations .Values.commonAnnotations }}
18-
annotations:
19-
{{- if .Values.commonAnnotations }}
20-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
21-
{{- end }}
22-
{{- if .Values.speaker.serviceAccount.annotations }}
23-
{{- include "common.tplvalues.render" (dict "value" .Values.speaker.serviceAccount.annotations "context" $) | nindent 4 }}
24-
{{- end }}
15+
{{- $annotations := merge .Values.speaker.serviceAccount.annotations .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
2517
{{- end }}
2618
automountServiceAccountToken: {{ .Values.speaker.serviceAccount.automountServiceAccountToken }}
2719
{{- end -}}

‎bitnami/metallb/templates/speaker/servicemonitor.yaml

+7-17
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,17 @@ apiVersion: monitoring.coreos.com/v1
88
kind: ServiceMonitor
99
metadata:
1010
name: {{ printf "%s-speaker" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
11-
{{- if .Values.speaker.metrics.serviceMonitor.namespace }}
12-
namespace: {{ .Values.speaker.metrics.serviceMonitor.namespace | quote }}
13-
{{- else }}
14-
namespace: {{ include "common.names.namespace" . | quote }}
15-
{{- end }}
16-
labels: {{- include "common.labels.standard" . | nindent 4 }}
11+
namespace: {{ default .Release.Namespace .Values.speaker.metrics.serviceMonitor.namespace | quote }}
12+
{{- $labels := merge .Values.speaker.metrics.serviceMonitor.labels .Values.commonLabels }}
13+
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
1714
app.kubernetes.io/component: speaker
18-
{{- if .Values.commonLabels }}
19-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
20-
{{- end }}
21-
{{- if .Values.speaker.metrics.serviceMonitor.labels }}
22-
{{- include "common.tplvalues.render" ( dict "value" .Values.speaker.metrics.serviceMonitor.labels "context" $ ) | nindent 4 }}
23-
{{- end }}
24-
annotations:
25-
{{- if .Values.commonAnnotations }}
26-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
27-
{{- end }}
15+
{{- if .Values.commonAnnotations }}
16+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
17+
{{- end }}
2818
spec:
2919
jobLabel: {{ .Values.speaker.metrics.serviceMonitor.jobLabel | quote }}
3020
selector:
31-
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
21+
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
3222
app.kubernetes.io/component: speaker
3323
{{- if .Values.speaker.metrics.serviceMonitor.selector }}
3424
{{- include "common.tplvalues.render" (dict "value" .Values.speaker.metrics.serviceMonitor.selector "context" $) | nindent 6 }}

0 commit comments

Comments
 (0)
Please sign in to comment.