Skip to content

Commit

Permalink
Rename no-deploy to disable
Browse files Browse the repository at this point in the history
Due to a change in the K3s installer, this is being changed.

There is no compatibility with K3s 1.17 for this version of
the tool.

Use an older version if you wish to use K3s 1.17.

Closes: #397 #396 #394

Users who find value in K3sup are encouraged to sponsor
me on GitHub, being taken for granted is not a motivator.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Dec 20, 2022
1 parent b2d7446 commit 02c7a77
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -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`
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions cmd/install.go
Expand Up @@ -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"
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/install_test.go
Expand Up @@ -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)
}
Expand Down

0 comments on commit 02c7a77

Please sign in to comment.