@@ -204,9 +204,11 @@ func (r *Runner) Run(ctx context.Context) error {
204204 setupLog .Error (err , "Failed to extract GKNN" )
205205 return err
206206 }
207- disableK8sCrdReconcile := * endpointSelector != ""
208- controllerCfg := runserver .NewControllerConfig (disableK8sCrdReconcile )
209- ds , err := setupDatastore (setupLog , ctx , epf , int32 (opts .ModelServerMetricsPort ), disableK8sCrdReconcile ,
207+
208+ startCrdReconcilers := opts .EndpointSelector == "" // If endpointSelector is empty, it means it's not in the standalone mode. Then we should start the inferencePool and other CRD Reconciler.
209+ controllerCfg := runserver .NewControllerConfig (startCrdReconcilers )
210+
211+ ds , err := setupDatastore (setupLog , ctx , epf , int32 (opts .ModelServerMetricsPort ), startCrdReconcilers ,
210212 opts .PoolName , opts .PoolNamespace , opts .EndpointSelector , opts .EndpointTargetPorts )
211213 if err != nil {
212214 setupLog .Error (err , "Failed to setup datastore" )
@@ -329,7 +331,7 @@ func (r *Runner) Run(ctx context.Context) error {
329331 GrpcPort : opts .GRPCPort ,
330332 GKNN : * gknn ,
331333 Datastore : ds ,
332- DisableK8sCrdReconcile : controllerCfg ,
334+ ControllerCfg : controllerCfg ,
333335 SecureServing : opts .SecureServing ,
334336 HealthChecking : opts .HealthChecking ,
335337 CertPath : opts .CertPath ,
@@ -368,8 +370,8 @@ func (r *Runner) Run(ctx context.Context) error {
368370}
369371
370372func setupDatastore (setupLog logr.Logger , ctx context.Context , epFactory datalayer.EndpointFactory , modelServerMetricsPort int32 ,
371- disableK8sCrdReconcile bool , namespace , name , endpointSelector string , endpointTargetPorts []int ) (datastore.Datastore , error ) {
372- if ! disableK8sCrdReconcile {
373+ startCrdReconcilers bool , namespace , name , endpointSelector string , endpointTargetPorts []int ) (datastore.Datastore , error ) {
374+ if startCrdReconcilers {
373375 return datastore .NewDatastore (ctx , epFactory , modelServerMetricsPort ), nil
374376 } else {
375377 endpointPool := datalayer .NewEndpointPool (namespace , name )
0 commit comments