Skip to content

Commit

Permalink
add readiness and liveness probe to updateCheck Job (#70)
Browse files Browse the repository at this point in the history
* add readiness and liveness probe to updateCheck Job
* remove readiness probe
  • Loading branch information
JannikBadenhop authored Nov 11, 2024
1 parent a46acbb commit 2339f05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/dbp-moodle/scripts/hook/moodle-update-preparation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ set -o errexit
set -o nounset
set -o pipefail

health_file="/tmp/healthy"

get_current_deployment_image() {
kubectl get "deploy/{{ .Release.Name }}" -n "{{ .Release.Namespace }}" -o jsonpath='{..image}' |\
tr -s '[:space:]' '\n' |\
grep '{{- .Values.moodle.image.repository -}}'
}

touch "${health_file}"

printf "Checking if update preparations are needed\n"

new_image="{{- .Values.moodle.image.registry -}}/{{- .Values.moodle.image.repository -}}:{{- .Values.moodle.image.tag -}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ spec:
- name: script-volume
mountPath: /moodle-update-preparation.sh
subPath: moodle-update-preparation.sh
livenessProbe:
exec:
command:
- cat
- /tmp/healthy
initialDelaySeconds: 10
periodSeconds: 10
affinity: {{ .Values.dbpMoodle.moodleUpdatePreparationJob.affinity | toYaml }}
tolerations: {{ .Values.dbpMoodle.moodleUpdatePreparationJob.tolerations | toYaml }}
serviceAccountName: "{{ .Release.Name }}-moodle-update-preparation-hook-serviceaccount"
Expand Down

0 comments on commit 2339f05

Please sign in to comment.