Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMORO-2932] fix prometheus exporter issues in helm chart #2933

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -69,12 +69,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 @@ -125,13 +125,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 @@ -268,29 +268,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
Loading