Browse Source

doc(tools): add quick start for k8s tool

Signed-off-by: Jiyong Huang <huangjy@emqx.io>
Jiyong Huang 2 years ago
parent
commit
ea39fef916
2 changed files with 31 additions and 15 deletions
  1. 19 11
      tools/kubernetes/README-CN.md
  2. 12 4
      tools/kubernetes/README.md

+ 19 - 11
tools/kubernetes/README-CN.md

@@ -2,7 +2,7 @@
 
 ### 1.1 程序说明:
 
-本程序用于监控并处理命令文件夹中的文件。当程序发现命令文件夹下存在新创建的文件或已更新的文件时,程序将加载这些文件并执行文件中的命令,之后程序将处理过的文件名记录在命令文件夹同级目录的 .history 文件中。 .history 的数据格式如下:
+本程序用于监控并处理命令文件夹中的文件。当程序发现命令文件夹下存在新创建的文件或已更新的文件时,程序将加载这些文件并执行文件中的命令,之后程序将处理过的文件名记录在命令文件夹同级目录的 .history 文件中。 .history 的数据格式如下:
 
 ```json
 [
@@ -12,18 +12,26 @@
     }]
 ```
 
-### 1.2 命令文件格式及含义:
+### 1.2 快速开始
 
-| 字段        | 是否必填   | 类型     | 释义         |
-| ----------- | ---------- | -------- | ------------ |
-| commands    | 必填       | array    | 命令集合     |
-| url         | 必填       | string   | http请求路径 |
-| method      | 必填       | string   | http请求方法 |
-| description | 选填       | string   | 操作描述     |
+本程序提供了 docker image `lfedge/ekuiper-kubernetes-tool`。建议作为 eKuiper docker container 的边车部署。
+
+```shell
+docker run lfedge/ekuiper-kubernetes-tool:$tag
+```
+
+### 1.3 命令文件格式及含义:
+
+| 字段          | 是否必填  | 类型       | 释义       |
+|-------------|-------|----------|----------|
+| commands    | 必填    | array    | 命令集合     |
+| url         | 必填    | string   | http请求路径 |
+| method      | 必填    | string   | http请求方法 |
+| description | 选填    | string   | 操作描述     |
 | data        | 创建时必填 | json obj | 创建内容     |
-|             |            |          |              |
+|             |       |          |          |
 
-### 1.3 配置文件格式及含义:
+### 1.4 配置文件格式及含义:
 ```yaml
 port: 9081  //eKuiper 端口
 timeout: 500  //执行一条命令超时时间(单位:毫秒)
@@ -34,7 +42,7 @@ fileLog: true   //是否需要打印log到log文件中,如果需要,log将
 logPath: "./log/kubernetes.log" //日志保存路径
 commandDir: "./sample/" //命令文件夹路径
 ```
-### 1.4 编译程序:
+### 1.5 编译程序:
 
 执行 `go build -o tools/kubernetes/kubernetes tools/kubernetes/main.go` 命令即可生成 kubernetes 程序。
 

+ 12 - 4
tools/kubernetes/README.md

@@ -13,10 +13,18 @@ The program is used for monitoring and processing files under folder. If program
 ]
 ```
 
-### 1.2 Command file format and meaning:
+### 1.2 Quick Start
+
+This program provides a docker image `lfedge/ekuiper-kubernetes-tool`. It is recommended to use this as a sidecar of the eKuiper docker container.
+
+```shell
+docker run lfedge/ekuiper-kubernetes-tool:$tag
+```
+
+### 1.3 Command file format and meaning:
 
 | Field       | Optional           | Type     | Description           |
-| ----------- | ------------------ | -------- | --------------------- |
+|-------------|--------------------|----------|-----------------------|
 | commands    | false              | array    | Command set           |
 | url         | false              | string   | http request path     |
 | method      | false              | string   | http request method   |
@@ -24,7 +32,7 @@ The program is used for monitoring and processing files under folder. If program
 | data        | false for creation | json obj | Creation content      |
 |             |                    |          |                       |
 
-### 1.3 Configuration file format and meaning:
+### 1.4 Configuration file format and meaning:
 ```yaml
 port: 9081  //eKuiper port
 timeout: 500  //Timeout for executing a command (unit: ms)
@@ -35,7 +43,7 @@ fileLog: false  //true|false, if it's set to true, then the log will be print to
 logPath: "./log/kubernetes.log" //Log save path
 commandDir: "./sample/" //Command folder path
 ```
-### 1.4 Compile the program:
+### 1.5 Compile the program:
 
 Execute the command of `go build -o tools/kubernetes/kuiper-kubernetes-tool tools/kubernetes/main.go` to generate the kubernetes program.