Skip to content

Commit 5a636db

Browse files
committed
Add --no-extras flag
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 7a0c182 commit 5a636db

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cmd/install.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ func MakeInstall() *cobra.Command {
4242
command.Flags().String("local-path", "kubeconfig", "Local path to save the kubeconfig file")
4343
command.Flags().String("context", "default", "Set the name of the kubeconfig context.")
4444
command.Flags().String("k3s-extra-args", "", "Optional extra arguments to pass to k3s installer, wrapped in quotes (e.g. --k3s-extra-args '--no-deploy servicelb')")
45+
command.Flags().Bool("no-extras", false, `Disable "servicelb" and "traefik"`)
46+
4547
command.Flags().Bool("ipsec", false, "Enforces and/or activates optional extra argument for k3s: flannel-backend option: ipsec")
46-
command.Flags().Bool("merge", false, "Merge the config with existing kubeconfig if it already exists.\nProvide the --local-path flag with --merge if a kubeconfig already exists in some other directory")
48+
command.Flags().Bool("merge", false, `Merge the config with existing kubeconfig if it already exists.
49+
Provide the --local-path flag with --merge if a kubeconfig already exists in some other directory`)
4750
command.Flags().String("k3s-version", config.K3sVersion, "Optional version to install, pinned at a default")
4851

4952
command.Flags().Bool("local", false, "Perform a local install without using ssh")
@@ -65,6 +68,8 @@ func MakeInstall() *cobra.Command {
6568

6669
k3sVersion, _ := command.Flags().GetString("k3s-version")
6770
k3sExtraArgs, _ := command.Flags().GetString("k3s-extra-args")
71+
k3sNoExtras, _ := command.Flags().GetBool("no-extras")
72+
6873
flannelIPSec, _ := command.Flags().GetBool("ipsec")
6974

7075
local, _ := command.Flags().GetBool("local")
@@ -81,6 +86,9 @@ func MakeInstall() *cobra.Command {
8186
if flannelIPSec {
8287
k3sExtraArgs += ` '--flannel-backend ipsec'`
8388
}
89+
if k3sNoExtras {
90+
k3sExtraArgs += `--no-deploy servicelb --no-deploy traefik`
91+
}
8492

8593
installk3sExec := fmt.Sprintf("INSTALL_K3S_EXEC='server %s --tls-san %s %s'", clusterStr, ip, strings.TrimSpace(k3sExtraArgs))
8694

0 commit comments

Comments
 (0)