Skip to content

Commit

Permalink
🔧(jenny) use proper check for kube probes
Browse files Browse the repository at this point in the history
For the Django app we use the hearbeat add by the
lib dockerflow for the liveness and readiness probes
Use Nginx status page for liveness probe.
And check migration for the startup probe.
  • Loading branch information
claudusd committed May 15, 2024
1 parent 7ae26bd commit 97e54d0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
13 changes: 13 additions & 0 deletions jenny/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ data:
}
}
server {
listen 5000;
server_name localhost;
location /__status__ {
stub_status;
allow 127.0.0.1;
deny all;
access_log off;
}
}
types {
text/html html htm shtml;
text/css css;
Expand Down
20 changes: 18 additions & 2 deletions jenny/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
livenessProbe:
httpGet:
path: /
path: /__heartbeat__
port: {{ .Values.django.port }}
httpHeaders:
- name: "Host"
Expand All @@ -52,13 +52,23 @@ spec:
periodSeconds: 30
readinessProbe:
httpGet:
path: /
path: /__lbheartbeat__
port: {{ .Values.django.port }}
httpHeaders:
- name: "Host"
value: "{{ .Values.ingress.host}}"
initialDelaySeconds: 5
periodSeconds: 5
startupProbe:
exec:
command:
- python3
- manage.py
- migrate
- --check
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 30
env:
{{- include "jenny.envs" . | nindent 12 }}
- name: "UWSGI_PORT"
Expand All @@ -79,6 +89,12 @@ spec:
- name: nginx
mountPath: /etc/nginx
readOnly: true
livenessProbe:
httpGet:
path: /__status__
port: 5000
initialDelaySeconds: 15
periodSeconds: 30
volumes:
- name: {{ .Values.volumes.media.name }}
persistentVolumeClaim:
Expand Down

0 comments on commit 97e54d0

Please sign in to comment.