Skip to content

feat(netbird): keep the management image's data directory - #77

Open
codechirag5610 wants to merge 1 commit into
netbirdio:mainfrom
codechirag5610:fix/mgmt-datadir-mount
Open

codechirag5610 wants to merge 1 commit into
netbirdio:mainfrom
codechirag5610:fix/mgmt-datadir-mount

Conversation

@codechirag5610

Copy link
Copy Markdown

Closes #19.

Problem

The management deployment always mounts a data volume at persistence.mountPath — a PVC when persistence is on, an emptyDir when it is off. Either way the mount hides whatever the image ships at that path.

That breaks air-gapped installs. Since NetBird 0.55 management fails when it cannot download its geolocation databases, so the documented workaround is to bake them into the image at /var/lib/netbird — which the chart then masks with an empty volume.

Change

backend.split.management.persistence.mount, true by default, drops both the volume and its mount when set to false, leaving the image's own directory in place. Enabling persistence while mount: false fails the render, since a claim that is never mounted keeps no data.

backend:
  split:
    management:
      image:
        repository: my-registry/netbird-management-airgap
      persistence:
        enabled: false
        mount: false

The default is unchanged, so the existing emptyDir-for-a-writable-datadir behaviour (and render.sh check 21) still holds. The image's directory must already be writable by the user the pod runs as.

Tests

  • New render.sh check 24: with enabled: false + mount: false the deployment renders no data volume, no emptyDir, no mountPath: /var/lib/netbird and no PVC, while the management.json ConfigMap mount stays; mount: false with persistence enabled fails the render.
  • helm lint --strict, both render.sh suites, all seven example renders and kubeconform pass. Existing check 21 still passes.
  • Verified on a kind cluster (k8s 1.37) with an image built from netbirdio/management:0.82.0 with stub geolocation files baked into /var/lib/netbird:
    • mount: true (today's behaviour) — directory empty, /proc/mounts shows ext4 mounted over /var/lib/netbird
    • mount: false — GeoLite2-City.mmdb and geonames.db intact, no mount at that path

This touches the tail of tests/render.sh and docs/configuration.md, so it overlaps textually with my #73 and #21 branches; whichever merges later needs a small rebase.

The chart always mounted a volume at the management data directory, an
emptyDir when persistence was disabled. That hides anything the image
ships at the same path, so an air-gapped image that bakes in the
geolocation databases starts with an empty /var/lib/netbird and
management fails when it cannot download them.

backend.split.management.persistence.mount, true by default, drops the
volume and its mount when set to false, leaving the image's directory
in place. Enabling persistence without the mount fails the render,
because a claim that is never mounted keeps no data.

Closes netbirdio#19

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cfb999bb-ccfa-493f-9fad-40c6a9025f54
Commits

Reviewing files that changed from the base of the PR and between 838d587 and 17d67d5.

Files selected for processing: 4

  • charts/netbird/docs/configuration.md
  • charts/netbird/templates/split/management/deployment.yaml
  • charts/netbird/tests/render.sh
  • charts/netbird/values.yaml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codechirag5610

Copy link
Copy Markdown
Author

Ran the repository's own e2e suite against this branch, since the workflows here are waiting on approval:

go test -tags e2e ./netbird/... -count 1 -timeout 30m
ok  github.com/netbirdio/helms/e2e/netbird

Real peers connected through the chart as usual, and the suite cleaned up after itself. helm lint --strict, charts/netbird/tests/render.sh and charts/netbird-ee/tests/render.sh — the three steps of Test netbird Chart — pass too.

This branch has not been deployed

No deployments
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.

Netbird in Airgap environnement

1 participant