From 0329e0a7fe9c8cc05c2f6a2a66dc4dd8640db0c8 Mon Sep 17 00:00:00 2001 From: Bayu Aditya Date: Tue, 20 Aug 2024 12:13:39 +0700 Subject: [PATCH] feat: adding startup and readiness probe --- .gitignore | 2 + charts/caraml-store/Chart.yaml | 2 +- charts/caraml-store/README.md | 23 ++++++---- .../templates/serving/deployment.yaml | 19 +++++++++ charts/caraml-store/values.yaml | 42 ++++++++++++++----- 5 files changed, 70 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 13dc4699..392d3487 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ override.tf.json # Ignore inner charts dir charts/**/charts/*.tgz + +.idea/ diff --git a/charts/caraml-store/Chart.yaml b/charts/caraml-store/Chart.yaml index 68ceebb7..1589b02c 100644 --- a/charts/caraml-store/Chart.yaml +++ b/charts/caraml-store/Chart.yaml @@ -20,4 +20,4 @@ maintainers: - email: caraml-dev@caraml.dev name: caraml-dev name: caraml-store -version: 0.1.17 +version: 0.1.18 diff --git a/charts/caraml-store/README.md b/charts/caraml-store/README.md index eecd5fdb..5b084b11 100644 --- a/charts/caraml-store/README.md +++ b/charts/caraml-store/README.md @@ -1,6 +1,6 @@ # caraml-store -![Version: 0.1.17](https://img.shields.io/badge/Version-0.1.17-informational?style=flat-square) ![AppVersion: 0.1.3](https://img.shields.io/badge/AppVersion-0.1.3-informational?style=flat-square) +![Version: 0.1.18](https://img.shields.io/badge/Version-0.1.18-informational?style=flat-square) ![AppVersion: 0.1.3](https://img.shields.io/badge/AppVersion-0.1.3-informational?style=flat-square) CaraML store registry: Feature registry for CaraML store. @@ -93,12 +93,21 @@ CaraML store registry: Feature registry for CaraML store. | serving.podDisruptionBudget | object | `{}` | This value is used to configure a Kubernetes PodDisruptionBudget for Serving deployment | | serving.podLabels | object | `{}` | | | serving.prometheus.monitor.enabled | bool | `false` | Create a ServiceMonitor resource to expose Prometheus metrics | -| serving.readinessProbe.enabled | bool | `true` | Flag to enable the probe | -| serving.readinessProbe.failureThreshold | int | `5` | Min consecutive failures for the probe to be considered failed | -| serving.readinessProbe.initialDelaySeconds | int | `20` | Delay before the probe is initiated | -| serving.readinessProbe.periodSeconds | int | `10` | How often to perform the probe | -| serving.readinessProbe.successThreshold | int | `1` | Min consecutive success for the probe to be considered successful | -| serving.readinessProbe.timeoutSeconds | int | `10` | When the probe times out | +| serving.startupProbe.enabled | bool | `true` | Flag to enable the startup probe | +| serving.startupProbe.periodSeconds | int | `5` | How often to perform the startup probe | +| serving.startupProbe.timeoutSeconds | int | `1` | When the startup probe times out | +| serving.startupProbe.failureThreshold | int | `6` | Min consecutive failures for the startup probe to be considered failed | +| serving.readinessProbe.enabled | bool | `true` | Flag to enable the readiness probe | +| serving.readinessProbe.initialDelaySeconds | int | `2` | Delay before the readiness probe is initiated | +| serving.readinessProbe.periodSeconds | int | `2` | How often to perform the readiness probe | +| serving.readinessProbe.timeoutSeconds | int | `2` | When the readiness probe times out | +| serving.readinessProbe.successThreshold | int | `2` | Min consecutive success for the readiness probe to be considered successful | +| serving.readinessProbe.failureThreshold | int | `2` | Min consecutive failures for the readiness probe to be considered failed | +| serving.livenessProbe.enabled | bool | `true` | Flag to enable the liveness probe | +| serving.livenessProbe.initialDelaySeconds | int | `10` | Delay before the liveness probe is initiated | +| serving.livenessProbe.periodSeconds | int | `10` | How often to perform the liveness probe | +| serving.livenessProbe.timeoutSeconds | int | `2` | When the liveness probe times out | +| serving.livenessProbe.failureThreshold | int | `2` | Min consecutive failures for the liveness probe to be considered failed | | serving.replicaCount | int | `1` | | | serving.resources | object | `{}` | | | serving.secrets | list | `[]` | | diff --git a/charts/caraml-store/templates/serving/deployment.yaml b/charts/caraml-store/templates/serving/deployment.yaml index 754d6062..71e6f4e0 100644 --- a/charts/caraml-store/templates/serving/deployment.yaml +++ b/charts/caraml-store/templates/serving/deployment.yaml @@ -106,6 +106,15 @@ spec: - name: http containerPort: {{ .Values.serving.actuator.port }} protocol: TCP + {{- if .Values.serving.startupProbe.enabled }} + startupProbe: + httpGet: + path: /actuator/health + port: {{ .Values.serving.actuator.port }} + periodSeconds: {{ .Values.serving.startupProbe.periodSeconds }} + timeoutSeconds: {{ .Values.serving.startupProbe.timeoutSeconds }} + failureThreshold: {{ .Values.serving.startupProbe.failureThreshold }} + {{- end }} {{- if .Values.serving.readinessProbe.enabled }} readinessProbe: httpGet: @@ -117,6 +126,16 @@ spec: timeoutSeconds: {{ .Values.serving.readinessProbe.timeoutSeconds }} failureThreshold: {{ .Values.serving.readinessProbe.failureThreshold }} {{- end }} + {{- if .Values.serving.livenessProbe.enabled }} + livenessProbe: + httpGet: + path: /actuator/health + port: {{ .Values.serving.actuator.port }} + initialDelaySeconds: {{ .Values.serving.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.serving.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.serving.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.serving.livenessProbe.failureThreshold }} + {{- end }} resources: {{- toYaml .Values.serving.resources | nindent 12 }} {{- with .Values.serving.nodeSelector }} diff --git a/charts/caraml-store/values.yaml b/charts/caraml-store/values.yaml index ffa9b60f..ab27aa73 100644 --- a/charts/caraml-store/values.yaml +++ b/charts/caraml-store/values.yaml @@ -160,19 +160,41 @@ serving: javaOpts: + startupProbe: + # serving.startupProbe.enabled -- Flag to enable the startup probe + enabled: true + # serving.startupProbe.periodSeconds -- How often to perform the startup probe + periodSeconds: 5 + # serving.startupProbe.timeoutSeconds -- When the startup probe times out + timeoutSeconds: 1 + # serving.startupProbe.failureThreshold -- Min consecutive failures for the startup probe to be considered failed + failureThreshold: 6 + readinessProbe: - # serving.readinessProbe.enabled -- Flag to enable the probe + # serving.readinessProbe.enabled -- Flag to enable the readiness probe enabled: true - # serving.readinessProbe.initialDelaySeconds -- Delay before the probe is initiated - initialDelaySeconds: 20 - # serving.readinessProbe.periodSeconds -- How often to perform the probe + # serving.readinessProbe.initialDelaySeconds -- Delay before the readiness probe is initiated + initialDelaySeconds: 2 + # serving.readinessProbe.periodSeconds -- How often to perform the readiness probe + periodSeconds: 2 + # serving.readinessProbe.timeoutSeconds -- When the readiness probe times out + timeoutSeconds: 2 + # serving.readinessProbe.successThreshold -- Min consecutive success for the readiness probe to be considered successful + successThreshold: 2 + # serving.readinessProbe.failureThreshold -- Min consecutive failures for the readiness probe to be considered failed + failureThreshold: 2 + + livenessProbe: + # serving.livenessProbe.enabled -- Flag to enable the liveness probe + enabled: true + # serving.livenessProbe.initialDelaySeconds -- Delay before the liveness probe is initiated + initialDelaySeconds: 10 + # serving.livenessProbe.periodSeconds -- How often to perform the liveness probe periodSeconds: 10 - # serving.readinessProbe.timeoutSeconds -- When the probe times out - timeoutSeconds: 10 - # serving.readinessProbe.successThreshold -- Min consecutive success for the probe to be considered successful - successThreshold: 1 - # serving.readinessProbe.failureThreshold -- Min consecutive failures for the probe to be considered failed - failureThreshold: 5 + # serving.livenessProbe.timeoutSeconds -- When the liveness probe times out + timeoutSeconds: 2 + # serving.livenessProbe.failureThreshold -- Min consecutive failures for the liveness probe to be considered failed + failureThreshold: 2 resources: {}