Skip to content

Commit

Permalink
Add service monitor API version override
Browse files Browse the repository at this point in the history
  • Loading branch information
cgpoh authored and nineinchnick committed Dec 5, 2024
1 parent 6ea7a56 commit d3c79ae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ Fast distributed SQL query engine for big data analytics that helps you explore
* `serviceMonitor.enabled` - bool, default: `false`

Set to true to create resources for the [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator).
* `serviceMonitor.apiVersion` - string, default: `"monitoring.coreos.com/v1"`
* `serviceMonitor.labels` - object, default: `{"prometheus":"kube-prometheus"}`

Labels for serviceMonitor, so that Prometheus can select it
Expand Down
2 changes: 1 addition & 1 deletion charts/trino/templates/servicemonitor-coordinator.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $coordinatorServiceMonitor := merge .Values.serviceMonitor.coordinator (omit .Values.serviceMonitor "coordinator" "worker") -}}
{{- if $coordinatorServiceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
apiVersion: {{ $coordinatorServiceMonitor.apiVersion }}
kind: ServiceMonitor
metadata:
name: {{ template "trino.fullname" . }}
Expand Down
2 changes: 1 addition & 1 deletion charts/trino/templates/servicemonitor-worker.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $workerServiceMonitor := merge .Values.serviceMonitor.worker (omit .Values.serviceMonitor "coordinator" "worker") -}}
{{- if $workerServiceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
apiVersion: {{ $workerServiceMonitor.apiVersion }}
kind: ServiceMonitor
metadata:
name: {{ template "trino.fullname" . }}-worker
Expand Down
2 changes: 2 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,8 @@ serviceMonitor:
# serviceMonitor.enabled -- Set to true to create resources for the
# [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator).
enabled: false

apiVersion: monitoring.coreos.com/v1
# serviceMonitor.labels -- Labels for serviceMonitor, so that Prometheus can select it
labels:
prometheus: kube-prometheus
Expand Down

0 comments on commit d3c79ae

Please sign in to comment.