From 13c7bba3f36c1757ce7f1466b764d7fb4ae0b32d Mon Sep 17 00:00:00 2001 From: Luuk Blankenstijn <121433746+LuukBlankenstijn@users.noreply.github.com> Date: Tue, 9 Jun 2026 14:55:34 +0200 Subject: [PATCH] Pass management URL to ClusterProxy (#289) The proxy container defaults `--management-url` to `https://api.netbird.io`, so on self-hosted NetBird the proxy talks to SaaS and rejects the setup key as invalid. ## Summary by CodeRabbit * **New Features** * Added support for configuring a management URL for the cluster proxy service. --- cmd/main.go | 5 +++-- internal/controller/clusterproxy_controller.go | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index bf84da9..15da30a 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -313,8 +313,9 @@ func main() { os.Exit(1) } if err := (&controller.ClusterProxyReconciler{ - Client: mgr.GetClient(), - ApiKey: netbirdAPIKey, + Client: mgr.GetClient(), + ApiKey: netbirdAPIKey, + ManagementURL: managementURL, }).SetupWithManager(mgr); err != nil { setupLog.Error(err, "Failed to create controller", "controller", "ClusterProxy") os.Exit(1) diff --git a/internal/controller/clusterproxy_controller.go b/internal/controller/clusterproxy_controller.go index 79b3cbe..bc5ccbe 100644 --- a/internal/controller/clusterproxy_controller.go +++ b/internal/controller/clusterproxy_controller.go @@ -29,7 +29,8 @@ import ( type ClusterProxyReconciler struct { client.Client - ApiKey string + ApiKey string + ManagementURL string } // +kubebuilder:rbac:groups=netbird.io,resources=clusterproxies,verbs=get;list;watch;create;update;patch;delete @@ -124,6 +125,8 @@ func (r *ClusterProxyReconciler) Reconcile(ctx context.Context, req ctrl.Request clusterProxy.Spec.ClusterName, "--kubernetes-api-server", clusterProxy.Spec.APIServer, + "--management-url", + r.ManagementURL, ). WithEnv( corev1ac.EnvVar().