-
Notifications
You must be signed in to change notification settings - Fork 68
add daemonset extrahostports #98
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
base: master
Are you sure you want to change the base?
add daemonset extrahostports #98
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for configuring additional host ports in DaemonSet deployments by introducing the controller.daemonset.extraHostPorts configuration option. This addresses issue #97 by allowing users to expose extra ports beyond the standard HTTP, HTTPS, and TCP ports when using host port mode.
Key Changes
- Adds
extraHostPortsconfiguration loop in the pod template to dynamically configure additional host port mappings - Documents the new
controller.daemonset.extraHostPortsparameter in the README with field specifications
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| haproxy-ingress/templates/_podtemplate.yaml | Adds template logic to iterate over extraHostPorts and create port configurations with name, containerPort, and hostPort |
| haproxy-ingress/README.md | Documents the new extraHostPorts configuration parameter and its expected structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {{- if $.Values.controller.daemonset.useHostPort }} | ||
| {{- range $row := .Values.controller.daemonset.extraHostPorts }} | ||
| - name: "extra-port-{{ $row.port }}" | ||
| containerPort: {{ $row.containerPort }} |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extraHostPorts feature lacks support for the hostIP configuration that is available for other daemonset host ports. All other daemonset host port configurations in this template (see lines 315-316, 325-326, 353-354) include conditional hostIP support when controller.daemonset.hostIP is set. This should be added to allow users to bind extra ports to a specific host IP address.
| containerPort: {{ $row.containerPort }} | |
| containerPort: {{ $row.containerPort }} | |
| {{- if $.Values.controller.daemonset.hostIP }} | |
| hostIP: {{ $.Values.controller.daemonset.hostIP }} | |
| {{- end }} |
| {{- if $.Values.controller.daemonset.useHostPort }} | ||
| {{- range $row := .Values.controller.daemonset.extraHostPorts }} | ||
| - name: "extra-port-{{ $row.port }}" | ||
| containerPort: {{ $row.containerPort }} | ||
| hostPort: {{ $row.hostPort }} | ||
| {{- end }} | ||
| {{- end }} |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extraHostPorts block is not wrapped in a check for controller.kind being "DaemonSet". All other daemonset-specific host port configurations in this template (lines 314-321, 324-331, 352-363) only apply when controller.kind equals "DaemonSet". Without this check, the extraHostPorts configuration could incorrectly be applied to Deployment configurations where host ports are not supported, potentially causing deployment failures.
| `controller.daemonset.hostPorts.http` | If `controller.daemonset.useHostPort` is `true` and this is non-empty sets the hostPort for http | `"80"` | ||
| `controller.daemonset.hostPorts.https` | If `controller.daemonset.useHostPort` is `true` and this is non-empty sets the hostPort for https | `"443"` | ||
| `controller.daemonset.hostPorts.tcp` | If `controller.daemonset.useHostPort` is `true` use hostport for these ports from `tcp` | `[]` | ||
| `controller.daemonset.extraHostPorts` | If `controller.daemonset.useHostPort` is `true` configure additional host ports mapping. Each entry should specify `port`, `containerPort`, and `hostPort` | `[]` |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation mentions that each entry should specify port, containerPort, and hostPort, but the template only uses the port field for generating the port name. This creates confusion about the purpose of the port field. Consider either removing port from the documentation if it's only used for naming, or clarifying its purpose (e.g., "Each entry should specify port (used for naming), containerPort, and hostPort").
| `controller.daemonset.extraHostPorts` | If `controller.daemonset.useHostPort` is `true` configure additional host ports mapping. Each entry should specify `port`, `containerPort`, and `hostPort` | `[]` | |
| `controller.daemonset.extraHostPorts` | If `controller.daemonset.useHostPort` is `true` configure additional host ports mapping. Each entry should specify `port` (used for naming), `containerPort`, and `hostPort` | `[]` |
| {{- if $.Values.controller.daemonset.useHostPort }} | ||
| {{- range $row := .Values.controller.daemonset.extraHostPorts }} | ||
| - name: "extra-port-{{ $row.port }}" | ||
| containerPort: {{ $row.containerPort }} |
Copilot
AI
Dec 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The extraHostPorts implementation is missing a protocol specification. All other port definitions in this template include protocol: TCP (see lines 336, 344, 351). This field should be added to maintain consistency and ensure proper protocol configuration.
| containerPort: {{ $row.containerPort }} | |
| containerPort: {{ $row.containerPort }} | |
| protocol: TCP |
issue #97