Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Examples:
cmd.Flags().StringVar(&resources, "resources", "auto", "Resource sizing preset (auto=cluster-based, 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)")

return cmd
}
Expand Down Expand Up @@ -135,6 +136,7 @@ func runDeploy(cmd *cobra.Command, args []string) error {
d.SetEarlyReadiness(earlyReadiness)
d.SetPortForwardingEnabled(portForwardEnabledFinal)
d.SetPauseReconciliation(pauseReconciliation)
d.SetSingleNamespace(singleNamespace)

// Resolve "auto" resources based on cluster type
resolvedResources := resources
Expand Down
1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var (
resources string
shell string
envrc string
singleNamespace bool
)

func main() {
Expand Down
3 changes: 3 additions & 0 deletions cmd/teardown.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func newTeardownCmd() *cobra.Command {
}

cmd.Flags().BoolVar(&helm, "helm", false, "Force teardown of Helm deployment")
cmd.Flags().BoolVar(&singleNamespace, "single-namespace", false, "Deploy all components in a single namespace ('stackrox' by default)")

return cmd
}
Expand All @@ -40,6 +41,8 @@ func runTeardown(cmd *cobra.Command, args []string) error {
return fmt.Errorf("failed to create deployer: %w", err)
}

d.SetSingleNamespace(singleNamespace)

ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
defer cancel()

Expand Down
8 changes: 6 additions & 2 deletions internal/deployer/constants.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package deployer

var (
internalCentralEndpoint = "central.acs-central.svc:443"
import "fmt"

var (
centralResourcesSmall = map[string]interface{}{
"requests": map[string]string{
"memory": "1Gi",
Expand Down Expand Up @@ -183,3 +183,7 @@ var (
},
}
)

func internalCentralEndpoint(namespace string) string {
return fmt.Sprintf("central.%s.svc:443", namespace)
}
2 changes: 1 addition & 1 deletion internal/deployer/deploy_via_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ func (d *Deployer) createSecuredClusterCR(clusterName, resources string) (map[st
},
"spec": map[string]interface{}{
"clusterName": clusterName,
"centralEndpoint": internalCentralEndpoint,
"centralEndpoint": internalCentralEndpoint(d.centralNamespace),
"imagePullSecrets": []map[string]string{
{"name": "stackrox"},
},
Expand Down
Loading