Skip to content

Commit c95a8c0

Browse files
jiangzhoPeter Toth
authored andcommitted
[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 apache#294 from jiangzho/metrics. Authored-by: Zhou JIANG <[email protected]> Signed-off-by: Peter Toth <[email protected]>
1 parent 1ed8ce2 commit c95a8c0

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

build-tools/helm/spark-kubernetes-operator/templates/_helpers.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ Default property overrides
114114
spark.kubernetes.operator.namespace={{ .Release.Namespace }}
115115
spark.kubernetes.operator.name={{- include "spark-operator.name" . }}
116116
spark.kubernetes.operator.dynamicConfig.enabled={{ .Values.operatorConfiguration.dynamicConfig.enable }}
117+
spark.kubernetes.operator.metrics.port={{ include "spark-operator.metricsPort" . }}
117118
{{- if .Values.workloadResources.namespaces.overrideWatchedNamespaces }}
118119
spark.kubernetes.operator.watchedNamespaces={{ include "spark-operator.workloadNamespacesStr" . | trim }}
119120
{{- end }}
@@ -145,3 +146,10 @@ Readiness Probe property overrides
145146
{{- define "spark-operator.probePort" -}}
146147
{{- default 19091 .Values.operatorDeployment.operatorPod.operatorContainer.probes.port }}
147148
{{- end }}
149+
150+
{{/*
151+
Port for metrics
152+
*/}}
153+
{{- define "spark-operator.metricsPort" -}}
154+
{{- default 19090 .Values.operatorDeployment.operatorPod.operatorContainer.metrics.port }}
155+
{{- end }}

build-tools/helm/spark-kubernetes-operator/templates/spark-operator.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ spec:
8080
ports:
8181
- containerPort: {{ include "spark-operator.probePort" . }}
8282
name: probe-port
83+
- containerPort: {{ include "spark-operator.metricsPort" . }}
84+
name: metrics-port
8385
env:
8486
- name: OPERATOR_NAMESPACE
8587
valueFrom:

build-tools/helm/spark-kubernetes-operator/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ operatorDeployment:
6464
startupProbe:
6565
failureThreshold: 30
6666
periodSeconds: 10
67+
metrics:
68+
port: 19090
6769
# By default, operator container is configured to comply restricted standard
6870
# https://kubernetes.io/docs/concepts/security/pod-security-standards/
6971
securityContext:

0 commit comments

Comments
 (0)