Skip to content

Commit

Permalink
Add service monitor in tei and tgi
Browse files Browse the repository at this point in the history
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
  • Loading branch information
sanketsudake committed Jul 19, 2024
1 parent 646dbac commit 8b76bb4
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/text-embeddings-inference/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.4
version: 0.1.5

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
28 changes: 28 additions & 0 deletions charts/text-embeddings-inference/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "text-embeddings-inference.fullname" . }}-servicemonitor
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
labels:
{{- include "text-embeddings-inference.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "text-embeddings-inference.selectorLabels" . | nindent 6 }}
endpoints:
- port: http
interval: {{ .Values.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
path: {{ .Values.serviceMonitor.path }}
jobLabel: {{ include "text-embeddings-inference.fullname" . }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{- end -}}

14 changes: 14 additions & 0 deletions charts/text-embeddings-inference/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ service:
type: ClusterIP
port: 80

serviceMonitor:
# Enable the creation of a ServiceMonitor resource
enabled: false
# Specify the namespace the ServiceMonitor resource should be created in
namespace: ""
# Specify the interval at which metrics should be scraped
interval: 30s
# Specify the scrape timeout
scrapeTimeout: 10s
# path to scrape for metrics
path: /metrics
# additional labels to add to the ServiceMonitor
additionalLabels: {}

ingress:
enabled: false
className: ""
Expand Down
2 changes: 1 addition & 1 deletion charts/text-generation-inference/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.3
version: 0.1.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
28 changes: 28 additions & 0 deletions charts/text-generation-inference/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "text-generation-inference.fullname" . }}-servicemonitor
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
labels:
{{- include "text-generation-inference.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "text-generation-inference.selectorLabels" . | nindent 6 }}
endpoints:
- port: http
interval: {{ .Values.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
path: {{ .Values.serviceMonitor.path }}
jobLabel: {{ include "text-generation-inference.fullname" . }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{- end -}}

14 changes: 14 additions & 0 deletions charts/text-generation-inference/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ service:
type: ClusterIP
port: 80

serviceMonitor:
# Enable the creation of a ServiceMonitor resource
enabled: false
# Specify the namespace the ServiceMonitor resource should be created in
namespace: ""
# Specify the interval at which metrics should be scraped
interval: 30s
# Specify the scrape timeout
scrapeTimeout: 10s
# path to scrape for metrics
path: /metrics
# additional labels to add to the ServiceMonitor
additionalLabels: {}

ingress:
enabled: false
className: ""
Expand Down

0 comments on commit 8b76bb4

Please sign in to comment.