Skip to content

feat(helm): allow to specify nodePort of UI Service#1528

Open
leomichalski wants to merge 2 commits intokagent-dev:mainfrom
leomichalski:helm/service-nodeport
Open

feat(helm): allow to specify nodePort of UI Service#1528
leomichalski wants to merge 2 commits intokagent-dev:mainfrom
leomichalski:helm/service-nodeport

Conversation

@leomichalski
Copy link

Problem

Currently, when exposing the UI Service using the NodePort service type, there is no way to explicitly define the nodePort value in the Helm chart. Users are forced to either accept a dynamically assigned port from the Kubernetes control plane or modify the manifests post-rendering.

Solution

This PR adds the ability to specify a nodePort for the UI Service.

  • Added a nodePort field to the UI service configuration block in values.yaml.
  • The field is only used if service type is already set to "NodePort".

Testing

To verify this change:

Scenario: default

Command: helm install kagent ./helm/kagent/ --namespace kagent-dev --dry-run | grep "targetPort: 8080" -A 5 -B 5

Output

   app.kubernetes.io/component: ui
spec:
  type: ClusterIP
  ports:
    - port: 8080
      targetPort: 8080
      
      protocol: TCP
      name: ui
  selector:
    app.kubernetes.io/name: kagent

Scenario: specify nodePort of NodePort Service

Command: helm install kagent ./helm/kagent/ --namespace kagent-dev --dry-run --set ui.service.ports.nodePort=30100 --set ui.service.type="NodePort" | grep "targetPort: 8080" -A 5 -B 5

Output

    app.kubernetes.io/component: ui
spec:
  type: NodePort
  ports:
    - port: 8080
      targetPort: 8080
      
      nodePort: 30100
      
      protocol: TCP
      name: ui

Scenario: specify nodePort of ClusterIP Service

Command: helm install kagent ./helm/kagent/ --namespace kagent-dev --dry-run --set ui.service.ports.nodePort=30100 | grep "targetPort: 8080" -A 5 -B 5

Output

    app.kubernetes.io/component: ui
spec:
  type: ClusterIP
  ports:
    - port: 8080
      targetPort: 8080
      
      protocol: TCP
      name: ui
  selector:
    app.kubernetes.io/name: kagent

Copilot AI review requested due to automatic review settings March 19, 2026 20:03
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

Adds Helm chart support for explicitly setting a Kubernetes nodePort on the UI Service when the service type is NodePort, enabling users to avoid auto-assigned ports and post-render manifest edits.

Changes:

  • Added ui.service.ports.nodePort to helm/kagent/values.yaml.
  • Updated the UI Service template to render nodePort when ui.service.type is NodePort.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
helm/kagent/values.yaml Introduces a nodePort value entry for the UI service port configuration.
helm/kagent/templates/ui-service.yaml Conditionally renders spec.ports[].nodePort for the UI Service when type is NodePort.

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

Signed-off-by: leomichalski <leonardomichalskim@gmail.com>
@leomichalski leomichalski force-pushed the helm/service-nodeport branch from 2c7a94f to 0e23aeb Compare March 19, 2026 20:08
…s null

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Leonardo <leonardomichalskim@gmail.com>
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