Skip to content

Support httpHeaders in health probe configuration (readinessProbe/startupProbe) #168

Description

@Cre-eD

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"}]}
]'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureTriggers Simple Forge's Software Architect role to start working on the issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions