Skip to content

Commit 4d07453

Browse files
committed
feat(operator chart): add metrics Service and optional ServiceMonitor (CRD-gated)
Signed-off-by: matt <[email protected]>
1 parent 7ad7f22 commit 4d07453

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- if .Values.metrics.enabled }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ include "feast-operator.fullnameWithSuffix" (dict "root" . "suffix" "metrics") }}
6+
namespace: {{ include "feast-operator.namespace" . }}
7+
labels:
8+
{{- include "feast-operator.labels" . | nindent 4 }}
9+
{{- with .Values.metrics.service.annotations }}
10+
annotations:
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
{{- with (include "feast-operator.annotations" .) }}
14+
{{- . | nindent 4 }}
15+
{{- end }}
16+
spec:
17+
type: {{ .Values.metrics.service.type }}
18+
ports:
19+
- name: https
20+
port: {{ .Values.metrics.service.port }}
21+
protocol: TCP
22+
targetPort: {{ .Values.metrics.service.targetPort }}
23+
selector:
24+
{{- include "feast-operator.selectorLabels" . | nindent 4 }}
25+
{{- end }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{- if and .Values.prometheus.serviceMonitor.enabled (has "monitoring.coreos.com/v1" .Capabilities.APIVersions) }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: {{ include "feast-operator.fullnameWithSuffix" (dict "root" . "suffix" "metrics") }}
6+
namespace: {{ include "feast-operator.namespace" . }}
7+
labels:
8+
{{- include "feast-operator.labels" . | nindent 4 }}
9+
{{- with .Values.prometheus.serviceMonitor.labels }}
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
{{- with (include "feast-operator.annotations" .) }}
13+
annotations:
14+
{{- . | nindent 4 }}
15+
{{- end }}
16+
spec:
17+
endpoints:
18+
- path: /metrics
19+
port: https
20+
scheme: https
21+
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
22+
interval: {{ .Values.prometheus.serviceMonitor.interval }}
23+
scrapeTimeout: {{ .Values.prometheus.serviceMonitor.timeout }}
24+
tlsConfig:
25+
insecureSkipVerify: true
26+
selector:
27+
matchLabels:
28+
{{- include "feast-operator.selectorLabels" . | nindent 6 }}
29+
{{- end }}
30+
{{- if and .Values.prometheus.serviceMonitor.enabled (not (has "monitoring.coreos.com/v1" .Capabilities.APIVersions)) }}
31+
{{- /* Avoid hard failure; emit a comment so users see why it didn't render */ -}}
32+
# ServiceMonitor CRD not found (monitoring.coreos.com/v1). Skipping ServiceMonitor creation.
33+
{{- end }}

0 commit comments

Comments
 (0)