Skip to content
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
4 changes: 4 additions & 0 deletions charts/flyte-binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,8 @@ Chart for basic single Flyte executable deployment
| serviceAccount.imagePullSecrets | list | `[]` | |
| serviceAccount.labels | object | `{}` | |
| serviceAccount.name | string | `""` | |
| serviceMonitor.enabled | bool | `false` | |
| serviceMonitor.interval | string | `"60s"` | |
| serviceMonitor.labels | object | `{}` | |
| serviceMonitor.scrapeTimeout | string | `"30s"` | |

25 changes: 25 additions & 0 deletions charts/flyte-binary/templates/service-monitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "flyte-binary.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "flyte-binary.labels" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- tpl ( .Values.commonLabels | toYaml ) . | nindent 4 }}
{{- end }}
{{- if .Values.serviceMonitor.labels }}
{{- tpl ( .Values.serviceMonitor.labels | toYaml ) . | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- tpl ( .Values.commonAnnotations | toYaml ) . | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: http-metrics
path: /metrics
interval: {{ .Values.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
selector:
matchLabels: {{- include "flyte-binary.baseLabels" . | nindent 6 }}
{{- end }}
12 changes: 12 additions & 0 deletions charts/flyte-binary/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,18 @@ service:
# extraPorts Additional ports to add to Flyte service
extraPorts: []

# serviceMonitor Configure a Prometheus Operator ServiceMonitor for Flyte
# Requires the ServiceMonitor CRD and an `http-metrics` port on the http service (see `service.extraPorts`)
serviceMonitor:
# enabled Create a ServiceMonitor for Flyte
enabled: false
# interval Interval at which Prometheus scrapes metrics
interval: 60s
# scrapeTimeout Timeout for each scrape request
scrapeTimeout: 30s
# labels Add labels to the ServiceMonitor, e.g. those required by your Prometheus to discover it
labels: {}

# ingress Configure ingress for Flyte
ingress:
# create Create ingress resources
Expand Down
3 changes: 3 additions & 0 deletions docs/deployment/configuration/monitoring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,11 @@ Once the prerequisites are in place, follow the instructions in this section to
- name: http-metrics
protocol: TCP
port: 10254
serviceMonitor:
enabled: true

The above configuration enables the ``serviceMonitor`` that Prometheus can then use to automatically discover services and scrape metrics from them.
If your Prometheus only selects ``ServiceMonitor`` objects with specific labels, add them under ``serviceMonitor.labels``.

.. note::

Expand Down
Loading