This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new 4ed3e9b12 [KYUUBI #5212] Fix configuration errors causing by helm 
charts of prometheus services
4ed3e9b12 is described below

commit 4ed3e9b1297fb72992a71a9254f80f46f1a68cd5
Author: 伟程 <cheng14...@gmail.com>
AuthorDate: Tue Oct 24 16:22:16 2023 +0800

    [KYUUBI #5212] Fix configuration errors causing by helm charts of 
prometheus services
    
    ### _Why are the changes needed?_
    
    This bug will affect k8s deployments.
    
    https://github.com/apache/kyuubi/issues/5212
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests)
 locally before make a pull request
    
    ### _Was this patch authored or co-authored using generative AI tooling?_
    No
    
    Closes #5281 from FourSpaces/fix_k8s_deployment_error.
    
    Closes #5212
    
    484da7e97 [伟程] Remove the monitoring.prometheus.server node that is not 
being used temporarily
    90396c17f [伟程] Specification format
    1773c7cd0 [wei.cheng] Separate the configuration of Prometheus from other 
components.
    59159eb7b [伟程] Fix configuration errors causing by k8s deployment of 
prometheus services.
    
    Lead-authored-by: 伟程 <cheng14...@gmail.com>
    Co-authored-by: wei.cheng <cheng14...@gmail.com>
    Signed-off-by: Cheng Pan <cheng...@apache.org>
    (cherry picked from commit 5eba900ed124fcb9c684bb11f86c384c143d5fdf)
    Signed-off-by: Cheng Pan <cheng...@apache.org>
---
 charts/kyuubi/templates/kyuubi-alert.yaml            | 2 +-
 charts/kyuubi/templates/kyuubi-configmap.yaml        | 2 +-
 charts/kyuubi/templates/kyuubi-headless-service.yaml | 5 +++++
 charts/kyuubi/templates/kyuubi-podmonitor.yaml       | 2 +-
 charts/kyuubi/templates/kyuubi-servicemonitor.yaml   | 2 +-
 charts/kyuubi/templates/kyuubi-statefulset.yaml      | 4 ++++
 charts/kyuubi/values.yaml                            | 6 +-----
 7 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/charts/kyuubi/templates/kyuubi-alert.yaml 
b/charts/kyuubi/templates/kyuubi-alert.yaml
index 8637e9e03..89fd11dc7 100644
--- a/charts/kyuubi/templates/kyuubi-alert.yaml
+++ b/charts/kyuubi/templates/kyuubi-alert.yaml
@@ -15,7 +15,7 @@
   limitations under the License.
 */}}
 
-{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters 
"PROMETHEUS") .Values.prometheusRule.enabled }}
+{{- if and .Values.monitoring.prometheus.enabled (eq .Values.metricsReporters 
"PROMETHEUS") .Values.prometheusRule.enabled }}
 apiVersion: monitoring.coreos.com/v1
 kind: PrometheusRule
 metadata:
diff --git a/charts/kyuubi/templates/kyuubi-configmap.yaml 
b/charts/kyuubi/templates/kyuubi-configmap.yaml
index 1e5e195d3..62413567d 100644
--- a/charts/kyuubi/templates/kyuubi-configmap.yaml
+++ b/charts/kyuubi/templates/kyuubi-configmap.yaml
@@ -38,7 +38,7 @@ data:
     kyuubi.frontend.protocols={{ include "kyuubi.frontend.protocols" . }}
 
     # Kyuubi Metrics
-    kyuubi.metrics.enabled={{ .Values.server.prometheus.enabled }}
+    kyuubi.metrics.enabled={{ .Values.monitoring.prometheus.enabled }}
     kyuubi.metrics.reporters={{ .Values.metricsReporters }}
 
     ## User provided Kyuubi configurations
diff --git a/charts/kyuubi/templates/kyuubi-headless-service.yaml 
b/charts/kyuubi/templates/kyuubi-headless-service.yaml
index 895859bac..fa04ffeef 100644
--- a/charts/kyuubi/templates/kyuubi-headless-service.yaml
+++ b/charts/kyuubi/templates/kyuubi-headless-service.yaml
@@ -30,6 +30,11 @@ spec:
       port: {{ tpl $frontend.service.port $ }}
       targetPort: {{ $frontend.port }}
     {{- end }}
+    {{- if .Values.monitoring.prometheus.enabled }}
+    - name: prometheus
+      port: {{ .Values.monitoring.prometheus.port }}
+      targetPort: {{ .Values.monitoring.prometheus.port }}
+    {{- end }}
   selector:
     {{- include "kyuubi.selectorLabels" $ | nindent 4 }}
 
diff --git a/charts/kyuubi/templates/kyuubi-podmonitor.yaml 
b/charts/kyuubi/templates/kyuubi-podmonitor.yaml
index ea0f76214..458ff66ed 100644
--- a/charts/kyuubi/templates/kyuubi-podmonitor.yaml
+++ b/charts/kyuubi/templates/kyuubi-podmonitor.yaml
@@ -15,7 +15,7 @@
   limitations under the License.
 */}}
 
-{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters 
"PROMETHEUS") .Values.podMonitor.enabled }}
+{{- if and .Values.monitoring.prometheus.enabled (eq .Values.metricsReporters 
"PROMETHEUS") .Values.podMonitor.enabled }}
 apiVersion: monitoring.coreos.com/v1
 kind: PodMonitor
 metadata:
diff --git a/charts/kyuubi/templates/kyuubi-servicemonitor.yaml 
b/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
index 7d997fc11..11098a0ea 100644
--- a/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
+++ b/charts/kyuubi/templates/kyuubi-servicemonitor.yaml
@@ -15,7 +15,7 @@
   limitations under the License.
 */}}
 
-{{- if and .Values.server.prometheus.enabled (eq .Values.metricsReporters 
"PROMETHEUS") .Values.serviceMonitor.enabled }}
+{{- if and .Values.monitoring.prometheus.enabled (eq .Values.metricsReporters 
"PROMETHEUS") .Values.serviceMonitor.enabled }}
 apiVersion: monitoring.coreos.com/v1
 kind: ServiceMonitor
 metadata:
diff --git a/charts/kyuubi/templates/kyuubi-statefulset.yaml 
b/charts/kyuubi/templates/kyuubi-statefulset.yaml
index 626796a78..309ef8ec9 100644
--- a/charts/kyuubi/templates/kyuubi-statefulset.yaml
+++ b/charts/kyuubi/templates/kyuubi-statefulset.yaml
@@ -75,6 +75,10 @@ spec:
               containerPort: {{ $frontend.port }}
             {{- end }}
             {{- end }}
+            {{- if .Values.monitoring.prometheus.enabled }}
+            - name: prometheus
+              containerPort: {{ .Values.monitoring.prometheus.port }}
+            {{- end }}
           {{- if .Values.livenessProbe.enabled }}
           livenessProbe:
             exec:
diff --git a/charts/kyuubi/values.yaml b/charts/kyuubi/values.yaml
index cfc79fae5..faa854b10 100644
--- a/charts/kyuubi/values.yaml
+++ b/charts/kyuubi/values.yaml
@@ -116,15 +116,11 @@ server:
       nodePort: ~
       annotations: {}
 
+monitoring:
   # Exposes metrics in Prometheus format
   prometheus:
     enabled: true
     port: 10019
-    service:
-      type: ClusterIP
-      port: "{{ .Values.server.prometheus.port }}"
-      nodePort: ~
-      annotations: {}
 
 # $KYUUBI_CONF_DIR directory
 kyuubiConfDir: /opt/kyuubi/conf

Reply via email to