diff --git a/README.md b/README.md index 5f3bd6b3..3b9d1255 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,8 @@ Other options for `install`: * `--merge` - Merge config into existing file instead of overwriting (e.g. to add config to the default kubectl config, use `--local-path ~/.kube/config --merge`). * `--context` - default is `default` - set the name of the kubeconfig context. * `--ssh-port` - default is `22`, but you can specify an alternative port i.e. `2222` -* `--k3s-extra-args` - Optional extra arguments to pass to k3s installer, wrapped in quotes, i.e. `--k3s-extra-args '--no-deploy traefik'` or `--k3s-extra-args '--docker'`. For multiple args combine then within single quotes `--k3s-extra-args '--no-deploy traefik --docker'`. +* `--no-extras` - disable "servicelb" and "traefik" +* `--k3s-extra-args` - Optional extra arguments to pass to k3s installer, wrapped in quotes, i.e. `--k3s-extra-args '--disable traefik'` or `--k3s-extra-args '--docker'`. For multiple args combine then within single quotes `--k3s-extra-args '--disable traefik --docker'`. * `--k3s-version` - set the specific version of k3s, i.e. `v1.21.1` * `--k3s-channel` - set a specific version of k3s based upon a channel i.e. `stable` - `--ipsec` - Enforces the optional extra argument for k3s: `--flannel-backend` option: `ipsec` @@ -701,6 +702,8 @@ The most common problem is that you missed a step, fortunately it's relatively e - You are using different usernames for SSH'ing to the server and the node to be added. In that case, playe provide the username for the server via the `--server-user` parameter. * Your `.ssh/config` file isn't being used by K3sup. K3sup does not use the config file used by the `ssh` command-line, but instead uses CLI flags, run `k3sup install/join --help` to learn which are supported. +> Note: Passing `--no-deploy` to `--k3s-extra-args` was deprecated by the K3s installer in K3s 1.17. Use `--disable` instead or `--no-extras`. + ### Support and k3sup for commercial use * K3sup doesn't use a declarative YAML file to setup all my hosts. This is by design, feel free to write a very short bash script instead, it will be equivalent, since `k3sup install/join` can be run multiple times without side-effects. diff --git a/cmd/install.go b/cmd/install.go index 81e1f018..29a1a02b 100644 --- a/cmd/install.go +++ b/cmd/install.go @@ -68,7 +68,7 @@ func MakeInstall() *cobra.Command { --skip-install # Install a specific version on local machine without using SSH - k3sup install --local --k3s-version v1.19.7 + k3sup install --local --k3s-version v1.25.1 # Install, passing extra args to K3s k3sup install --local --k3s-extra-args="--data-dir /mnt/ssd/k3s" @@ -111,7 +111,7 @@ Provide the --local-path flag with --merge if a kubeconfig already exists in som command.Flags().String("token", "", "the token used to encrypt the datastore, must be the same token for all nodes") command.Flags().String("k3s-version", "", "Set a version to install, overrides k3s-channel") - command.Flags().String("k3s-extra-args", "", "Additional arguments to pass to k3s installer, wrapped in quotes (e.g. --k3s-extra-args '--no-deploy servicelb')") + command.Flags().String("k3s-extra-args", "", "Additional arguments to pass to k3s installer, wrapped in quotes (e.g. --k3s-extra-args '--disable servicelb')") command.Flags().String("k3s-channel", PinnedK3sChannel, "Release channel: stable, latest, or pinned v1.19") command.Flags().String("tls-san", "", "Use an additional IP or hostname for the API server") @@ -586,8 +586,8 @@ func makeInstallExec(cluster bool, host, tlsSAN string, options k3sExecOptions) } if options.NoExtras { - extraArgs = append(extraArgs, "--no-deploy servicelb") - extraArgs = append(extraArgs, "--no-deploy traefik") + extraArgs = append(extraArgs, "--disable servicelb") + extraArgs = append(extraArgs, "--disable traefik") } extraArgs = append(extraArgs, options.ExtraArgs) diff --git a/cmd/install_test.go b/cmd/install_test.go index 8b96f9ce..56da64a0 100644 --- a/cmd/install_test.go +++ b/cmd/install_test.go @@ -255,7 +255,7 @@ func Test_makeInstallExec_Datastore_NoExtras(t *testing.T) { NoExtras: k3sNoExtras, ExtraArgs: k3sExtraArgs, }) - want := "INSTALL_K3S_EXEC='server --tls-san 192.168.0.1 --datastore-endpoint mysql://doadmin:show-password@tcp(db-mysql-lon1-40939-do-user-2197152-0.b.db.ondigitalocean.com:25060)/defaultdb --token this-token --no-deploy servicelb --no-deploy traefik'" + want := "INSTALL_K3S_EXEC='server --tls-san 192.168.0.1 --datastore-endpoint mysql://doadmin:show-password@tcp(db-mysql-lon1-40939-do-user-2197152-0.b.db.ondigitalocean.com:25060)/defaultdb --token this-token --disable servicelb --disable traefik'" if got != want { t.Errorf("want: %q, got: %q", want, got) }