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

ptoth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new c95a8c0  [SPARK-53159] Declare metrics port for operator in helm chart
c95a8c0 is described below

commit c95a8c0f180f4fe41f989f5f02597873b1dacae3
Author: Zhou JIANG <jiang...@umich.edu>
AuthorDate: Fri Aug 8 10:00:33 2025 +0200

    [SPARK-53159] Declare metrics port for operator in helm chart
    
    ### What changes were proposed in this pull request?
    
    Spark Operator provides prometheus format metrics by default. This PR adds 
metrics port spec to the operator helm chart.
    
    ### Why are the changes needed?
    
    Declaring the port in spec for better clarity and maintainability.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
    CIs, helm lint, and local testing
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No
    
    Closes #294 from jiangzho/metrics.
    
    Authored-by: Zhou JIANG <jiang...@umich.edu>
    Signed-off-by: Peter Toth <p_t...@apple.com>
---
 build-tools/helm/spark-kubernetes-operator/templates/_helpers.tpl | 8 ++++++++
 .../helm/spark-kubernetes-operator/templates/spark-operator.yaml  | 2 ++
 build-tools/helm/spark-kubernetes-operator/values.yaml            | 2 ++
 3 files changed, 12 insertions(+)

diff --git a/build-tools/helm/spark-kubernetes-operator/templates/_helpers.tpl 
b/build-tools/helm/spark-kubernetes-operator/templates/_helpers.tpl
index 79ad2cd..bd8cc86 100644
--- a/build-tools/helm/spark-kubernetes-operator/templates/_helpers.tpl
+++ b/build-tools/helm/spark-kubernetes-operator/templates/_helpers.tpl
@@ -114,6 +114,7 @@ Default property overrides
 spark.kubernetes.operator.namespace={{ .Release.Namespace }}
 spark.kubernetes.operator.name={{- include "spark-operator.name" . }}
 spark.kubernetes.operator.dynamicConfig.enabled={{ 
.Values.operatorConfiguration.dynamicConfig.enable }}
+spark.kubernetes.operator.metrics.port={{ include "spark-operator.metricsPort" 
. }}
 {{- if .Values.workloadResources.namespaces.overrideWatchedNamespaces }}
 spark.kubernetes.operator.watchedNamespaces={{ include 
"spark-operator.workloadNamespacesStr" . | trim }}
 {{- end }}
@@ -145,3 +146,10 @@ Readiness Probe property overrides
 {{- define "spark-operator.probePort" -}}
 {{- default 19091 
.Values.operatorDeployment.operatorPod.operatorContainer.probes.port }}
 {{- end }}
+
+{{/*
+Port for metrics
+*/}}
+{{- define "spark-operator.metricsPort" -}}
+{{- default 19090 
.Values.operatorDeployment.operatorPod.operatorContainer.metrics.port }}
+{{- end }}
diff --git 
a/build-tools/helm/spark-kubernetes-operator/templates/spark-operator.yaml 
b/build-tools/helm/spark-kubernetes-operator/templates/spark-operator.yaml
index 78c76d3..d6bf072 100644
--- a/build-tools/helm/spark-kubernetes-operator/templates/spark-operator.yaml
+++ b/build-tools/helm/spark-kubernetes-operator/templates/spark-operator.yaml
@@ -80,6 +80,8 @@ spec:
           ports:
             - containerPort: {{ include "spark-operator.probePort" . }}
               name: probe-port
+            - containerPort: {{ include "spark-operator.metricsPort" . }}
+              name: metrics-port
           env:
             - name: OPERATOR_NAMESPACE
               valueFrom:
diff --git a/build-tools/helm/spark-kubernetes-operator/values.yaml 
b/build-tools/helm/spark-kubernetes-operator/values.yaml
index 1771b89..58f1c30 100644
--- a/build-tools/helm/spark-kubernetes-operator/values.yaml
+++ b/build-tools/helm/spark-kubernetes-operator/values.yaml
@@ -64,6 +64,8 @@ operatorDeployment:
         startupProbe:
           failureThreshold: 30
           periodSeconds: 10
+      metrics:
+        port: 19090
       # By default, operator container is configured to comply restricted 
standard
       # https://kubernetes.io/docs/concepts/security/pod-security-standards/
       securityContext:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to