From ba111f7868f135f833faf4a584a594f02c8596c8 Mon Sep 17 00:00:00 2001 From: NewGr8Player <273221594@qq.com> Date: Sat, 10 Oct 2020 11:33:57 +0800 Subject: [PATCH] docs(autok3s): add docs for provider native Signed-off-by: NewGr8Player <273221594@qq.com> --- README.md | 16 ++++++++ docs/native/README.md | 90 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 docs/native/README.md diff --git a/README.md b/README.md index 675fcf61..19672e00 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ It's also generated a state file `$HOME/.autok3s/.state` to record the clusters' ## Providers - alibaba +- [native](docs/native/README.md) ## Pre-Requests The following demo uses the Alibaba Provider, so you need to set the following [RAMs](docs/alibaba/ram.md). @@ -53,6 +54,17 @@ autok3s create \ --master 1 ``` +SSH connection also supports the following options. + +| Option Name | Description | +| --- | --- | +| --ssh-user | SSH user for host | +| --ssh-port | SSH port for host | +| --ssh-key-path | SSH private key path | +| --ssh-key-pass | SSH passphrase of private key | +| --ssh-key-cert-path | SSH private key certificate path | +| --ssh-password | SSH login password | + HA(embedded etcd: >= 1.19.1-k3s1) mode need `--master` at least 3 master nodes, e.g. ```bash autok3s ... \ @@ -107,6 +119,8 @@ autok3s ... \ ``` ### Start K3s Cluster +> Provider `native` **DO NOT** support. + If you have ever created a cluster using `autok3s` on your current machine, you can use the simplified command. ```bash autok3s start \ @@ -126,6 +140,8 @@ autok3s start \ ``` ### Stop K3s Cluster +> Provider `native` **DO NOT** support. + If you have ever created a cluster using `autok3s` on your current machine, you can use the simplified command. ```bash autok3s stop \ diff --git a/docs/native/README.md b/docs/native/README.md new file mode 100644 index 00000000..45a0e2a4 --- /dev/null +++ b/docs/native/README.md @@ -0,0 +1,90 @@ +## Provider native +### Setup K3s Cluster +```bash +autok3s create \ + --provider native \ + --name \ + --ssh-key-path \ + --master-ips + --worker-ips +``` + +SSH connection also supports the following options. + +| Option Name | Description | +| --- | --- | +| --ssh-user | SSH user for host | +| --ssh-port | SSH port for host | +| --ssh-key-path | SSH private key path | +| --ssh-key-pass | SSH passphrase of private key | +| --ssh-key-cert-path | SSH private key certificate path | +| --ssh-password | SSH login password | + + +HA(embedded etcd: >= 1.19.1-k3s1) mode need `--master-ips` at least 3 master nodes, e.g. +```bash +autok3s ... \ + --master-ips +``` + +HA(external database) mode need `--master-ips` greater than 1 node, also need to specify `--datastore`, e.g. +```bash +autok3s ... \ + --master-ips \ + --datastore "mysql://:@tcp(:)/" +``` + +### Join K3s Nodes +```bash +autok3s join \ + --provider native \ + --name \ + --ssh-key-path \ + --worker-ips +``` + + +Join master nodes to (embedded etcd: >= 1.19.1-k3s1) HA cluster e.g. +```bash +autok3s ... \ + --master-ips +``` + +Join master nodes to (external database) HA cluster, also need to specify `--datastore`, e.g. +```bash +autok3s ... \ + --master-ips \ + --datastore "mysql://:@tcp(:)/" +``` + +### Delete K3s Cluster +```bash +autok3s delete \ + --provider native \ + --name +``` + +### List K3s Clusters +This command will list the clusters that you have created on this machine. +```bash +autok3s list +``` + +### Access K3s Cluster +After the cluster created, `autok3s` will automatically merge the `kubeconfig` which necessary for us to access the cluster. +```bash +autok3s kubectl +``` + +In the scenario of multiple clusters, the access to different clusters can be completed by switching context. +```bash +autok3s kubectl config get-contexts +autok3s kubectl config use-context +``` + +### SSH K3s Cluster's Node +```bash +autok3s ssh \ + --provider native \ + --name +``` \ No newline at end of file