Skip to content

Commit

Permalink
feat(pythie): add metrics support. (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
desaintmartin authored Jan 22, 2025
1 parent d7d75d5 commit 165bcd1
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
3 changes: 1 addition & 2 deletions charts/pythie/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apiVersion: v2
name: pythie
version: 0.7.2
appVersion: "1.0"
version: 0.8.0
description: Serve machine learning models with tensorflow and pythie
keywords:
- pythie
Expand Down
Empty file.
4 changes: 4 additions & 0 deletions charts/pythie/ci/metrics-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pythieServing:
metrics:
podMonitor:
enabled: true
21 changes: 21 additions & 0 deletions charts/pythie/templates/podmonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Values.pythieServing.metrics.podMonitor.enabled }}

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "pythie.fullname" . }}
labels:
{{- include "pythie.labels" . | nindent 4 }}
spec:
podMetricsEndpoints:
- interval: {{ .Values.pythieServing.metrics.podMonitor.interval }}
port: {{ .Values.pythieServing.metrics.podMonitor.port }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "pythie.matchLabels" . | nindent 6 }}
serving-kind: pythie

{{- end }}
3 changes: 2 additions & 1 deletion charts/pythie/templates/pythie-serving-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
labels:
{{ include "pythie.labels" $ | indent 8 }}
{{ include "pythie.modelLabels" $servingValue | indent 8 }}
serving-kind: pythie
serving/hash: {{ $servingHash }}
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
Expand All @@ -43,7 +44,7 @@ spec:
priorityClassName: {{ $.Values.priorityClassName }}
{{- end }}
{{- if $.Values.pythieServing.pullSecret }}
imagePullSecrets:
imagePullSecrets:
- name: {{ $.Values.pythieServing.pullSecret }}
{{- end }}
initContainers:
Expand Down
11 changes: 11 additions & 0 deletions charts/pythie/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ pythieServing:
repository: "ghcr.io/wiremind/pythie-serving"
tag: "v3.4.2"
pullPolicy: IfNotPresent
## Add custom ports to expose
customPorts: []
# - name: metrics
# containerPort: 9191
# protocol: TCP
## Enable optional metrics scraping through prometheus operator
## Note that you'll need to expose a new port in your code and in pythieServing.customPorts
metrics:
podMonitor:
enabled: false
port: metrics
interval: 30s
## Specify image pull secret
# pullSecret: my-secret
istio:
Expand Down

0 comments on commit 165bcd1

Please sign in to comment.