-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Description:
When configuring health probes in cloudExtras, the httpHeaders field is not being passed through to the generated Kubernetes deployment manifest.
Problem:
Kubernetes health probes send the pod IP as the Host header by default. When Django's ALLOWED_HOSTS is configured with specific domains (not *), the probe requests are rejected with HTTP 400 because the pod IP is not in the allowed hosts list.
Current behavior:
client.yaml
cloudExtras:
startupProbe:
httpGet:
path: "/health/"
port: 8000
httpHeaders: # <-- THIS IS IGNORED
- name: Host
value: localhost
Generated K8s manifest has no httpHeaders:
startupProbe:
httpGet:
path: /health/
port: 8000
scheme: HTTP
httpHeaders is missing!
Expected behavior:
The httpHeaders should be passed through to the Kubernetes manifest:
startupProbe:
httpGet:
path: /health/
port: 8000
httpHeaders:
- name: Host
value: localhost
Workaround:
Manual kubectl patch after deployment:
kubectl patch deployment -n --type='json' -p='[
{"op": "add", "path": "/spec/template/spec/containers/0/startupProbe/httpGet/httpHeaders", "value": [{"name": "Host", "value": "localhost"}]}
]'