Skip to content

Commit

Permalink
docs: update docs (#722)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny0826 committed Jul 1, 2023
1 parent d3c47e7 commit 2b4cb48
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 27 deletions.
3 changes: 2 additions & 1 deletion docs/en-us/cli/kubecm.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ KubeConfig Manager.
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ 
██ ██ ██████ ██████ ███████ ██████ ██ ██

[44;97m[44;97m Tips [0m[0m [96m[96mFind more information at: [95mhttps://kubecm.cloud[0m[96m[0m[0m
[44;97m[44;97m Tips [0m[0m [96m[96mFind more information at: [3;32mkubecm.cloud (https://kubecm.cloud)[m[0m[0m


### Options
Expand All @@ -36,6 +36,7 @@ KubeConfig Manager.
* [kubecm completion](kubecm_completion.md) - Generate completion script
* [kubecm create](kubecm_create.md) - Create new KubeConfig(experiment)
* [kubecm delete](kubecm_delete.md) - Delete the specified context from the kubeconfig
* [kubecm export](kubecm_export.md) - Export the specified context from the kubeconfig
* [kubecm list](kubecm_list.md) - List KubeConfig
* [kubecm merge](kubecm_merge.md) - Merge multiple kubeconfig files into one
* [kubecm namespace](kubecm_namespace.md) - Switch or change namespace interactively
Expand Down
15 changes: 7 additions & 8 deletions docs/en-us/cli/kubecm_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Add KubeConfig to $HOME/.kube/config
kubecm add [flags]
```

>Note: If `-c` is set and **more than one** context is added to the kubeconfig file, the following will occur:
>- If `--context-name` is set, the context will be generated as `<context-name-0>`, `<context-name-1>` ...
>- If `--context-name` is not set, it will be generated as `<file-name-{hash}>` where `{hash}` is the MD5 hash of the file name.
### Examples

```
Note: If -c is set and more than one context is added to the kubeconfig file, the following will occur:
- If --context-name is set, the context will be generated as <context-name-0>, <context-name-1> ...
- If --context-name is not set, it will be generated as <file-name-{hash}> where {hash} is the MD5 hash of the file name.
# Merge test.yaml with $HOME/.kube/config
kubecm add -f test.yaml
# Merge test.yaml with $HOME/.kube/config and rename context name
Expand All @@ -31,10 +31,9 @@ cat /etc/kubernetes/admin.conf | kubecm add -f -

```
--context-name string override context name when add kubeconfig context
-c, --cover Overwrite local kubeconfig files
-f, --file string Path to merge kubeconfig files
-h, --help help for add
-c, --cover Overwrite local kubeconfig files
-f, --file string Path to merge kubeconfig files
-h, --help help for add
```

### Options inherited from parent commands
Expand Down
21 changes: 14 additions & 7 deletions docs/en-us/cli/kubecm_cloud_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@ kubecm cloud add [flags]

```
# Supports Ali Cloud and Tencent Cloud
# Supports AWS, Ali Cloud, Tencent Cloud and Rancher
# The AK/AS of the cloud platform will be retrieved directly
# if it exists in the environment variable,
# otherwise a prompt box will appear asking for it.
# Set env AliCloud secret key
export ACCESS_KEY_ID=xxx
export ACCESS_KEY_SECRET=xxx
export ACCESS_KEY_ID=YOUR_AKID
export ACCESS_KEY_SECRET=YOUR_SECRET_KEY
# Set env Tencent secret key
export TENCENTCLOUD_SECRET_ID=xxx
export TENCENTCLOUD_SECRET_KEY=xxx
export TENCENTCLOUD_SECRET_ID=YOUR_SECRET_ID
export TENCENTCLOUD_SECRET_KEY=YOUR_SECRET_KEY
# Set env Rancher secret key
export RANCHER_SERVER_URL=https://xxx
export RANCHER_API_KEY=xxx
export RANCHER_API_KEY=YOUR_API_KEY
# Set env AWS secret key
export AWS_ACCESS_KEY_ID=YOUR_AKID
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
# Interaction: select kubeconfig from the cloud
kubecm cloud add
# Add kubeconfig from cloud
Expand All @@ -46,9 +53,9 @@ kubecm cloud add --provider alibabacloud --cluster_id=xxxxxx
```
--cluster_id string kubernetes cluster id
--config string path of kubeconfig (default "/Users/guoxudong/.kube/config")
-m, --mac-notify enable to display Mac notification banner
--provider string public cloud
--region_id string cloud region id
-m, --mac-notify enable to display Mac notification banner
--ui-size int number of list items to show in menu at once (default 4)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/en-us/cli/kubecm_cloud_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ kubecm cloud list --provider alibabacloud --cluster_id=xxxxxx
```
--cluster_id string kubernetes cluster id
--config string path of kubeconfig (default "/Users/guoxudong/.kube/config")
-m, --mac-notify enable to display Mac notification banner
--provider string public cloud
--region_id string cloud region id
-m, --mac-notify enable to display Mac notification banner
--ui-size int number of list items to show in menu at once (default 4)
```

Expand Down
6 changes: 4 additions & 2 deletions docs/en-us/cli/kubecm_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ kubecm export [flags]
### Examples

```
# Export context to myconfig.yaml file
kubecm export -f myconfig.yaml my-context1
# Export multiple contexts to myconfig.yaml file
kubecm export -f myconfig.yaml my-context1 my-context2
```

### Options

```
-f, --file string Path to export kubeconfig files
-h, --help help for export
-f, --file string Path to export kubeconfig files
-h, --help help for export
```

### Options inherited from parent commands
Expand Down
21 changes: 14 additions & 7 deletions docs/zh-cn/cli/kubecm_cloud_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,27 @@ kubecm cloud add [flags]

```
# Supports Ali Cloud and Tencent Cloud
# Supports AWS, Ali Cloud, Tencent Cloud and Rancher
# The AK/AS of the cloud platform will be retrieved directly
# if it exists in the environment variable,
# otherwise a prompt box will appear asking for it.
# Set env AliCloud secret key
export ACCESS_KEY_ID=xxx
export ACCESS_KEY_SECRET=xxx
export ACCESS_KEY_ID=YOUR_AKID
export ACCESS_KEY_SECRET=YOUR_SECRET_KEY
# Set env Tencent secret key
export TENCENTCLOUD_SECRET_ID=xxx
export TENCENTCLOUD_SECRET_KEY=xxx
export TENCENTCLOUD_SECRET_ID=YOUR_SECRET_ID
export TENCENTCLOUD_SECRET_KEY=YOUR_SECRET_KEY
# Set env Rancher secret key
export RANCHER_SERVER_URL=https://xxx
export RANCHER_API_KEY=xxx
export RANCHER_API_KEY=YOUR_API_KEY
# Set env AWS secret key
export AWS_ACCESS_KEY_ID=YOUR_AKID
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
# Interaction: select kubeconfig from the cloud
kubecm cloud add
# Add kubeconfig from cloud
Expand All @@ -46,9 +53,9 @@ kubecm cloud add --provider alibabacloud --cluster_id=xxxxxx
```
--cluster_id string kubernetes cluster id
--config string path of kubeconfig (default "/Users/guoxudong/.kube/config")
-m, --mac-notify enable to display Mac notification banner
--provider string public cloud
--region_id string cloud region id
-m, --mac-notify enable to display Mac notification banner
--ui-size int number of list items to show in menu at once (default 4)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/zh-cn/cli/kubecm_cloud_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ kubecm cloud list --provider alibabacloud --cluster_id=xxxxxx
```
--cluster_id string kubernetes cluster id
--config string path of kubeconfig (default "/Users/guoxudong/.kube/config")
-m, --mac-notify enable to display Mac notification banner
--provider string public cloud
--region_id string cloud region id
-m, --mac-notify enable to display Mac notification banner
--ui-size int number of list items to show in menu at once (default 4)
```

Expand Down

0 comments on commit 2b4cb48

Please sign in to comment.