Skip to content

Conversation

@bshephar
Copy link
Contributor

@bshephar bshephar commented Jan 7, 2026

This change uses the lib-common env DownwardAPI [1] to write the pods IP to the env vars of the pod. We then retrieve this in local_settings.py to populate ALLOWED_HOSTS.

[1] https://github.com/openstack-k8s-operators/lib-common/blob/main/modules/common/env/env.go#L100-L114

Fixes #487
Jira: https://issues.redhat.com/browse/OSPRH-19216

@openshift-ci openshift-ci bot requested review from deshipu and mcgonago January 7, 2026 22:15
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 7, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bshephar
Once this PR has been reviewed and has the lgtm label, please assign abays for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 7, 2026

Hi @bshephar. Thanks for your PR.

I'm waiting for a openstack-k8s-operators member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@bshephar
Copy link
Contributor Author

bshephar commented Jan 7, 2026

@gibizer @fmount @stuggi Hey folks, happy New Year. Welcome to 2026.

Trying to solve a problem with IPV6 addresses raised by:
#478

I had initially proposed doing it this way:
#496

I know that @deshipu wasn't a huge fan of that implementation from the beginning. So, this is an attempt to find a compromise and still fix the problem of allowing Liveness/Readiness probes to healthcheck the individual pods.

What do y'all think of this alternative?

This change uses the `lib-common` env `DownwardAPI` [1] to write the pods IP
to the env vars of the pod. We then retrieve this in `local_settings.py` to populate
`ALLOWED_HOSTS`.

[1] https://github.com/openstack-k8s-operators/lib-common/blob/main/modules/common/env/env.go#L100-L114

Fixes openstack-k8s-operators#487
Jira: https://issues.redhat.com/browse/OSPRH-19216
Signed-off-by: Brendan Shephard <[email protected]>
@bshephar bshephar force-pushed the dowward-api-pod-ip branch from e822a85 to 3b10d73 Compare January 7, 2026 22:35
@bshephar
Copy link
Contributor Author

bshephar commented Jan 7, 2026

Maybe we can avoid putting anything in local_settings.py using HTTPHeaders in the HTTPGetAction:
https://pkg.go.dev/k8s.io/api/core/v1#HTTPGetAction

That might be an even nicer approach actually - assuming that would actually work. Like, a request to the pod IP, but setting the Host HTTPHeader. Maybe Django would still block it, I'm not too sure. Just throwing theories and possible alternatives out there.

@stuggi
Copy link
Contributor

stuggi commented Jan 8, 2026

Hi and Happy New Year!

If it works as intended, I'd prefer this implementation. its simple and easy.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants