Skip to content
Open
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
1 change: 1 addition & 0 deletions go/core/cli/cmd/kagent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func main() {
_ = installCmd.RegisterFlagCompletionFunc("profile", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return profiles.Profiles, cobra.ShellCompDirectiveNoFileComp
})
installCmd.Flags().BoolVar(&installCfg.NoDefaultAgents, "no-default-agents", false, "Disable all default agents for a minimal installation")

uninstallCmd := &cobra.Command{
Use: "uninstall",
Expand Down
28 changes: 26 additions & 2 deletions go/core/cli/internal/cli/agent/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,24 @@ import (
)

type InstallCfg struct {
Config *config.Config
Profile string
Config *config.Config
Profile string
NoDefaultAgents bool
}

// defaultAgents is the list of agent names installed by the kagent helm chart.
// Used by --no-default-agents to disable all of them via helm --set flags.
var defaultAgents = []string{
"k8s-agent",
"kgateway-agent",
"istio-agent",
"promql-agent",
"observability-agent",
"argo-rollouts-agent",
"helm-agent",
"cilium-policy-agent",
"cilium-manager-agent",
"cilium-debug-agent",
}

// installChart installs or upgrades a Helm chart with the given parameters
Expand Down Expand Up @@ -101,6 +117,14 @@ func InstallCmd(ctx context.Context, cfg *InstallCfg) *PortForward {
helmConfig.inlineValues = profiles.GetProfileYaml(cfg.Profile)
}

// --no-default-agents: disable every default agent via --set flags.
// Using --set ensures this takes precedence over any inline profile values.
if cfg.NoDefaultAgents {
for _, agent := range defaultAgents {
helmConfig.values = append(helmConfig.values, fmt.Sprintf("agents.%s.enabled=false", agent))
}
}

return install(ctx, cfg.Config, helmConfig, modelProvider)
}

Expand Down
Loading