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 2021574a33 [KYUUBI #7105] [K8S][HELM] Support additional labels for 
PrometheusRule
2021574a33 is described below

commit 2021574a3382f878678912eaa1a7796ee19ed635
Author: dnskr <dnskr...@gmail.com>
AuthorDate: Mon Jun 23 23:48:15 2025 +0800

    [KYUUBI #7105] [K8S][HELM] Support additional labels for PrometheusRule
    
    ### Why are the changes needed?
    The change is needed to be able to add additional labels to 
`PrometheusRule` similar to 
[podMonitor](https://github.com/apache/kyuubi/blob/523722788fd4fbf661cce8572c529af09c34079a/charts/kyuubi/values.yaml#L321-L330)
 and 
[serviceMonitor](https://github.com/apache/kyuubi/blob/523722788fd4fbf661cce8572c529af09c34079a/charts/kyuubi/values.yaml#L333-L341).
    The PR also includes minor identation fixes.
    
    ### How was this patch tested?
    ```shell
    helm template kyuubi charts/kyuubi --set 
metrics.prometheusRule.enabled=true --set 
metrics.prometheusRule.labels.test-label=true -s templates/kyuubi-alert.yaml
    ---
    # Source: kyuubi/templates/kyuubi-alert.yaml
    apiVersion: monitoring.coreos.com/v1
    kind: PrometheusRule
    metadata:
      name: kyuubi
      labels:
        helm.sh/chart: kyuubi-0.1.0
        app.kubernetes.io/name: kyuubi
        app.kubernetes.io/instance: kyuubi
        app.kubernetes.io/version: "1.10.0"
        app.kubernetes.io/managed-by: Helm
        test-label: true
    spec:
      groups:
        []
    ```
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #7105 from dnskr/helm-prometheusRule-labels.
    
    Closes #7105
    
    234d99da3 [dnskr] [K8S][HELM] Support additional labels for PrometheusRule
    
    Authored-by: dnskr <dnskr...@gmail.com>
    Signed-off-by: Cheng Pan <cheng...@apache.org>
---
 charts/kyuubi/templates/kyuubi-alert.yaml          | 3 +++
 charts/kyuubi/templates/kyuubi-podmonitor.yaml     | 2 +-
 charts/kyuubi/templates/kyuubi-servicemonitor.yaml | 2 +-
 charts/kyuubi/templates/kyuubi-statefulset.yaml    | 2 +-
 charts/kyuubi/values.yaml                          | 2 ++
 5 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/charts/kyuubi/templates/kyuubi-alert.yaml 
b/charts/kyuubi/templates/kyuubi-alert.yaml
index a1a7537b37..d9c2ee6e67 100644
--- a/charts/kyuubi/templates/kyuubi-alert.yaml
+++ b/charts/kyuubi/templates/kyuubi-alert.yaml
@@ -22,6 +22,9 @@ metadata:
   name: {{ .Release.Name }}
   labels:
     {{- include "kyuubi.labels" . | nindent 4 }}
+    {{- if .Values.metrics.prometheusRule.labels }}
+      {{- toYaml .Values.metrics.prometheusRule.labels | nindent 4 }}
+    {{- end }}
 spec:
   groups:
     {{- toYaml .Values.metrics.prometheusRule.groups | nindent 4 }}
diff --git a/charts/kyuubi/templates/kyuubi-podmonitor.yaml 
b/charts/kyuubi/templates/kyuubi-podmonitor.yaml
index ad154af27e..6517b950a9 100644
--- a/charts/kyuubi/templates/kyuubi-podmonitor.yaml
+++ b/charts/kyuubi/templates/kyuubi-podmonitor.yaml
@@ -23,7 +23,7 @@ metadata:
   labels:
     {{- include "kyuubi.labels" . | nindent 4 }}
     {{- if .Values.metrics.podMonitor.labels }}
-    {{- toYaml .Values.metrics.podMonitor.labels | nindent 4 }}
+      {{- toYaml .Values.metrics.podMonitor.labels | nindent 4 }}
     {{- end }}
 spec:
   selector:
diff --git a/charts/kyuubi/templates/kyuubi-servicemonitor.yaml 
b/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
index a75da50e37..744b750d5c 100644
--- a/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
+++ b/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
@@ -23,7 +23,7 @@ metadata:
   labels:
     {{- include "kyuubi.labels" . | nindent 4 }}
     {{- if .Values.metrics.serviceMonitor.labels }}
-    {{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }}
+      {{- toYaml .Values.metrics.serviceMonitor.labels | nindent 4 }}
     {{- end }}
 spec:
   selector:
diff --git a/charts/kyuubi/templates/kyuubi-statefulset.yaml 
b/charts/kyuubi/templates/kyuubi-statefulset.yaml
index 62a0b02eb8..57706d23a0 100644
--- a/charts/kyuubi/templates/kyuubi-statefulset.yaml
+++ b/charts/kyuubi/templates/kyuubi-statefulset.yaml
@@ -41,7 +41,7 @@ spec:
         checksum/conf: {{ include (print $.Template.BasePath 
"/kyuubi-configmap.yaml") . | sha256sum }}
         checksum/conf-hadoop: {{ include (print $.Template.BasePath 
"/kyuubi-hadoop-configmap.yaml") . | sha256sum }}
         {{- with .Values.podAnnotations }}
-        {{- toYaml . | nindent 8 }}
+          {{- toYaml . | nindent 8 }}
         {{- end }}
     spec:
       {{- with .Values.imagePullSecrets }}
diff --git a/charts/kyuubi/values.yaml b/charts/kyuubi/values.yaml
index 5a5640a29a..67ce3c7fe3 100644
--- a/charts/kyuubi/values.yaml
+++ b/charts/kyuubi/values.yaml
@@ -346,3 +346,5 @@ metrics:
     enabled: false
     # Content of Prometheus rule file
     groups: []
+    # Additional labels to be used to make PrometheusRule discovered by 
Prometheus
+    labels: {}

Reply via email to