@@ -18,30 +18,33 @@ func newDeployCmd() *cobra.Command {
1818 cmd := & cobra.Command {
1919 Use : "deploy [component]" ,
2020 Short : "Deploy ACS components" ,
21- Long : `Deploy ACS components (central, secured-cluster).
21+ Long : `Deploy ACS components (central, secured-cluster, operator ).
2222
2323Examples:
2424 roxie deploy central
2525 roxie deploy secured-cluster
26- roxie deploy both` ,
27- ValidArgs : []string {"central" , "secured-cluster" , "both" , "all" },
26+ roxie deploy both
27+ roxie deploy operator` ,
28+ ValidArgs : []string {"central" , "secured-cluster" , "both" , "all" , "operator" },
2829 Args : cobra .MaximumNArgs (1 ),
2930 RunE : runDeploy ,
3031 }
3132
3233 cmd .Flags ().BoolVar (& helm , "helm" , false , "Deploy using Helm charts instead of operator" )
3334 _ = cmd .Flags ().MarkHidden ("helm" )
3435 cmd .Flags ().BoolVar (& olm , "olm" , false , "Deploy operator via OLM (requires OLM installed)" )
36+ cmd .Flags ().BoolVar (& konflux , "konflux" , false , "Use Konflux images" )
3537 cmd .Flags ().BoolVar (& deployOperator , "deploy-operator" , true , "Deploy and check operator (set to false to skip operator deployment/checks)" )
3638 cmd .Flags ().BoolVar (& portForwarding , "port-forwarding" , false , "Enable localhost port-forward for Central" )
3739 cmd .Flags ().BoolVar (& pauseReconciliation , "pause-reconciliation" , false , "Pause reconciliation after deployment" )
3840 cmd .Flags ().StringVar (& overrideFile , "override" , "" , "Path to YAML file with overrides" )
3941 cmd .Flags ().StringArrayVar (& overrideSetExpressions , "set" , []string {}, "Set override values (can specify multiple times, e.g., --set foo.bar=val)" )
4042 cmd .Flags ().StringVar (& exposure , "exposure" , "loadbalancer" , "Central exposure backend (loadbalancer, none)" )
41- cmd .Flags ().StringVar (& resources , "resources" , "auto " , "Resource sizing preset (auto=cluster-based , medium, small)" )
43+ cmd .Flags ().StringVar (& resources , "resources" , "acs-defaults " , "Resource sizing preset (acs-defaults, auto , medium, small)" )
4244 cmd .Flags ().StringVar (& shell , "shell" , "" , "Shell to spawn after Central deployment" )
4345 cmd .Flags ().StringVar (& envrc , "envrc" , "" , "Write environment to file instead of spawning sub-shell" )
4446 cmd .Flags ().BoolVar (& singleNamespace , "single-namespace" , false , "Deploy all components in a single namespace ('stackrox' by default)" )
47+ cmd .Flags ().StringVarP (& tag , "tag" , "t" , "" , "Main image tag to use for deployment (takes precedence over MAIN_IMAGE_TAG environment variable)" )
4548
4649 return cmd
4750}
@@ -64,6 +67,10 @@ func runDeploy(cmd *cobra.Command, args []string) error {
6467 component = args [0 ]
6568 }
6669
70+ if component == "operator" && helm {
71+ return errors .New ("cannot use --helm flag with 'operator' component" )
72+ }
73+
6774 if (component == "central" || component == "both" ) && os .Getenv ("ROXIE_SHELL" ) != "" {
6875 return errors .New ("already in a roxie sub-shell (ROXIE_SHELL environment variable is set), please exit the shell and try again" )
6976 }
@@ -109,6 +116,19 @@ func runDeploy(cmd *cobra.Command, args []string) error {
109116 return errors .New ("cannot use both --helm and --olm flags together" )
110117 }
111118
119+ if konflux {
120+ if helm {
121+ return errors .New ("cannot use both --helm and --konflux flags together (Konflux requires operator-based deployment)" )
122+ }
123+ if olm {
124+ return errors .New ("cannot use both --olm and --konflux flags together (not currently implemented)" )
125+ }
126+ clusterType := env .GetCurrentClusterType ()
127+ if clusterType != env .InfraOpenShift4 {
128+ return fmt .Errorf ("--konflux flag is only supported on OpenShift 4 clusters (current cluster type: %s)" , clusterType .String ())
129+ }
130+ }
131+
112132 if ! deployOperator && olm {
113133 return errors .New ("cannot use --deploy-operator=false with --olm (OLM requires operator deployment)" )
114134 }
@@ -123,6 +143,8 @@ func runDeploy(cmd *cobra.Command, args []string) error {
123143 d .PrintCentralDeploymentSummary ()
124144 case "secured-cluster" , "sensor" :
125145 d .PrintSecuredClusterDeploymentSummary ()
146+ case "operator" :
147+ // No deployment summary needed for operator-only deployment
126148 }
127149
128150 if envrc != "" {
@@ -142,6 +164,13 @@ func runDeploy(cmd *cobra.Command, args []string) error {
142164 }
143165 }
144166
167+ if konflux {
168+ if err := d .SetUseKonflux (true ); err != nil {
169+ return err
170+ }
171+
172+ }
173+
145174 d .SetDeployOperator (deployOperator )
146175
147176 d .SetVerbose (verbose )
@@ -150,9 +179,16 @@ func runDeploy(cmd *cobra.Command, args []string) error {
150179 d .SetPauseReconciliation (pauseReconciliation )
151180 d .SetSingleNamespace (singleNamespace )
152181
153- mainImageTag , err := helpers .LookupMainImageTag (log )
154- if err != nil {
155- return fmt .Errorf ("looking up main image tag: %w" , err )
182+ var mainImageTag string
183+ if tag != "" {
184+ log .Dimf ("Using main image tag from --tag flag: %s" , tag )
185+ mainImageTag = tag
186+ }
187+ if mainImageTag == "" {
188+ mainImageTag , err = helpers .LookupMainImageTag (log )
189+ if err != nil {
190+ return fmt .Errorf ("looking up main image tag: %w" , err )
191+ }
156192 }
157193 d .SetMainImageTag (mainImageTag )
158194
@@ -192,14 +228,15 @@ func resolveAutoResources(clusterType env.ClusterType, log *logger.Logger) strin
192228 switch clusterType {
193229 case env .LocalKind :
194230 resolvedResources = "small"
195- log .Info ("Auto-detected cluster type Kind: using small resources" )
196231 case env .InfraOpenShift4 :
197232 resolvedResources = "medium"
198- log .Info ("Auto-detected cluster type OpenShift 4: using medium resources" )
233+ case env .InfraGKE :
234+ resolvedResources = "medium"
199235 default :
200- resolvedResources = "default"
201- log .Info ("Auto-detected cluster type " + clusterType .String () + ": using default resources" )
236+ resolvedResources = "acs-defaults"
202237 }
203238
239+ log .Infof ("Auto-detected cluster type %s: using resource profile %q" , clusterType .String (), resolvedResources )
240+
204241 return resolvedResources
205242}
0 commit comments