Preinclude all confiugration in management.json and prevent existing values from being rewritten #460

Closed
opened 2025-11-20 05:11:46 -05:00 by saavagebueno · 1 comment
Owner

Originally created by @MohammedNoureldin on GitHub (Sep 27, 2023).

Hi,

I would suggest to keep the management.json.tmpl file always up to date with all possible values that might be added by netbird server when it is booted.

This will allow us to mount a preconfigured configuration file directly without relying on netbird to generate some values and add them to this file. Configuration file in my opinion should be always static and be edited by the admin himself, and not by the software. If the software needs to generate any values (e.g., store key), they should be stored separately and not as part of the configuration file.

Even with the current implementation, we should have the possibility to preconfigure the configuration.json file and mount it as read-only.

At the moment, this is not possible, because the template file does not include all values that will be later be added by netbird, in addition, some values are tried to be written again even if they exist, concretely store key.

This is important for Kubernetes for example, because the most common way to mount configuration is through a configmap, which can be mounted only as read-only, in which netbird cannot add anything new on start.

This has been discussed with @pascal-fischer in this slack thread

Why am I reporting this as a bug and not as a feature request or idea?

Because as stated by @pascal-fischer, some values are being rewritten even if they exist in the management.json file, which prevents any form of read-only mount of the config file. And in the current implementation using Kuberenetes to mount configmap is not possible because of this.

Originally created by @MohammedNoureldin on GitHub (Sep 27, 2023). Hi, **I would suggest to keep the *management.json.tmpl* file always up to date with all possible values that might be added by netbird server when it is booted.** This will allow us to mount a preconfigured configuration file directly without relying on netbird to generate some values and add them to this file. Configuration file in my opinion should be always static and be edited by the admin himself, and not by the software. If the software needs to generate any values (e.g., store key), they should be stored separately and not as part of the configuration file. Even with the current implementation, we should have the possibility to preconfigure the configuration.json file and mount it as read-only. At the moment, this is not possible, because the template file does not include all values that will be later be added by netbird, in addition, **some values are tried to be written again even if they exist, concretely store key**. This is important for Kubernetes for example, because the most common way to mount configuration is through a configmap, which can be mounted only as read-only, in which netbird cannot add anything new on start. This has been discussed with @pascal-fischer in this [slack thread](https://netbirdio.slack.com/archives/C028VPB34NB/p1695601470437489) Why am I reporting this as a bug and not as a feature request or idea? Because as stated by @pascal-fischer, some values are being rewritten even if they exist in the management.json file, which prevents any form of read-only mount of the config file. And in the current implementation using Kuberenetes to mount configmap is not possible because of this.
Author
Owner

@MohammedNoureldin commented on GitHub (Jan 11, 2024):

To keep the backlog clean, I will close this now, if any deviation in the management.json is found, we can open it again.

@MohammedNoureldin commented on GitHub (Jan 11, 2024): To keep the backlog clean, I will close this now, if any deviation in the management.json is found, we can open it again.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#460