This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new 6ae2086f2 [KYUUBI #6006][HELM] Support additional labels for service
monitor
6ae2086f2 is described below
commit 6ae2086f2863697761f99483bfbe70514d376083
Author: Hai Nguyen <[email protected]>
AuthorDate: Mon Jan 29 13:49:08 2024 +0800
[KYUUBI #6006][HELM] Support additional labels for service monitor
# :mag: Description
## Issue References ๐
This pull request fixes #6006
## Describe Your Solution ๐ง
Add new value `additionalLabels` in `serviceMonitor` to support templating
the labels so that Prometheus can discover it
## Types of changes :bookmark:
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
## Test Plan ๐งช
#### Behavior Without This Pull Request :coffin:
Our Prometheus is based on `kube-prometheus-stack` chart, so it requires
label `release: kube-prometheus-stack`
The current setup of kyuubi helm does not allow the ServiceMonitor can be
discovered by Prome because it's not able to pass extra labels to it.
#### Behavior With This Pull Request :tada:
The MR enables templating extra labels
#### Related Unit Tests
---
# Checklist ๐
- [x] This patch was not authored or co-authored using [Generative
Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
Closes #6019 from sudohainguyen/helmchart.
Closes #6006
69a86c520 [Hai Nguyen] chore: simplify labels values
ed3fb0e44 [Hai Nguyen] [KYUUBI #6006] Support additional labels for service
monitor
Authored-by: Hai Nguyen <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
---
charts/kyuubi/templates/kyuubi-servicemonitor.yaml | 3 +++
charts/kyuubi/values.yaml | 2 ++
2 files changed, 5 insertions(+)
diff --git a/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
b/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
index 11098a0ea..937704bcc 100644
--- a/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
+++ b/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
@@ -22,6 +22,9 @@ metadata:
name: {{ .Release.Name }}
labels:
{{- include "kyuubi.labels" . | nindent 4 }}
+ {{- if .Values.serviceMonitor.labels }}
+ {{- toYaml .Values.serviceMonitor.labels | nindent 4 }}
+ {{- end }}
spec:
selector:
matchLabels:
diff --git a/charts/kyuubi/values.yaml b/charts/kyuubi/values.yaml
index 31d802fd4..b6b69621e 100644
--- a/charts/kyuubi/values.yaml
+++ b/charts/kyuubi/values.yaml
@@ -297,6 +297,8 @@ serviceMonitor:
# The endpoints section in a ServiceMonitor specifies the metrics
information for each target endpoint.
# This allows you to collect metrics from multiple Services across your
Kubernetes cluster in a standardized and automated way.
endpoints: []
+ # Additional labels that can be used so ServiceMonitor will be discovered by
Prometheus
+ labels: {}
# Rules for the Prometheus Operator
prometheusRule: