File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ func main() {
5454 logging .Fatalf ("Failed to load config: %v" , err )
5555 }
5656
57+ // Set the initial configuration in the global config
58+ // This is important for Kubernetes mode where the controller will update it
59+ config .Replace (cfg )
60+
5761 // Initialize distributed tracing if enabled
5862 ctx := context .Background ()
5963 if cfg .Observability .Tracing .Enabled {
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
1818 "google.golang.org/grpc"
1919 "google.golang.org/grpc/credentials"
2020
21+ "github.com/vllm-project/semantic-router/src/semantic-router/pkg/config"
2122 "github.com/vllm-project/semantic-router/src/semantic-router/pkg/observability/logging"
2223 tlsutil "github.com/vllm-project/semantic-router/src/semantic-router/pkg/utils/tls"
2324)
@@ -158,6 +159,15 @@ func (rs *RouterService) Process(stream ext_proc.ExternalProcessor_ProcessServer
158159
159160// watchConfigAndReload watches the config file and reloads router on changes.
160161func (s * Server ) watchConfigAndReload (ctx context.Context ) {
162+ // Check if we're using Kubernetes config source
163+ // If so, skip file watching as config is managed by the Kubernetes controller
164+ cfg := config .Get ()
165+ if cfg != nil && cfg .ConfigSource == config .ConfigSourceKubernetes {
166+ logging .Infof ("ConfigSource is kubernetes, skipping file watcher" )
167+ <- ctx .Done () // Just wait for context cancellation
168+ return
169+ }
170+
161171 watcher , err := fsnotify .NewWatcher ()
162172 if err != nil {
163173 logging .LogEvent ("config_watcher_error" , map [string ]interface {}{
You can’t perform that action at this time.
0 commit comments