Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to configure hostPorts in helm chart #2933

Open
kate-osborn opened this issue Dec 19, 2024 · 0 comments
Open

Allow user to configure hostPorts in helm chart #2933

kate-osborn opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kate-osborn
Copy link
Contributor

The containerPorts for the nginx container do not specify hostPorts. The reason we don't specify hostPort by default is because it goes against Kubernetes best practices. From this doc:

Don't specify a hostPort for a Pod unless it is absolutely necessary. When you bind a Pod to a hostPort, it limits the number of places the Pod can be scheduled, because each <hostIP, hostPort, protocol> combination must be unique. If you don't specify the hostIP and protocol explicitly, Kubernetes will use 0.0.0.0 as the default hostIP and TCP as the default protocol.

If you only need access to the port for debugging purposes, you can use the apiserver proxy or kubectl port-forward.

If you explicitly need to expose a Pod's port on the node, consider using a NodePort Service before resorting to hostPort.

However, we can make hostPorts configurable in the helm chart and allow users to enable them if they need them.

This configuration is supported by our ingress controller: https://github.com/nginxinc/kubernetes-ingress/blob/2e0daa1ad6476a5a4801162bcdf6a932534feba0/charts/nginx-ingress/values.yaml#L132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant