Skip to content

Commit

Permalink
feat(autok3s): change --master & --worker default value to 0
Browse files Browse the repository at this point in the history
Signed-off-by: Jason-ZW <zhenyang@rancher.com>
  • Loading branch information
rancher-sy-bot committed Sep 25, 2020
1 parent c3a2444 commit 854199d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ You can also use it to join hosts as agents to the K3s cluster. It will automati
Then user can use `autok3s kubectl` command quickly access the cluster.

Use [viper](https://github.com/spf13/viper) to bind flags and configuration file. `autok3s` will generate a configuration file to store cloud-providers' access information at the specified location(`/var/lib/rancher/autok3s/config.yaml`) to reduce the number of flags to be passed for multiple runs.
```
autok3s:
providers:
alibaba:
access-key: <access-key>
access-secret: <access-secret>
```

It's also generated a state file `/var/lib/rancher/autok3s/.state` to record the clusters' information created on this host.

Expand All @@ -31,12 +24,12 @@ The user can get the commands available for different providers according to the
### Setup K3s Cluster
If already have access information in `/var/lib/rancher/autok3s/config.yaml` you can use the simplified command.
```
sudo autok3s create --provider alibaba --region <region> --name <cluster name> --key-pair <key-pair id> --v-switch <v-switch id> --security-group <security-group id> --ssh-key-path <ssh-key-path>
sudo autok3s create --provider alibaba --region <region> --name <cluster name> --key-pair <key-pair id> --v-switch <v-switch id> --security-group <security-group id> --ssh-key-path <ssh-key-path> --master 1
```

Generic commands can be used anywhere.
```
sudo autok3s create --provider alibaba --region <region> --name <cluster name> --key-pair <key-pair id> --v-switch <v-switch id> --security-group <security-group id> --ssh-key-path <ssh-key-path> --access-key <access-key> --access-secret <access-secret>
sudo autok3s create --provider alibaba --region <region> --name <cluster name> --key-pair <key-pair id> --v-switch <v-switch id> --security-group <security-group id> --ssh-key-path <ssh-key-path> --access-key <access-key> --access-secret <access-secret> --master 1
```

HA mode need `--master` greater than 1, also need to specify `--datastore` e.g.
Expand All @@ -47,12 +40,12 @@ HA mode need `--master` greater than 1, also need to specify `--datastore` e.g.
### Join K3s Nodes
If you have ever created a cluster using `autok3s` on your current machine, you can use the simplified command.
```
sudo autok3s join --provider alibaba --region <region> --name <cluster name> --ssh-key-path <ssh-key-path>
sudo autok3s join --provider alibaba --region <region> --name <cluster name> --ssh-key-path <ssh-key-path> --worker 1
```

Generic commands can be used anywhere.
```
sudo autok3s join --provider alibaba --region <region> --name <cluster name> --key-pair <key-pair id> --v-switch <v-switch id> --security-group <security-group id> --token <k3s token> --url <k3s master ip>
sudo autok3s join --provider alibaba --region <region> --name <cluster name> --key-pair <key-pair id> --v-switch <v-switch id> --security-group <security-group id> --token <k3s token> --url <k3s master ip> --worker 1
```

HA mode need `--master` greater than 0, also need to specify `--datastore` e.g.
Expand Down
4 changes: 2 additions & 2 deletions pkg/providers/alibaba/alibaba.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ const (
internetMaxBandwidthOut = "50"
diskCategory = "cloud_ssd"
diskSize = "40"
master = "1"
worker = "1"
master = "0"
worker = "0"
ui = "none"
repo = "https://apphub.aliyuncs.com"
terway = "none"
Expand Down

0 comments on commit 854199d

Please # to comment.