From cb1ead84838eb08e32098bbab93cc3dc1c1856bf Mon Sep 17 00:00:00 2001 From: Jason-ZW Date: Wed, 23 Sep 2020 13:45:48 +0800 Subject: [PATCH] docs(autok3s): update README.md Signed-off-by: Jason-ZW --- README.md | 65 ++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 80ac8792..022b85c4 100644 --- a/README.md +++ b/README.md @@ -23,55 +23,90 @@ 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 --name --key-pair --v-switch --security-group --ssh-key-path --master 1 +```bash +sudo autok3s create \ + --provider alibaba \ + --region \ + --name \ + --key-pair \ + --v-switch \ + --security-group \ + --ssh-key-path \ + --master 1 ``` Generic commands can be used anywhere. -``` -sudo autok3s create --provider alibaba --region --name --key-pair --v-switch --security-group --ssh-key-path --access-key --access-secret --master 1 +```bash +sudo autok3s create \ + --provider alibaba \ + --region \ + --name \ + --key-pair \ + --v-switch \ + --security-group \ + --ssh-key-path \ + --access-key \ + --access-secret \ + --master 1 ``` HA mode need `--master` greater than 1, also need to specify `--datastore` e.g. -``` +```bash --master 2 --datastore "mysql://:@tcp(:)/" ``` ### 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 --name --ssh-key-path --worker 1 +```bash +sudo autok3s join \ + --provider alibaba \ + --region \ + --name \ + --ssh-key-path \ + --worker 1 ``` Generic commands can be used anywhere. -``` -sudo autok3s join --provider alibaba --region --name --key-pair --v-switch --security-group --token --url --worker 1 +```bash +sudo autok3s join \ + --provider alibaba \ + --region \ + --name \ + --key-pair \ + --v-switch \ + --security-group \ + --token \ + --url \ + --worker 1 ``` HA mode need `--master` greater than 0, also need to specify `--datastore` e.g. -``` +```bash --master 1 --datastore "mysql://:@tcp(:)/" ``` ### Delete K3s Cluster -``` -sudo autok3s delete --provider alibaba --region --name +```bash +sudo autok3s delete \ + --provider alibaba \ + --region \ + --name ``` ### List K3s Clusters This command will list the clusters that you have created on this machine. -``` +```bash sudo autok3s list ``` ### Access K3s Cluster After cluster created, `autok3s` will automatically merge the `kubeconfig` which necessary for us to access the cluster. -``` +```bash sudo autok3s kubectl ``` In the scenario of multiple clusters, the access to different clusters can be completed by switching context. -``` +```bash sudo autok3s kubectl config get-contexts sudo autok3s kubectl config use-context ```