-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: ii2day <ji.li@daocloud.io>
- Loading branch information
ii2day
committed
Jul 28, 2023
1 parent
7425456
commit 3173c5a
Showing
5 changed files
with
507 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
# AppHttpHealthy | ||
|
||
## 基本描述 | ||
|
||
对于这种任务,每个 kdoctor agent都会向指定的目标发送http请求,并获得成功率和平均延迟。它可以指定成功条件来判断结果是否成功。并且,可以通过聚合API获取详细的报告。 | ||
|
||
## AppHttpHealthy 示例 | ||
|
||
```yaml | ||
apiVersion: kdoctor.io/v1beta1 | ||
kind: AppHttpHealthy | ||
metadata: | ||
name: apphttphealth | ||
spec: | ||
expect: | ||
meanAccessDelayInMs: 1500 | ||
successRate: 1 | ||
request: | ||
durationInSecond: 10 | ||
perRequestTimeoutInMS: 2000 | ||
qps: 10 | ||
schedule: | ||
roundNumber: 1 | ||
roundTimeoutMinute: 1 | ||
schedule: 0 0 | ||
target: | ||
enableLatencyMetric: false | ||
host: http://www.baidu.com | ||
http2: false | ||
method: GET | ||
``` | ||
## AppHttpHealthy 定义 | ||
### Metadata | ||
| 字段 | 描述 | 结构 | 验证 | | ||
|-----|---------------|--------|-----| | ||
| name | AppHttpHealthy 资源的名称 | string | 必填 | | ||
### Spec | ||
| 字段 | 描述 | 结构 | 验证 | 取值 | 默认值 | | ||
|-----------|------------------|------------------------------------------|---------|-------|------| | ||
| schedule | 调度任务执行 | [schedule](./apphttphealthy-zh_CN.md#Schedule) | 可选 | | | | ||
| request | 对目标地址请求配置 | [request](./apphttphealthy-zh_CN.md#Request) | 可选 | | | | ||
| target | 请求目标设置 | [target](./apphttphealthy-zh_CN.md#Target) | 可选 | | | | ||
| expect | 任务成功条件判断 | [expect](./apphttphealthy-zh_CN.md#Expect) | 可选 | | | | ||
#### Schedule | ||
| 字段 | 描述 | 结构 | 验证 | 取值 | 默认值 | | ||
|--------------------|----------|--------|-----|------------------------------------------------------------------------------------------------------------------|------| | ||
| roundNumber | 任务执行轮数 | int | 可选 | 大于等于-1 且不等于 0,为 -1 时表示永久执行,大于 0 时表示将要执行的轮数 | 1 | | ||
| schedule | 任务执行时间 | string | 可选 | 支持 linux crontab 写法 与 sample 写法<br/>linux crontab : * 1 * * * <br/>sample : 1 1 ,第一位表示多少分钟之后开启任务,第二位表示每一轮任务的间隔多少分钟执行 | "0 60" | | ||
| roundTimeoutMinute | 任务超时时间 | int | 可选 | 大于 1 | 60 | | ||
#### Request | ||
| 字段 | 描述 | 结构 | 验证 | 取值 | 默认值 | | ||
|-----------------------|----------------------|-----|-----|-------|-----| | ||
| durationInSecond | 每轮任务的请求发压的持续时间 | int | 可选 | 最小值 1 | 2 | | ||
| perRequestTimeoutInMS | 每个请求的超时时间 | int | 可选 | 大于 1 | 500 | | ||
| qps | 每一个 agent 每秒请求数量 | int | 可选 | 大于 1 | 5 | | ||
> 注意:使用 agent 请求时,所有的 agent 都会向目标地址进行请求,因此实际 server 接收的 qps 等于 agent 数量 * 设置的qps。 | ||
#### Target | ||
| 字段 | 描述 | 结构 | 验证 | 取值 | 默认值 | | ||
|------------------------|--------------------------------------------------------------------------------------------------|--------|---------|---------------------------|-------| | ||
| host | http 请求地址 | string | 必填 | | | | ||
| method | http 请求方法 | string | 必填 | GET、POST、PUT、DELETE、CONNECT、OPTIONS、PATCH、HEAD | | | ||
| bodyConfigmapName | http 请求 body 存放的 configmap 名称,[configmap 内容参考](./apphttphealthy-zh_CN.md#Body) | string | 可选 | | | | ||
| bodyConfigmapNamespace | http 请求 body 的 configmap 命名空间 | string | 可选 | | | | ||
| tlsSecretName | https 请求证书存放的 secret 名称,secret类型为 kubernetes.io/tls,[secret 内容参考](./apphttphealthy-zh_CN.md#Tls) | string | 可选 | | | | ||
| tlsSecretNamespace | https 请求证书存放的 secret 命名空间 | string | 可选 | | | | ||
| header | http 请求头,数组形式,示例为 "Content-Type: application/json" | 元素为字符串的数组 | 可选 | | | | ||
| http2 | 使用使用 http2 协议进行请求开关 | bool | 可选 | true,false | false | | ||
| enableLatencyMetric | 统计演示分布,开启后会增加内存使用量 | bool | 可选 | true,false | false | | ||
#### Expect | ||
任务成功条件,若任务结果没有达到期望条件,任务失败 | ||
| 字段 | 描述 | 结构 | 验证 | 取值 | 默认值 | | ||
|--------------------|-----------|-------|-----|-------|------| | ||
| meanAccessDelayInMs | 平均延时 | int | 可选 | 最小值 1 | 5000 | | ||
| successRate | http请求成功率 | float | 可选 | 0-1 | 1 | | ||
| statusCode | http返回状态码 | int | 可选 | 0-500 | 200 | | ||
#### Body | ||
携带 body 请求,body 写法示例 | ||
```yaml | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: kdoctor-test-body-5656-89207258 | ||
namespace: kdoctor | ||
data: | ||
test1: test1 | ||
test2: test2 | ||
``` | ||
#### Tls | ||
https 请求使用证书时,若不填写 ca证书 则 不对证书安全进行校验。 | ||
```yaml | ||
apiVersion: v1 | ||
data: | ||
ca.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURHRENDQWdDZ0F3SUJBZ0lSQUlLRWdhemhnZjZFcGl0NkN5WVJzcXN3RFFZSktvWklodmNOQVFFTEJRQXcKRlRFVE1CRUdBMVVFQXhNS2EyUnZZM1J2Y2k1cGJ6QWdGdzB5TXpBM01qZ3dPVFExTlRoYUdBOHlNakl6TURZeApNREE1TkRVMU9Gb3dGVEVUTUJFR0ExVUVBeE1LYTJSdlkzUnZjaTVwYnpDQ0FTSXdEUVlKS29aSWh2Y05BUUVCCkJRQURnZ0VQ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yeWtTVjVLVWxrWTRpMHVSTjhQMVdyZy9pcHVpcmdVUGNOWjMyNnpHMVNSTVZ6cm1WamkzbApaSFdsZElROW9VMXU4UThDVEpCN0RYVU5WZlBqK3JreWpoTGdjZXNYNXN6Rk9PeTBYSWhSSm5waVJob1dnMnJ3CnhDRFNiMWNKd1ErOGw4NmFLU0tQRHMwQ2dZRUFsUW1MeTNJOHdBV3YzQ0xIUVpjd3NXZkdZZ2NjMGpoY2VINnEKTGNqR0YwcEZ6d2UyTkR5ME1nZ1NaMmNHTFdGd2docTVVSHVqOEU5TUc3Y0JjY2Z2bVJMNmU0Vm5LbzBzUWpiYQpNWTV2STNRRDRpYnZRSzJPalB5bzlqTkt3MjNzelNsNjhGRnAvMDlYNldTNEJjSXFEZFdoUVptMHcwakNNQUk4CnZOUVFFeDBDZ1lCRGV1M3R2OGRUU1lkU3ByL1V0RE5DYWpheUtPa2lYQk1pSENzS1NpN1JqTFE5RVpnTlVQK3EKZ3IzdVhlaVZRYjNnUXFlRDNSd2I3NWo0WjZ3bjBEbFIrWXhadlg3YnJMRVpoc3ZtNE9rcUs3TlhMeHNsbTJZYworM2o0MmJoSmI2SG5VOVJMVGdoQVlzVUY5NWhCUlZmdHY2bjdiYyt0MFo2OFVUZ0g0dklyM3c9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= | ||
kind: Secret | ||
metadata: | ||
name: kdoctor-client-cert | ||
namespace: kdoctor | ||
type: kubernetes.io/tls | ||
``` | ||
### status | ||
| 字段 | 描述 | 结构 | | ||
|--------------------|----------|---------------------------------------------| | ||
| doneRound | 完成的任务轮数 | int | | ||
| expectedRound | 期望执行的轮数 | string | | ||
| finish | 任务是否完成 | string | | ||
| lastRoundStatus | 最后一轮任务状态 | string | | ||
| history | 任务历史 | 元素为[history](./apphttphealthy-zh_CN.md#History)的数组 | | ||
#### History | ||
| 字段 | 描述 | | ||
|----------------------------------|-----------------| | ||
| roundNumber | 任务轮数 | | ||
| status | 任务状态 | | ||
| startTimeStamp | 本轮任务开始时间 | | ||
| endTimeStamp | 本轮任务结束时间 | | ||
| duration | 本轮任执行时间 | | ||
| deadLineTimeStamp | 本轮任务 deadline | | ||
| failedAgentNodeList | 任务失败的 agent | | ||
| succeedAgentNodeList | 任务成功的 agent | | ||
| notReportAgentNodeList | 没有上传任务报告的 agent | |
Oops, something went wrong.