Skip to content

Netbird: add stunService.nodePort#73

Open
DaniD3v wants to merge 1 commit intoKitStream:mainfrom
DaniD3v:main
Open

Netbird: add stunService.nodePort#73
DaniD3v wants to merge 1 commit intoKitStream:mainfrom
DaniD3v:main

Conversation

@DaniD3v
Copy link
Copy Markdown

@DaniD3v DaniD3v commented Apr 19, 2026

adds stunService.nodePort

I like specifying NodePort.
I could not do this with the existing chart.

server:
  stunService:
    type: NodePort
    port: 3478
    nodePort: 30478

Copy link
Copy Markdown
Contributor

@mikkeldamsgaard mikkeldamsgaard left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution — small, focused change and the core logic is right. One blocker before this can merge.

nodePort is missing from values.yaml. The README values table documents server.stunService.nodePort, but charts/netbird/values.yaml (the stunService block around L416–419) still only declares type, port, and annotations. The convention in this chart is that every documented value is present in values.yaml with a # -- comment — that's what users discover via helm show values, and what drives the generated values table. Please add something like:

  stunService:
    type: LoadBalancer
    port: 3478
    # -- Fixed NodePort to assign when type is NodePort. Omit/null to let
    # Kubernetes allocate one from the nodePort range (default 30000–32767).
    nodePort: null
    annotations: {}

Two non-blocking nits left inline on the test file. Happy to re-review once the values.yaml entry is in.

Comment on lines +65 to +71
- contains:
path: spec.ports
content:
name: stun
port: 3478
targetPort: stun
protocol: UDP
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Weak negative-case assertion. helm-unittest's contains is a subset match on array elements — it will pass whether or not nodePort is present, so this doesn't actually verify the guard. Tighten by asserting the field is absent, e.g.:

asserts:
  - isNull:
      path: spec.ports[0].nodePort

port: 3478
targetPort: stun
protocol: UDP
nodePort: 30478
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing test: NodePort type with nodePort unset. There's no case for type: NodePort without an explicit nodePort value — i.e. that the template omits the field and lets Kubernetes allocate. The and guard in the template depends on that path, so worth locking in a case right after this one.

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