From ff7a9b5dfba2b7ebbcefaae24c181d6291cd3a6f Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Tue, 3 Feb 2026 11:09:24 +0100 Subject: [PATCH 1/4] Introduce new 'acs-defaults' resource profile. This is a no-op resource profile. --- cmd/deploy.go | 2 +- internal/deployer/deploy_via_operator.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/deploy.go b/cmd/deploy.go index 578000b2..6b246865 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -39,7 +39,7 @@ Examples: cmd.Flags().StringVar(&overrideFile, "override", "", "Path to YAML file with overrides") cmd.Flags().StringArrayVar(&overrideSetExpressions, "set", []string{}, "Set override values (can specify multiple times, e.g., --set foo.bar=val)") cmd.Flags().StringVar(&exposure, "exposure", "loadbalancer", "Central exposure backend (loadbalancer, none)") - cmd.Flags().StringVar(&resources, "resources", "auto", "Resource sizing preset (auto=cluster-based, medium, small)") + cmd.Flags().StringVar(&resources, "resources", "acs-defaults", "Resource sizing preset (acs-defaults, auto, medium, small)") cmd.Flags().StringVar(&shell, "shell", "", "Shell to spawn after Central deployment") cmd.Flags().StringVar(&envrc, "envrc", "", "Write environment to file instead of spawning sub-shell") cmd.Flags().BoolVar(&singleNamespace, "single-namespace", false, "Deploy all components in a single namespace ('stackrox' by default)") diff --git a/internal/deployer/deploy_via_operator.go b/internal/deployer/deploy_via_operator.go index 04a446b7..1c529000 100644 --- a/internal/deployer/deploy_via_operator.go +++ b/internal/deployer/deploy_via_operator.go @@ -348,6 +348,8 @@ func (d *Deployer) getCentralResourcesOperator(resourcesName string) map[string] var resources map[string]interface{} switch resourcesName { + case "acs-defaults": + // Nothing to do here, don't set any custom resources. case "small": resources = resourcesSmall case "medium": @@ -705,6 +707,8 @@ func (d *Deployer) getSecuredClusterResourcesOperator(resourcesName string) map[ var resources map[string]interface{} switch resourcesName { + case "acs-defaults": + // Nothing to do here, don't set any custom resources. case "small": resources = resourcesSmall case "medium": From 4e6c6929e1b1206b4311b390784eaa6898e543e5 Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Tue, 3 Feb 2026 11:21:13 +0100 Subject: [PATCH 2/4] Also move replica settings into the resource profiles so that --resources=acs-defaults will also use the default replica settings --- internal/deployer/deploy_via_operator.go | 100 +++++++++++++---------- 1 file changed, 57 insertions(+), 43 deletions(-) diff --git a/internal/deployer/deploy_via_operator.go b/internal/deployer/deploy_via_operator.go index 1c529000..7c956f12 100644 --- a/internal/deployer/deploy_via_operator.go +++ b/internal/deployer/deploy_via_operator.go @@ -257,28 +257,6 @@ func (d *Deployer) createCentralCR(resources, exposure string) (map[string]inter "enabled": false, }, }, - "scanner": map[string]interface{}{ - "analyzer": map[string]interface{}{ - "scaling": map[string]interface{}{ - "autoScaling": "Disabled", - "replicas": 1, - }, - }, - }, - "scannerV4": map[string]interface{}{ - "indexer": map[string]interface{}{ - "scaling": map[string]interface{}{ - "autoScaling": "Disabled", - "replicas": 1, - }, - }, - "matcher": map[string]interface{}{ - "scaling": map[string]interface{}{ - "autoScaling": "Disabled", - "replicas": 1, - }, - }, - }, }, } @@ -305,6 +283,12 @@ func (d *Deployer) getCentralResourcesOperator(resourcesName string) map[string] }, "scanner": map[string]interface{}{ "scannerComponent": "Disabled", + "analyzer": map[string]interface{}{ + "scaling": map[string]interface{}{ + "autoScaling": "Disabled", + "replicas": 1, + }, + }, }, "scannerV4": map[string]interface{}{ "db": map[string]interface{}{ @@ -312,9 +296,17 @@ func (d *Deployer) getCentralResourcesOperator(resourcesName string) map[string] }, "indexer": map[string]interface{}{ "resources": centralScannerV4IndexerResourcesSmall, + "scaling": map[string]interface{}{ + "autoScaling": "Disabled", + "replicas": 1, + }, }, "matcher": map[string]interface{}{ "resources": centralScannerV4MatcherResourcesSmall, + "scaling": map[string]interface{}{ + "autoScaling": "Disabled", + "replicas": 1, + }, }, }, }, @@ -330,6 +322,12 @@ func (d *Deployer) getCentralResourcesOperator(resourcesName string) map[string] }, "scanner": map[string]interface{}{ "scannerComponent": "Disabled", + "analyzer": map[string]interface{}{ + "scaling": map[string]interface{}{ + "autoScaling": "Disabled", + "replicas": 1, + }, + }, }, "scannerV4": map[string]interface{}{ "db": map[string]interface{}{ @@ -337,9 +335,17 @@ func (d *Deployer) getCentralResourcesOperator(resourcesName string) map[string] }, "indexer": map[string]interface{}{ "resources": centralScannerV4IndexerResourcesMedium, + "scaling": map[string]interface{}{ + "autoScaling": "Disabled", + "replicas": 1, + }, }, "matcher": map[string]interface{}{ "resources": centralScannerV4MatcherResourcesMedium, + "scaling": map[string]interface{}{ + "autoScaling": "Disabled", + "replicas": 1, + }, }, }, }, @@ -641,25 +647,6 @@ func (d *Deployer) createSecuredClusterCR(clusterName, resources string) (map[st "imagePullSecrets": []map[string]string{ {"name": "stackrox"}, }, - "admissionControl": map[string]interface{}{ - "replicas": 1, - }, - "scanner": map[string]interface{}{ - "analyzer": map[string]interface{}{ - "scaling": map[string]interface{}{ - "autoScaling": "Enabled", - "replicas": 1, - }, - }, - }, - "scannerV4": map[string]interface{}{ - "indexer": map[string]interface{}{ - "scaling": map[string]interface{}{ - "autoScaling": "Disabled", - "replicas": 1, - }, - }, - }, }, } @@ -683,23 +670,50 @@ func (d *Deployer) getSecuredClusterResourcesOperator(resourcesName string) map[ }, "scanner": map[string]interface{}{ "scannerComponent": "Disabled", + "analyzer": map[string]interface{}{ + "scaling": map[string]interface{}{ + "autoScaling": "Enabled", + "replicas": 1, + }, + }, }, "scannerV4": map[string]interface{}{ "scannerComponent": "Disabled", + "indexer": map[string]interface{}{ + "scaling": map[string]interface{}{ + "autoScaling": "Disabled", + "replicas": 1, + }, + }, }, }, } resourcesMedium := map[string]interface{}{ "spec": map[string]interface{}{ - "sensor": map[string]interface{}{ - "resources": securedClusterSensorResourcesMedium, + "admissionControl": map[string]interface{}{ + "replicas": 1, }, "scanner": map[string]interface{}{ "scannerComponent": "Disabled", + "analyzer": map[string]interface{}{ + "scaling": map[string]interface{}{ + "autoScaling": "Enabled", + "replicas": 1, + }, + }, + }, + "sensor": map[string]interface{}{ + "resources": securedClusterSensorResourcesMedium, }, "scannerV4": map[string]interface{}{ "scannerComponent": "Disabled", + "indexer": map[string]interface{}{ + "scaling": map[string]interface{}{ + "autoScaling": "Disabled", + "replicas": 1, + }, + }, }, }, } From b5104759da14ff5d4d5711d0bbce5a00b96f3603 Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Tue, 3 Feb 2026 11:32:05 +0100 Subject: [PATCH 3/4] Add log message --- internal/deployer/deploy_via_operator.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/deployer/deploy_via_operator.go b/internal/deployer/deploy_via_operator.go index 7c956f12..083e8b53 100644 --- a/internal/deployer/deploy_via_operator.go +++ b/internal/deployer/deploy_via_operator.go @@ -260,6 +260,7 @@ func (d *Deployer) createCentralCR(resources, exposure string) (map[string]inter }, } + d.logger.Infof("Using Central resource profile: %s", resources) resourcesOverlay := d.getCentralResourcesOperator(resources) overrides, err := GetOverrides(d.overrideFile, d.overrideSetExpressions) From 694c72dee6f78434919f049866aa073fc1ff013c Mon Sep 17 00:00:00 2001 From: Moritz Clasmeier Date: Tue, 3 Feb 2026 11:32:45 +0100 Subject: [PATCH 4/4] For consistency, also use medium resource profile when deploying to Infra GKE and resource profile is 'auto'. Simplify. --- cmd/deploy.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/deploy.go b/cmd/deploy.go index 6b246865..48850c72 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -199,14 +199,14 @@ func resolveAutoResources(clusterType env.ClusterType, log *logger.Logger) strin switch clusterType { case env.LocalKind: resolvedResources = "small" - log.Info("Auto-detected cluster type Kind: using small resources") case env.InfraOpenShift4: + case env.InfraGKE: resolvedResources = "medium" - log.Info("Auto-detected cluster type OpenShift 4: using medium resources") default: - resolvedResources = "default" - log.Info("Auto-detected cluster type " + clusterType.String() + ": using default resources") + resolvedResources = "acs-defaults" } + log.Infof("Auto-detected cluster type %s: using resource profile %q", clusterType.String(), resolvedResources) + return resolvedResources }