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 48d0daa
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 16 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/
23 changes: 17 additions & 6 deletions charts/caraml-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,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.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.successThreshold | int | `1` | Min consecutive success for the startup probe to be considered successful |
| 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.successThreshold | int | `2` | Min consecutive success for the liveness probe to be considered successful |
| 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 | `[]` | |
Expand Down
21 changes: 21 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,16 @@ 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 }}
successThreshold: {{ .Values.serving.startupProbe.successThreshold }}
timeoutSeconds: {{ .Values.serving.startupProbe.timeoutSeconds }}
failureThreshold: {{ .Values.serving.startupProbe.failureThreshold }}
{{- end }}
{{- if .Values.serving.readinessProbe.enabled }}
readinessProbe:
httpGet:
Expand All @@ -117,6 +127,17 @@ 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 }}
successThreshold: {{ .Values.serving.livenessProbe.successThreshold }}
timeoutSeconds: {{ .Values.serving.livenessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.serving.livenessProbe.failureThreshold }}
{{- end }}
resources:
{{- toYaml .Values.serving.resources | nindent 12 }}
{{- with .Values.serving.nodeSelector }}
Expand Down
46 changes: 36 additions & 10 deletions charts/caraml-store/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,45 @@ 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.successThreshold -- Min consecutive success for the startup probe to be considered successful
successThreshold: 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.successThreshold -- Min consecutive success for the liveness probe to be considered successful
successThreshold: 2
# serving.livenessProbe.failureThreshold -- Min consecutive failures for the liveness probe to be considered failed
failureThreshold: 2

resources: {}

Expand Down

0 comments on commit 48d0daa

Please sign in to comment.