File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -253,11 +253,18 @@ func (t *tunnelNodeReconciler) run(ctx context.Context, tn *corev1alpha.TunnelNo
253253 return fmt .Errorf ("unable to create API client: %w" , err )
254254 }
255255
256+ // In TUI mode the user owns the terminal — don't bind health/metrics
257+ // listeners on default ports that may collide with other apoxy processes.
258+ metricsBindAddr := metricsAddr
259+ if useTUI {
260+ metricsBindAddr = "0"
261+ }
262+
256263 mgr , err := ctrl .NewManager (client .RESTConfig , ctrl.Options {
257264 Scheme : scheme ,
258265 LeaderElection : false ,
259266 Metrics : metricsserver.Options {
260- BindAddress : metricsAddr ,
267+ BindAddress : metricsBindAddr ,
261268 },
262269 Cache : cache.Options {
263270 SyncPeriod : ptr .To (30 * time .Second ),
@@ -288,8 +295,8 @@ func (t *tunnelNodeReconciler) run(ctx context.Context, tn *corev1alpha.TunnelNo
288295 return mgr .Start (gctx )
289296 })
290297
291- // Start health endpoint server if configured
292- if healthAddr != "" {
298+ // Start health endpoint server if configured (skipped in TUI mode).
299+ if healthAddr != "" && ! useTUI {
293300 mux := http .NewServeMux ()
294301 mux .HandleFunc ("/healthz" , t .healthHandler )
295302
You can’t perform that action at this time.
0 commit comments