Skip to content

Commit

Permalink
Merge pull request #226 from kvbutler/master
Browse files Browse the repository at this point in the history
Add ability to configure probe types and probes
  • Loading branch information
antas-marcin authored Apr 19, 2024
2 parents 55b454d + 801caa6 commit 23129cf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .cicd/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,9 @@ function check_creates_template() {
check_no_setting "--set env.PROMETHEUS_MONITORING_ENABLED=false --set serviceMonitor.enabled=true" "kind: ServiceMonitor"
check_no_setting "--set env.PROMETHEUS_MONITORING_ENABLED=false --set serviceMonitor.enabled=false" "kind: ServiceMonitor"

check_string_existence "--set readinessProbe.probeType=exec --set readinessProbe.probe.exec.command={test-probe-cmd}" "exec:"
check_string_existence "--set readinessProbe.probeType=exec --set readinessProbe.probe.exec.command={test-probe-cmd}" "command:"
check_string_existence "--set readinessProbe.probeType=exec --set readinessProbe.probe.exec.command={test-probe-cmd}" "test-probe-cmd"

echo "Tests successful."
)
2 changes: 1 addition & 1 deletion weaviate/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 16.8.8
version: 16.8.9

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
21 changes: 12 additions & 9 deletions weaviate/templates/weaviateStatefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -398,28 +398,31 @@ spec:
{{- end }}
{{- if .Values.startupProbe.enabled }}
startupProbe:
httpGet:
path: /v1/.well-known/ready
port: 8080
{{- $probeType := .Values.startupProbe.probeType }}
{{- $probe := index .Values.startupProbe.probe $probeType }}
{{ $probeType }}:
{{- toYaml $probe | nindent 12 }}
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
successThreshold: {{ .Values.startupProbe.successThreshold }}
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
{{- end }}
livenessProbe:
httpGet:
path: /v1/.well-known/live
port: 8080
{{- $probeType := .Values.livenessProbe.probeType }}
{{- $probe := index .Values.livenessProbe.probe $probeType }}
{{ $probeType }}:
{{- toYaml $probe | nindent 12 }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
readinessProbe:
httpGet:
path: /v1/.well-known/ready
port: 8080
{{- $probeType := .Values.readinessProbe.probeType }}
{{- $probe := index .Values.readinessProbe.probe $probeType }}
{{ $probeType }}:
{{- toYaml $probe | nindent 12 }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
Expand Down
23 changes: 22 additions & 1 deletion weaviate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,24 +143,45 @@ serviceMonitor:
scrapeTimeout: 10s

# Adjust liveness, readiness and startup probes configuration
# below is an example that can be used to switch the probeType to exec command
# readinessProbe: # (Compatible with liveness, readiness and startup probe configurations)
# probeType: exec
# probe:
# exec:
# command: ["/bin/sh", "-c", "wget --spider --server-response --tries=1 --timeout=30 -o /dev/null localhost:8080/v1/.well-known/ready"]

startupProbe:
# For kubernetes versions prior to 1.18 startupProbe is not supported thus can be disabled.
enabled: false

probeType: httpGet
probe:
httpGet:
path: /v1/.well-known/ready
port: 8080
initialDelaySeconds: 300
periodSeconds: 60
failureThreshold: 50
successThreshold: 1
timeoutSeconds: 3

livenessProbe:
probeType: httpGet
probe:
httpGet:
path: /v1/.well-known/live
port: 8080
initialDelaySeconds: 900
periodSeconds: 10
failureThreshold: 30
successThreshold: 1
timeoutSeconds: 3

readinessProbe:
probeType: httpGet
probe:
httpGet:
path: /v1/.well-known/ready
port: 8080
initialDelaySeconds: 3
periodSeconds: 10
failureThreshold: 3
Expand Down

0 comments on commit 23129cf

Please sign in to comment.