Use whitenoise so that netbox can be deployed without an additional webserver. #7881

Closed
opened 2025-12-29 20:29:28 +01:00 by adam · 8 comments
Owner

Originally created by @vyas-n on GitHub (Apr 7, 2023).

NetBox version

v3.4.7

Feature type

New functionality

Proposed functionality

I'd like to add whitenoise as a dependency so that Netbox can serve static files and not need an additional webserver to be deployed with the static files copied over to it.

If it's approved, then I'd be willing to create the PR to add this functionality.

This is admittedly a duplicate of #2463, but I'd like for this to be reconsidered, and that ticket is closed for comments.

Use case

While the nginx/Apache config is standard practice for server-based deployments, it's usually redundant in k8s environments since k8s-native features (Loadbalancer service-type, Ingress resources, API Gateway resources, ...) can handle routing and load balancing http connections better.

This allows k8s users to simplify their cluster setup and remove the complexity of building another container image for their deployments.

This also enables compression & caching throughout the network path (browser-level, loadbalancer-level, CDN-level, ...) so that static files end up using less network bandwidth and get served less frequently.

Database changes

N/A

External dependencies

whitenoise pip package:

Originally created by @vyas-n on GitHub (Apr 7, 2023). ### NetBox version v3.4.7 ### Feature type New functionality ### Proposed functionality I'd like to add whitenoise as a dependency so that Netbox can serve static files and not need an additional webserver to be deployed with the static files copied over to it. If it's approved, then I'd be willing to create the PR to add this functionality. This is admittedly a duplicate of #2463, but I'd like for this to be reconsidered, and that ticket is closed for comments. ### Use case While the nginx/Apache config is standard practice for server-based deployments, it's usually redundant in k8s environments since k8s-native features (Loadbalancer service-type, Ingress resources, API Gateway resources, ...) can handle routing and load balancing http connections better. This allows k8s users to simplify their cluster setup and remove the complexity of building another container image for their deployments. This also enables compression & caching throughout the network path (browser-level, loadbalancer-level, CDN-level, ...) so that static files end up using less network bandwidth and get served less frequently. ### Database changes N/A ### External dependencies whitenoise pip package: - pypi: https://pypi.org/project/whitenoise/ - docs: https://whitenoise.readthedocs.io/en/latest/
adam added the type: feature label 2025-12-29 20:29:28 +01:00
adam closed this issue 2025-12-29 20:29:28 +01:00
Author
Owner

@tobiasge commented on GitHub (Apr 8, 2023):

You can use netbox-docker in Kubernetes.

@tobiasge commented on GitHub (Apr 8, 2023): You can use [netbox-docker](https://github.com/netbox-community/netbox-docker) in Kubernetes.
Author
Owner

@vyas-n commented on GitHub (Apr 10, 2023):

Hi @tobiasge,

Mind explaining what the solution would be? I already have a netbox container that I'm building as a part of my helm chart. Perhaps I can use the same technique in my container as you used in yours?

@vyas-n commented on GitHub (Apr 10, 2023): Hi @tobiasge, Mind explaining what the solution would be? I already have a netbox container that I'm building as a part of my helm chart. Perhaps I can use the same technique in my container as you used in yours?
Author
Owner

@tobiasge commented on GitHub (Apr 10, 2023):

You don't have to build the image. Just point a deployment configuration to it an set the environment variables as needed.
There is also a Helm chart: https://github.com/bootc/netbox-chart

@tobiasge commented on GitHub (Apr 10, 2023): You don't have to build the image. Just point a deployment configuration to it an set the environment variables as needed. There is also a Helm chart: https://github.com/bootc/netbox-chart
Author
Owner

@vyas-n commented on GitHub (Apr 11, 2023):

Thanks @tobiasge, for the link to the helm chart (I'll take a look and consider using it within my organization), but I'm still left with my original question unanswered.

Would you mind providing the solution for how can Netbox be deployed without nginx/Apache or any other webserver?

If not, then can Netbox consider using the whitenoise pip package as a solution?

@vyas-n commented on GitHub (Apr 11, 2023): Thanks @tobiasge, for the link to the helm chart (I'll take a look and consider using it within my organization), but I'm still left with my original question unanswered. Would you mind providing the solution for how can Netbox be deployed without nginx/Apache or any other webserver? If not, then can Netbox consider using the whitenoise pip package as a solution?
Author
Owner

@tobiasge commented on GitHub (Apr 11, 2023):

In the Docker image Nginx Unit is used as web server. It can run the Python application and serve static files.

@tobiasge commented on GitHub (Apr 11, 2023): In the Docker image [Nginx Unit](https://unit.nginx.org/) is used as web server. It can run the Python application and serve static files.
Author
Owner

@vyas-n commented on GitHub (Apr 11, 2023):

Thanks @tobiasge, that works for my use-case!

Should i close this issue, or leave it open in case anyone else needs this?

@vyas-n commented on GitHub (Apr 11, 2023): Thanks @tobiasge, that works for my use-case! Should i close this issue, or leave it open in case anyone else needs this?
Author
Owner

@DanSheps commented on GitHub (Apr 13, 2023):

It is possible that there might still be some benefit to this, I did a little bit of looking into whitenoise and it is interesting what it lets you do, that said, not sure if there is enouhgh value in it to introduce another dependancy.

@DanSheps commented on GitHub (Apr 13, 2023): It is possible that there might still be some benefit to this, I did a little bit of looking into whitenoise and it is interesting what it lets you do, that said, not sure if there is enouhgh value in it to introduce another dependancy.
Author
Owner

@jeremystretch commented on GitHub (May 4, 2023):

It sounds like a solution has been identified for the use case cited. (Please correct me if this is wrong.) I'm going to close this out as not currently requiring further action, but happy to revisit in light of a new use case.

@jeremystretch commented on GitHub (May 4, 2023): It sounds like a solution has been identified for the use case cited. (Please correct me if this is wrong.) I'm going to close this out as not currently requiring further action, but happy to revisit in light of a new use case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7881