Skip to content

Commit

Permalink
feat: adding startup and readiness probe
Browse files Browse the repository at this point in the history
  • Loading branch information
bayu-aditya committed Aug 20, 2024
1 parent 7c30d7c commit 24f3114
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ override.tf.json

# Ignore inner charts dir
charts/**/charts/*.tgz

.idea/
2 changes: 1 addition & 1 deletion charts/caraml-store/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ maintainers:
- email: caraml-dev@caraml.dev
name: caraml-dev
name: caraml-store
version: 0.1.17
version: 0.1.18
23 changes: 16 additions & 7 deletions charts/caraml-store/README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -85,6 +85,11 @@ CaraML store registry: Feature registry for CaraML store.
| serving.image.tag | string | `""` | |
| serving.imagePullSecrets | list | `[]` | |
| serving.javaOpts | string | `nil` | |
| serving.livenessProbe.enabled | bool | `true` | Flag to enable the liveness probe |
| serving.livenessProbe.failureThreshold | int | `2` | Min consecutive failures for the liveness probe to be considered failed |
| 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.minReadySeconds | int | `0` | The minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available. |
| serving.name | string | `"serving"` | |
| serving.nameOverride | string | `""` | |
Expand All @@ -93,19 +98,23 @@ 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.readinessProbe.enabled | bool | `true` | Flag to enable the readiness probe |
| serving.readinessProbe.failureThreshold | int | `2` | Min consecutive failures for the readiness probe to be considered failed |
| 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.successThreshold | int | `2` | Min consecutive success for the readiness probe to be considered successful |
| serving.readinessProbe.timeoutSeconds | int | `2` | When the readiness probe times out |
| serving.replicaCount | int | `1` | |
| serving.resources | object | `{}` | |
| serving.secrets | list | `[]` | |
| serving.service.grpc.nodePort | string | `nil` | Port number that each cluster node will listen to |
| serving.service.grpc.port | int | `6566` | Service port for GRPC requests |
| serving.service.grpc.targetPort | int | `6566` | Container port serving GRPC requests |
| serving.service.type | string | `"ClusterIP"` | Kubernetes service type |
| serving.startupProbe.enabled | bool | `true` | Flag to enable the startup probe |
| serving.startupProbe.failureThreshold | int | `6` | Min consecutive failures for the startup probe to be considered failed |
| serving.startupProbe.periodSeconds | int | `5` | How often to perform the startup probe |
| serving.startupProbe.timeoutSeconds | int | `1` | When the startup probe times out |
| serving.strategy | object | `{}` | Strategy used to replace old Pods by new ones. .spec.strategy.type can be "Recreate" or "RollingUpdate". "RollingUpdate" is the default value. |
| serving.tolerations | list | `[]` | |

Expand Down
19 changes: 19 additions & 0 deletions charts/caraml-store/templates/serving/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
42 changes: 32 additions & 10 deletions charts/caraml-store/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}

Expand Down

0 comments on commit 24f3114

Please sign in to comment.