lianneli commented on code in PR #2673:
URL: https://github.com/apache/celeborn/pull/2673#discussion_r1715011239
##########
charts/celeborn/templates/_helpers.tpl:
##########
@@ -155,3 +155,78 @@ Create the name of the worker podmonitor to use
{{- define "celeborn.workerPodMonitorName" -}}
{{ include "celeborn.fullname" . }}-worker-podmonitor
{{- end }}
+
+{{/*
+Create master annotations if metrics enables
+*/}}
+{{- define "celeborn.masterMetricsAnnotation" -}}
+{{- $metricsEnabled := true -}}
+{{- $metricsPath := "/metrics/prometheus" -}}
+{{- $masterPort := 9098 -}}
+{{- range $key, $val := .Values.celeborn }}
+{{- if eq $key "celeborn.metrics.enabled" }}
+{{- $metricsEnabled = $val -}}
+{{- end }}
Review Comment:
@FMX Thanks for you review. The file `_helpers.tpl` is go template syntax,
some complex logic can be coded in this file, I understand. The param
`celeborn.metrics.enabled`, and others, is written in values.yaml as a single
key, but the dot `.` inside key does not conform to the specification which
cannot be used directly by `.Values.xxx`. So, I imitate the way in
`configMap.yaml`, using the `range` syntax to loop through, and using if to
scratch the value. The indentation and format in this file is not significant,
and it is processed through variable in template/xx/service.yaml.

##########
charts/celeborn/templates/_helpers.tpl:
##########
@@ -155,3 +155,78 @@ Create the name of the worker podmonitor to use
{{- define "celeborn.workerPodMonitorName" -}}
{{ include "celeborn.fullname" . }}-worker-podmonitor
{{- end }}
+
+{{/*
+Create master annotations if metrics enables
+*/}}
+{{- define "celeborn.masterMetricsAnnotation" -}}
+{{- $metricsEnabled := true -}}
+{{- $metricsPath := "/metrics/prometheus" -}}
+{{- $masterPort := 9098 -}}
+{{- range $key, $val := .Values.celeborn }}
+{{- if eq $key "celeborn.metrics.enabled" }}
+{{- $metricsEnabled = $val -}}
+{{- end }}
Review Comment:
> I have a question about helm chart indentation. Is there any guideline or
best practice?
sorry for not link your review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]