Skip to content

Commit

Permalink
chore(helm): implement readinessProbe and startupProbe for uwsgi cont…
Browse files Browse the repository at this point in the history
…ainer (#10506)
  • Loading branch information
fcecagno authored Nov 22, 2024
1 parent eb650e0 commit 63f7e5a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 11 deletions.
39 changes: 30 additions & 9 deletions helm/defectdojo/templates/django-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ spec:
value: '{{ .Values.django.nginx.tls.enabled }}'
- name: GENERATE_TLS_CERTIFICATE
value: '{{ .Values.django.nginx.tls.generateCertificate }}'
{{- if .Values.django.uwsgi.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /nginx_health
Expand All @@ -279,10 +280,13 @@ spec:
httpHeaders:
- name: Host
value: {{ .Values.host }}
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 6
{{- if .Values.django.uwsgi.livenessProbe.enabled }}
failureThreshold: {{ .Values.django.uwsgi.livenessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.django.uwsgi.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.django.uwsgi.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.django.uwsgi.livenessProbe.successThreshold }}
timeoutSeconds: {{ .Values.django.uwsgi.livenessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.django.uwsgi.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /uwsgi_health
Expand All @@ -293,11 +297,28 @@ spec:
httpHeaders:
- name: Host
value: {{ .Values.host }}
failureThreshold: {{ .Values.django.uwsgi.livenessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.django.uwsgi.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.django.uwsgi.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.django.uwsgi.livenessProbe.successThreshold }}
timeoutSeconds: {{ .Values.django.uwsgi.livenessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.django.uwsgi.readinessProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.django.uwsgi.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.django.uwsgi.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.django.uwsgi.readinessProbe.successThreshold }}
timeoutSeconds: {{ .Values.django.uwsgi.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.django.uwsgi.startupProbe.enabled }}
startupProbe:
httpGet:
path: /uwsgi_health
port: http
{{- if .Values.django.nginx.tls.enabled }}
scheme: HTTPS
{{- end }}
httpHeaders:
- name: Host
value: {{ .Values.host }}
failureThreshold: {{ .Values.django.uwsgi.startupProbe.failureThreshold }}
initialDelaySeconds: {{ .Values.django.uwsgi.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.django.uwsgi.startupProbe.periodSeconds }}
successThreshold: {{ .Values.django.uwsgi.startupProbe.successThreshold }}
timeoutSeconds: {{ .Values.django.uwsgi.startupProbe.timeoutSeconds }}
{{- end }}
resources:
{{- toYaml .Values.django.nginx.resources | nindent 10 }}
Expand Down
20 changes: 18 additions & 2 deletions helm/defectdojo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,29 @@ django:
tolerations: []
uwsgi:
livenessProbe:
# Enable liveness checks on uwsgi container. Those values are use on nginx readiness checks as well.
# Enable liveness checks on uwsgi container.
enabled: true
failureThreshold: 6
initialDelaySeconds: 3
initialDelaySeconds: 0
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
# Enable readiness checks on uwsgi container.
enabled: true
failureThreshold: 6
initialDelaySeconds: 0
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
startupProbe:
# Enable startup checks on uwsgi container.
enabled: true
failureThreshold: 30
initialDelaySeconds: 0
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
requests:
cpu: 100m
Expand Down

0 comments on commit 63f7e5a

Please sign in to comment.