diff --git a/charts/pythie/Chart.yaml b/charts/pythie/Chart.yaml index 10d2d0dd..7c2849f6 100644 --- a/charts/pythie/Chart.yaml +++ b/charts/pythie/Chart.yaml @@ -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 diff --git a/charts/pythie/ci/default-values.yaml b/charts/pythie/ci/default-values.yaml new file mode 100644 index 00000000..e69de29b diff --git a/charts/pythie/ci/metrics-values.yaml b/charts/pythie/ci/metrics-values.yaml new file mode 100644 index 00000000..cab64809 --- /dev/null +++ b/charts/pythie/ci/metrics-values.yaml @@ -0,0 +1,4 @@ +pythieServing: + metrics: + podMonitor: + enabled: true diff --git a/charts/pythie/templates/podmonitor.yaml b/charts/pythie/templates/podmonitor.yaml new file mode 100644 index 00000000..f8b127d9 --- /dev/null +++ b/charts/pythie/templates/podmonitor.yaml @@ -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 }} diff --git a/charts/pythie/templates/pythie-serving-deployment.yaml b/charts/pythie/templates/pythie-serving-deployment.yaml index 451243fc..0a2e5620 100644 --- a/charts/pythie/templates/pythie-serving-deployment.yaml +++ b/charts/pythie/templates/pythie-serving-deployment.yaml @@ -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" @@ -43,7 +44,7 @@ spec: priorityClassName: {{ $.Values.priorityClassName }} {{- end }} {{- if $.Values.pythieServing.pullSecret }} - imagePullSecrets: + imagePullSecrets: - name: {{ $.Values.pythieServing.pullSecret }} {{- end }} initContainers: diff --git a/charts/pythie/values.yaml b/charts/pythie/values.yaml index 7ca82bc2..1cd9974e 100644 --- a/charts/pythie/values.yaml +++ b/charts/pythie/values.yaml @@ -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: