Skip to content

Commit 2f3abb7

Browse files
committed
Add ability to template ServiceMonitor labels and add metrics port to Service
1 parent 7249e88 commit 2f3abb7

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

weaviate/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: application
77
# This is the chart version. This version number should be incremented each time you make changes
88
# to the chart and its templates, including the app version.
99
# Versions are expected to follow Semantic Versioning (https://semver.org/)
10-
version: 16.8.0
10+
version: 16.9.0
1111

1212
# This is the version number of the application being deployed. This version number should be
1313
# incremented each time you make changes to the application. Versions are not expected to

weaviate/templates/weaviateService.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ spec:
1515
ports:
1616
{{- range .Values.service.ports }}
1717
- {{ toYaml . | indent 6 | trim }}
18-
targetPort: 8080
1918
{{- end }}
19+
{{ if eq .Values.serviceMonitor.enabled true -}}
20+
- name: metrics
21+
protocol: TCP
22+
port: {{ .Values.env.PROMETHEUS_MONITORING_PORT }}
23+
targetPort: {{ .Values.env.PROMETHEUS_MONITORING_PORT }}
24+
{{ end }}
2025
{{ if eq .Values.service.type "ClusterIP" -}}
2126
{{ if .Values.service.clusterIP }}
2227
clusterIP: {{ .Values.service.clusterIP }}

weaviate/templates/weaviateServiceMonitor.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ metadata:
88
app: weaviate
99
app.kubernetes.io/name: weaviate
1010
app.kubernetes.io/managed-by: helm
11+
{{- if .Values.serviceMonitor.additionalLabels }}
12+
{{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }}
13+
{{- end }}
1114
spec:
1215
jobLabel: weaviate
1316
selector:

weaviate/values.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ service:
106106
- name: http
107107
protocol: TCP
108108
port: 80
109-
# Target port is going to be the same for every port
109+
targetPort: 8080
110110
type: LoadBalancer
111111
loadBalancerSourceRanges: []
112112
# optionally set cluster IP if you want to set a static IP
@@ -137,6 +137,7 @@ serviceMonitor:
137137
enabled: false
138138
interval: 30s
139139
scrapeTimeout: 10s
140+
additionalLabels: {}
140141

141142
# Adjust liveness, readiness and startup probes configuration
142143
startupProbe:
@@ -229,6 +230,7 @@ env:
229230
# Expose metrics on port 2112 for Prometheus to scrape
230231
PROMETHEUS_MONITORING_ENABLED: false
231232
PROMETHEUS_MONITORING_GROUP: false
233+
PROMETHEUS_MONITORING_PORT: 2112
232234

233235
# Set a MEM limit for the Weaviate Pod so it can help you both increase GC-related
234236
# performance as well as avoid GC-related out-of-memory (“OOM”) situations

0 commit comments

Comments
 (0)