From 7cc54407e76e46a89c9abf1a40aa63c010b571d0 Mon Sep 17 00:00:00 2001 From: Robert Kuzma Date: Wed, 27 Mar 2024 13:28:05 +0100 Subject: [PATCH] fix: update liveliness and readiness probes, fix runserver host --- .../k8s/base/django.yaml | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/{{cookiecutter.project_slug}}/k8s/base/django.yaml b/{{cookiecutter.project_slug}}/k8s/base/django.yaml index c510e22a..176d2fb0 100644 --- a/{{cookiecutter.project_slug}}/k8s/base/django.yaml +++ b/{{cookiecutter.project_slug}}/k8s/base/django.yaml @@ -36,7 +36,7 @@ spec: containers: - name: django image: {{ cookiecutter.project_slug }}_local_django:latest - command: ["python", "manage.py", "runserver"] + command: ["python", "manage.py", "runserver", "0.0.0.0:8000"] ports: - name: http-server containerPort: 8000 @@ -49,20 +49,24 @@ spec: httpGet: path: /healthz port: 8000 - host: {{ cookiecutter.domain_name }} - initialDelaySeconds: 15 - periodSeconds: 60 + httpHeaders: + - name: Host + value: localhost + initialDelaySeconds: 29 + periodSeconds: 29 + timeoutSeconds: 2 failureThreshold: 3 terminationGracePeriodSeconds: 60 - timeoutSeconds: 2 readinessProbe: httpGet: path: /readiness port: 8000 - host: {{ cookiecutter.domain_name }} - initialDelaySeconds: 30 - timeoutSeconds: 5 - periodSeconds: 10 + httpHeaders: + - name: Host + value: localhost + initialDelaySeconds: 31 + periodSeconds: 31 + timeoutSeconds: 3 successThreshold: 1 initContainers: - name: check-db-ready