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
13 changes: 10 additions & 3 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ func newDeployCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "deploy [component]",
Short: "Deploy ACS components",
Long: `Deploy ACS components (central, secured-cluster).
Long: `Deploy ACS components (central, secured-cluster, operator).

Examples:
roxie deploy central
roxie deploy secured-cluster
roxie deploy both`,
ValidArgs: []string{"central", "secured-cluster", "both", "all"},
roxie deploy both
roxie deploy operator`,
ValidArgs: []string{"central", "secured-cluster", "both", "all", "operator"},
Args: cobra.MaximumNArgs(1),
RunE: runDeploy,
}
Expand Down Expand Up @@ -64,6 +65,10 @@ func runDeploy(cmd *cobra.Command, args []string) error {
component = args[0]
}

if component == "operator" && helm {
return errors.New("cannot use --helm flag with 'operator' component")
}

if (component == "central" || component == "both") && os.Getenv("ROXIE_SHELL") != "" {
return errors.New("already in a roxie sub-shell (ROXIE_SHELL environment variable is set), please exit the shell and try again")
}
Expand Down Expand Up @@ -123,6 +128,8 @@ func runDeploy(cmd *cobra.Command, args []string) error {
d.PrintCentralDeploymentSummary()
case "secured-cluster", "sensor":
d.PrintSecuredClusterDeploymentSummary()
case "operator":
// No deployment summary needed for operator-only deployment
}

if envrc != "" {
Expand Down
13 changes: 13 additions & 0 deletions internal/deployer/deploy_via_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ import (
"gopkg.in/yaml.v3"
)

// deployOperatorOnly deploys only the operator without any Central or SecuredCluster resources
func (d *Deployer) deployOperatorOnly(ctx context.Context) error {
d.logger.Info("🚀 Deploying Operator only...")

if err := d.ensureOperatorDeployed(ctx); err != nil {
return err
}

d.logger.Success("✓ Operator deployed successfully")
d.logger.Info("You can now deploy Central or SecuredCluster components separately")
return nil
}

// ensureOperatorDeployed ensures the operator is deployed with the correct version and mode
func (d *Deployer) ensureOperatorDeployed(ctx context.Context) error {
// Skip operator deployment/checks if flag is set to false
Expand Down
4 changes: 4 additions & 0 deletions internal/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ func formatComponentName(component string) string {
return "Secured Cluster"
case "central":
return "Central"
case "operator":
return "Operator"
default:
return component
}
Expand All @@ -389,6 +391,8 @@ func (d *Deployer) Deploy(ctx context.Context, component, resources, exposure st
d.logger.Infof("Initiating deployment of %s", formatComponentName(component))

switch component {
case "operator":
return d.deployOperatorOnly(ctx)
case "central":
return d.deployCentral(ctx, resources, exposure)
case "secured-cluster", "sensor":
Expand Down
Loading