@@ -44,9 +44,6 @@ import (
4444 appsv1alpha1 "github.com/NVIDIA/k8s-nim-operator/api/apps/v1alpha1"
4545 "github.com/NVIDIA/k8s-nim-operator/internal/conditions"
4646 "github.com/NVIDIA/k8s-nim-operator/internal/controller"
47- "github.com/NVIDIA/k8s-nim-operator/internal/controller/platform"
48- "github.com/NVIDIA/k8s-nim-operator/internal/controller/platform/kserve"
49- "github.com/NVIDIA/k8s-nim-operator/internal/controller/platform/standalone"
5047 "github.com/NVIDIA/k8s-nim-operator/internal/render"
5148 webhookappsv1alpha1 "github.com/NVIDIA/k8s-nim-operator/internal/webhook/apps/v1alpha1"
5249 // +kubebuilder:scaffold:imports
@@ -74,8 +71,9 @@ func main() {
7471 var enableHTTP2 bool
7572 var platformType string
7673
77- flag .StringVar (& platformType , "platform" , "standalone" , "The model-serving inference platform to use." +
78- "E.g., 'standalone (default)', 'kserve'." )
74+ flag .StringVar (& platformType , "platform" , "" , "DEPRECATED: Default platform for all NIMServices. " +
75+ "Use the 'platform' field in NIMService CR instead. If specified, this value is used as fallback " +
76+ "when NIMService doesn't specify a platform. Valid values: 'standalone', 'kserve'." )
7977 flag .StringVar (& metricsAddr , "metrics-bind-address" , "0" , "The address the metric endpoint binds to. " +
8078 "Use the port :8080. If not set, it will be 0 in order to disable the metrics server" )
8179 flag .StringVar (& probeAddr , "health-probe-bind-address" , ":8081" , "The address the probe endpoint binds to." )
@@ -94,15 +92,16 @@ func main() {
9492
9593 ctrl .SetLogger (zap .New (zap .UseFlagOptions (& opts )))
9694
97- var platformImpl platform.Platform
98- switch platformType {
99- case "standalone" :
100- platformImpl = & standalone.Standalone {}
101- case "kserve" :
102- platformImpl = & kserve.KServe {}
103- default :
104- setupLog .Error (nil , "unsupported model-serving platform type" , "platformType" , platformType )
105- os .Exit (1 )
95+ // Validate the deprecated global platform flag if provided
96+ if platformType != "" {
97+ setupLog .Info ("DEPRECATED: Global platform flag is deprecated. Use 'platform' field in NIMService CR instead." , "platform" , platformType )
98+ switch platformType {
99+ case "standalone" , "kserve" :
100+ // Valid platform types for the deprecated global platform flag. No need to throw an error.
101+ default :
102+ setupLog .Error (nil , "unsupported model-serving platform type" , "platformType" , platformType )
103+ os .Exit (1 )
104+ }
106105 }
107106
108107 // if the enable-http2 flag is false (the default), http/2 should be disabled
@@ -166,7 +165,6 @@ func main() {
166165 mgr .GetClient (),
167166 mgr .GetScheme (),
168167 ctrl .Log .WithName ("controllers" ).WithName ("NIMCache" ),
169- platformImpl ,
170168 ).SetupWithManager (mgr ); err != nil {
171169 setupLog .Error (err , "unable to create controller" , "controller" , "NIMCache" )
172170 os .Exit (1 )
@@ -179,7 +177,6 @@ func main() {
179177 discoveryClient ,
180178 render .NewRenderer ("/manifests" ),
181179 ctrl .Log .WithName ("controllers" ).WithName ("NIMService" ),
182- platformImpl ,
183180 ).SetupWithManager (mgr ); err != nil {
184181 setupLog .Error (err , "unable to create controller" , "controller" , "NIMService" )
185182 os .Exit (1 )
@@ -197,7 +194,6 @@ func main() {
197194 mgr .GetClient (),
198195 mgr .GetScheme (),
199196 ctrl .Log .WithName ("controllers" ).WithName ("NIMBuild" ),
200- platformImpl ,
201197 ).SetupWithManager (mgr ); err != nil {
202198 setupLog .Error (err , "unable to create controller" , "controller" , "NIMBuild" )
203199 os .Exit (1 )
0 commit comments