Skip to content

Commit

Permalink
[AMORO-2932] fix prometheus exporter issues in helm chart (#2933)
Browse files Browse the repository at this point in the history
* [WAP] fix prometheus exporter issues in helm chart

* fix

---------

Co-authored-by: ZhouJinsong <zhoujinsong0505@163.com>
  • Loading branch information
XBaith and zhoujinsong authored Jun 24, 2024
1 parent d20f133 commit 109b9a0
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 38 deletions.
17 changes: 17 additions & 0 deletions charts/amoro/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,20 @@ spark distribution package will be installed to here*/ -}}
{{- end -}}
{{- end -}}
{{- /* define "amoro.pod.volumes" end */ -}}

{{- /* define ports for each pod */ -}}
{{- define "amoro.pod.container.ports" -}}
- name: rest
containerPort: {{ .Values.server.rest.port }}
- name: table
containerPort: {{ .Values.server.table.port }}
- name: optimizing
containerPort: {{ .Values.server.optimizing.port }}
{{- if .Values.plugin.metricReporters }}
{{- if .Values.plugin.metricReporters.prometheusExporter.enabled }}
- name: prometheus
containerPort: {{ .Values.plugin.metricReporters.prometheusExporter.port }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- /* define amoro.pod.container.ports end */ -}}
8 changes: 3 additions & 5 deletions charts/amoro/templates/amoro-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ data:
## Helm chart provided metric reporters configurations
metric-reporters.yaml: |
metric-reporters:
{{- range . }}
- name: {{ .name }}
enabled: {{ .enabled }}
- name: {{ .prometheusExporter.name }}
enabled: {{ .prometheusExporter.enabled }}
properties:
{{ .properties | toYaml | nindent 10 | trim}}
{{- end }}
{{ .prometheusExporter.properties | toYaml | nindent 10 | trim }}
{{- end }}
## Helm chart provided Amoro configurations
config.yaml: |
Expand Down
7 changes: 1 addition & 6 deletions charts/amoro/templates/amoro-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ spec: {{/* TODO If Support Replica can be use more than 1 */}}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
ports:
- name: rest
containerPort: {{ .Values.server.rest.port }}
- name: table
containerPort: {{ .Values.server.table.port }}
- name: optimizing
containerPort: {{ .Values.server.optimizing.port }}
{{- include "amoro.pod.container.ports" . | nindent 12 }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
Expand Down
9 changes: 5 additions & 4 deletions charts/amoro/tests/amoro-configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,14 @@ tests:
set:
plugin:
metricReporters:
- name: prometheus-exporter
prometheusExporter:
name: prometheus-exporter
enabled: true
properties:
port: 7001
port: 7001
properties: ~
asserts:
- matchRegex:
path: data["metric-reporters.yaml"]
pattern:
|
- name: prometheus-exporter
name: prometheus-exporter
37 changes: 14 additions & 23 deletions charts/amoro/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,29 +274,20 @@ plugin:
##
metricReporters: ~
## e.g:
## metricReporters:
## ## @param Configure Prometheus exporter
## ##
## - name: prometheus-exporter
## ## @param Enable or disable the Prometheus exporter
## ##
## enabled: true
## ## @param Properties for the Prometheus exporter
## ##
## properties:
## port: 7001
## ## @param Kubernetes service configuration for the Prometheus exporter
## ## ref: https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/
## ##
## service:
## type: ClusterIP
## port: "7001"
## nodePort: ~
## annotations: {
## "prometheus.io/scrape": "true",
## "prometheus.io/path": "/metrics",
## "prometheus.io/port": "7001"
## }
# metricReporters:
# ## @param Configure Prometheus exporter
# ##
# prometheusExporter:
# name: prometheus-exporter
# ## @param Enable or disable the Prometheus exporter
# ##
# enabled: true
# ## @param Prometheus port
# ##
# port: 7001
# ## @param Properties for the Prometheus exporter
# ##
# properties: ~

## Configure the ingress resource that allows you to access the
## Amoro installation. Set up the URL
Expand Down

0 comments on commit 109b9a0

Please sign in to comment.