Skip to content

feat: support auto assign node port for stream subsystem#258

Merged
nic-6443 merged 5 commits intomainfrom
nic/auto-assign-node-port
Feb 12, 2026
Merged

feat: support auto assign node port for stream subsystem#258
nic-6443 merged 5 commits intomainfrom
nic/auto-assign-node-port

Conversation

@nic-6443
Copy link
Contributor

No description provided.

Signed-off-by: Nic <qianyong@api7.ai>
Copilot AI review requested due to automatic review settings February 12, 2026 06:41
Copy link
Contributor

Copilot AI left a 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 pull request adds support for automatic nodePort assignment in the stream subsystem (TCP/UDP) and adds a nodePort configuration option for the serviceMonitor. The changes include updating the Helm chart configuration, templates, documentation, and bumping the chart version from 0.2.53 to 0.2.54.

Changes:

  • Added gateway.stream.autoAssignNodePort configuration option to enable automatic nodePort assignment for TCP/UDP stream ports
  • Added serviceMonitor.nodePort configuration option to specify a nodePort for the Prometheus metrics endpoint
  • Updated the service-gateway.yaml template to implement the nodePort assignment logic
  • Updated documentation in README.md and values.yaml to reflect the new configuration options

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.

File Description
charts/gateway/values.yaml Added autoAssignNodePort flag for stream subsystem and nodePort option for serviceMonitor
charts/gateway/templates/service-gateway.yaml Implemented nodePort assignment logic for serviceMonitor and stream TCP/UDP ports based on new configuration
charts/gateway/README.md Updated documentation to reflect new configuration parameters
charts/gateway/Chart.yaml Bumped chart version from 0.2.53 to 0.2.54

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

nic-6443 and others added 3 commits February 12, 2026 15:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
F
Signed-off-by: Nic <qianyong@api7.ai>
f
Signed-off-by: Nic <qianyong@api7.ai>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +127 to +135
{{- if eq $global.Values.gateway.type "NodePort" }}
{{- if $global.Values.gateway.stream.autoAssignNodePort }}
nodePort: {{ splitList ":" ($port.addr | toString) | last }}
{{- else }}
{{- if not (empty $port.nodePort) }}
nodePort: {{ $port.nodePort }}
{{- end }}
{{- end }}
{{- end }}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The auto-assign nodePort logic may not work as expected. When autoAssignNodePort is true, the code sets nodePort to the port value extracted from the address. However, if a user specifies addr: 5353 (a port outside the typical Kubernetes nodePort range of 30000-32767), this will fail when the service is created. The comment in values.yaml warns users to ensure the port is in the valid range, but the template doesn't validate or handle this case. Consider adding validation or a more explicit error message in the template comments to make this limitation clearer.

Copilot uses AI. Check for mistakes.
Comment on lines 107 to 108
{{- end}}
{{- end }}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

Missing space before closing braces. The line should be {{- end }} instead of {{- end}} to maintain consistency with the rest of the template file.

Suggested change
{{- end}}
{{- end }}
{{- end }}
{{- end }}

Copilot uses AI. Check for mistakes.
Comment on lines 100 to 108
{{- if eq $global.Values.gateway.type "NodePort" }}
{{- if $global.Values.gateway.stream.autoAssignNodePort }}
nodePort: {{ splitList ":" ($port.addr | toString) | last }}
{{- else }}
{{- if not (empty $port.nodePort) }}
nodePort: {{ $port.nodePort }}
{{- end }}
{{- end}}
{{- end }}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The auto-assign nodePort logic may not work as expected. When autoAssignNodePort is true, the code sets nodePort to the port value extracted from the address. However, if a user specifies addr: 3302 (a port outside the typical Kubernetes nodePort range of 30000-32767), this will fail when the service is created. The comment in values.yaml warns users to ensure the port is in the valid range, but the template doesn't validate or handle this case. Consider adding validation or a more explicit error message in the template comments to make this limitation clearer.

Copilot uses AI. Check for mistakes.
F
Signed-off-by: Nic <qianyong@api7.ai>
@nic-6443 nic-6443 merged commit b77960b into main Feb 12, 2026
2 checks passed
@nic-6443 nic-6443 deleted the nic/auto-assign-node-port branch February 12, 2026 07:34
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.

2 participants