Skip to content

Conversation

@pablogarciamiranda
Copy link
Collaborator

@pablogarciamiranda pablogarciamiranda commented Jun 19, 2025

This PR addresses a bug where the NetBox pod fails to start inside a cluster without IPv6 support, because NGINX Unit tries to bind to an IPv6 address ([::]:8080).

What’s changed:

  • Created a ConfigMap (nginx-unit-config) with an IPv4-only nginx-unit.json
  • Patched the NetBox deployment to mount this config at /etc/unit/nginx-unit.json
  • Restarted the NetBox pod after patching to apply the changes
  • Ensured this patching only happens when deploying in --vcluster mode

Why:

NGINX Unit fails to apply its configuration in clusters with lack of IPv6 support, which blocks NetBox from becoming ready and causes the Helm release to hang.

Added nginx-unit.json as a ConfigMap and patched the NetBox deployment to mount it,
bypassing IPv6 listener issues ([::]:8080) inside vClusters where IPv6 is not enabled.
@pablogarciamiranda pablogarciamiranda changed the title Mount IPv4-only nginx-unit config in vCluster to avoid IPv6 socket error Fix NetBox deployment failure in vCluster by disabling IPv6 in NGINX Unit Jun 19, 2025
Copy link
Collaborator

@bruelea bruelea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Only added a small suggestion to keep the script simple.

@jstudler
Copy link
Collaborator

jstudler commented Jun 19, 2025

@pablogarciamiranda great work on pinpointing the issue! Just a question: Is it a vCluster related issue or rather an issue related to the underlying Kubernetes (e.g. Kind, EKS, ...) that lacks IPv4 support? If it's vCluster specifically then all is good. If not, I would propose to rename "IS_VCLUSTER" to "FORCE_NETBOX_NGINX_IPV4" and the PR to something like "Fix NetBox NGINX deployment for IPv4 only environments".

@pablogarciamiranda pablogarciamiranda changed the title Fix NetBox deployment failure in vCluster by disabling IPv6 in NGINX Unit Fix NetBox NGINX deployment for IPv4-only environments Jun 20, 2025
@jstudler jstudler self-requested a review June 23, 2025 08:54
@pablogarciamiranda pablogarciamiranda merged commit b5d8d41 into main Jun 23, 2025
11 of 12 checks passed
vaishutin pushed a commit to vaishutin/netbox-operator that referenced this pull request Aug 17, 2025
…ity#333)

* Mount IPv4-only nginx-unit config in vCluster to avoid IPv6 socket error

Added nginx-unit.json as a ConfigMap and patched the NetBox deployment to mount it,
bypassing IPv6 listener issues ([::]:8080) inside vClusters where IPv6 is not enabled.

---------

Co-authored-by: Pablo Garcia Miranda <pablo.garciamiranda@swisscom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants