Commit a84c75af authored by Joe Kralicky's avatar Joe Kralicky

Adds a command-line flag '--disable-helm-controller' that will disable

the server's built-in helm controller. Problem: Testing installation and uninstallation of the Helm Controller on k3s is not possible if the Helm Controller is baked into the k3s server. Solution: The Helm Controller can optionally be disabled, which will allow users to manage its installation manually. Signed-off-by: 's avatarJoe Kralicky <joe.kralicky@suse.com>
parent cf557127
......@@ -53,6 +53,7 @@ type Server struct {
DefaultLocalStoragePath string
DisableCCM bool
DisableNPC bool
DisableHelmController bool
DisableKubeProxy bool
DisableAPIServer bool
DisableControllerManager bool
......@@ -340,6 +341,11 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
Destination: &ServerConfig.DisableNPC,
},
cli.BoolFlag{
Name: "disable-helm-controller",
Usage: "(components) Disable Helm controller",
Destination: &ServerConfig.DisableHelmController,
},
cli.BoolFlag{
Name: "disable-apiserver",
Hidden: true,
Usage: "(experimental/components) Disable running api server",
......
......@@ -119,6 +119,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
serverConfig.ControlConfig.ExtraCloudControllerArgs = cfg.ExtraCloudControllerArgs
serverConfig.ControlConfig.DisableCCM = cfg.DisableCCM
serverConfig.ControlConfig.DisableNPC = cfg.DisableNPC
serverConfig.ControlConfig.DisableHelmController = cfg.DisableHelmController
serverConfig.ControlConfig.DisableKubeProxy = cfg.DisableKubeProxy
serverConfig.ControlConfig.DisableETCD = cfg.DisableETCD
serverConfig.ControlConfig.DisableAPIServer = cfg.DisableAPIServer
......
......@@ -140,6 +140,7 @@ type Control struct {
SystemDefaultRegistry string
DisableCCM bool
DisableNPC bool
DisableHelmController bool
DisableKubeProxy bool
DisableAPIServer bool
DisableControllerManager bool
......
......@@ -186,14 +186,17 @@ func coreControllers(ctx context.Context, sc *Context, config *Config) error {
servicelb.DefaultLBImage = config.ControlConfig.SystemDefaultRegistry + "/" + servicelb.DefaultLBImage
}
helm.Register(ctx,
sc.Apply,
sc.Helm.Helm().V1().HelmChart(),
sc.Helm.Helm().V1().HelmChartConfig(),
sc.Batch.Batch().V1().Job(),
sc.Auth.Rbac().V1().ClusterRoleBinding(),
sc.Core.Core().V1().ServiceAccount(),
sc.Core.Core().V1().ConfigMap())
if !config.ControlConfig.DisableHelmController {
helm.Register(ctx,
sc.Apply,
sc.Helm.Helm().V1().HelmChart(),
sc.Helm.Helm().V1().HelmChartConfig(),
sc.Batch.Batch().V1().Job(),
sc.Auth.Rbac().V1().ClusterRoleBinding(),
sc.Core.Core().V1().ServiceAccount(),
sc.Core.Core().V1().ConfigMap())
}
if err := servicelb.Register(ctx,
sc.K8s,
sc.Apply,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment