[FEAT][Helm] Add configurable NodePort support for router service#870
[FEAT][Helm] Add configurable NodePort support for router service#870ardecode wants to merge 2 commits intovllm-project:mainfrom
Conversation
Adds optional `routerSpec.nodePorts.router` and `routerSpec.nodePorts.lmcache` fields to allow users to pin stable NodePort values across helm upgrades, fixing the issue where Kubernetes would reassign random ports on each upgrade. Closes vllm-project#763 Signed-off-by: ardecode <desaiarijit@gmail.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Helm chart for the router service by introducing configurable NodePort assignments. This change aims to improve the stability and predictability of deployments by allowing users to define specific NodePorts for the router and Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
@ruizhang0101 , PR is ready for review! |
There was a problem hiding this comment.
Code Review
This pull request adds configurable NodePort support for the router service, which is a useful feature for ensuring stable network endpoints across Helm upgrades. The changes are logical and well-documented in values.yaml. I have added a couple of suggestions for the Helm template in service-router.yaml to improve its robustness by adopting a more standard templating pattern that better handles whitespace, thus preventing potential rendering issues.
| {{- if and (eq .Values.routerSpec.serviceType "NodePort") .Values.routerSpec.nodePorts.router }} | ||
| nodePort: {{ .Values.routerSpec.nodePorts.router }} | ||
| {{- end }} |
There was a problem hiding this comment.
The current indentation of this conditional block can lead to extra newlines being rendered in the final YAML, which might cause parsing issues or unexpected formatting. A more robust and common pattern in Helm templates is to place the if/end control structures at the beginning of the line (with no indentation) and only indent the content within them. This approach provides better control over whitespace and improves template readability.
{{- if and (eq .Values.routerSpec.serviceType "NodePort") .Values.routerSpec.nodePorts.router }}
nodePort: {{ .Values.routerSpec.nodePorts.router }}
{{- end }}| {{- if and (eq .Values.routerSpec.serviceType "NodePort") .Values.routerSpec.nodePorts.lmcache }} | ||
| nodePort: {{ .Values.routerSpec.nodePorts.lmcache }} | ||
| {{- end }} |
There was a problem hiding this comment.
Similar to the previous comment, this conditional block's indentation could lead to unintended whitespace or newlines in the rendered YAML. Adopting the standard Helm practice of un-indented control structures will make the template more predictable and maintainable.
{{- if and (eq .Values.routerSpec.serviceType "NodePort") .Values.routerSpec.nodePorts.lmcache }}
nodePort: {{ .Values.routerSpec.nodePorts.lmcache }}
{{- end }}
ruizhang0101
left a comment
There was a problem hiding this comment.
LGTM :))) Thanks for the contribution!
This PR adds support for pinning stable NodePort values in the router service,
addressing the issue where
helm upgradecauses Kubernetes to reassign randomports on each update.
Two new optional fields are added under
routerSpec.nodePorts:router: NodePort for the main router service portlmcache: NodePort for the lmcache port (9000)Both fields default to
"", preserving existing behavior — if unset,Kubernetes assigns ports randomly as before. The
nodePortfield is onlyrendered in the Service manifest when
serviceTypeisNodePortand anexplicit value is provided.
Fixes #763
-swhen doinggit commit[Bugfix],[Feat], and[CI].