Skip to content

Commit

Permalink
Merge pull request #21 from kdoctor-io/doc
Browse files Browse the repository at this point in the history
update crd
  • Loading branch information
weizhoublue authored Jun 16, 2023
2 parents 36b4cbc + c53f024 commit d606747
Show file tree
Hide file tree
Showing 16 changed files with 214 additions and 140 deletions.
38 changes: 23 additions & 15 deletions charts/crds/kdoctor.io_apphttphealthies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ spec:
type: object
spec:
properties:
expect:
properties:
meanAccessDelayInMs:
default: 5000
format: int64
minimum: 1
type: integer
statusCode:
maximum: 599
minimum: 100
type: integer
successRate:
default: 1
maximum: 1
minimum: 0
type: number
type: object
request:
properties:
durationInSecond:
Expand Down Expand Up @@ -92,22 +109,11 @@ spec:
- roundNumber
- roundTimeoutMinute
type: object
success:
properties:
meanAccessDelayInMs:
default: 5000
format: int64
minimum: 1
type: integer
successRate:
default: 1
maximum: 1
minimum: 0
type: number
type: object
target:
properties:
body:
bodyConfigmapName:
type: string
bodyConfigmapNamespace:
type: string
header:
items:
Expand All @@ -129,7 +135,9 @@ spec:
- PATCH
- HEAD
type: string
tls-secret:
tlsSecretName:
type: string
tlsSecretNamespace:
type: string
required:
- host
Expand Down
48 changes: 27 additions & 21 deletions charts/crds/kdoctor.io_netdnses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ spec:
type: object
spec:
properties:
expect:
properties:
meanAccessDelayInMs:
default: 5000
format: int64
minimum: 1
type: integer
statusCode:
maximum: 599
minimum: 100
type: integer
successRate:
default: 1
maximum: 1
minimum: 0
type: number
type: object
request:
properties:
domain:
Expand All @@ -71,6 +88,13 @@ spec:
format: int64
minimum: 1
type: integer
protocol:
default: udp
enum:
- udp
- tcp
- tcp-tls
type: string
qps:
default: 5
format: int64
Expand Down Expand Up @@ -144,31 +168,13 @@ spec:
type: object
type: object
x-kubernetes-map-type: atomic
success:
properties:
meanAccessDelayInMs:
default: 5000
format: int64
minimum: 1
type: integer
successRate:
default: 1
maximum: 1
minimum: 0
type: number
type: object
target:
properties:
protocol:
default: udp
enum:
- udp
- tcp
- tcp-tls
type: string
targetDns:
properties:
serviceNamespaceName:
serviceName:
type: string
serviceNamespace:
type: string
testIPv4:
default: true
Expand Down
30 changes: 17 additions & 13 deletions charts/crds/kdoctor.io_netreaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ spec:
type: object
spec:
properties:
expect:
properties:
meanAccessDelayInMs:
default: 5000
format: int64
minimum: 1
type: integer
statusCode:
maximum: 599
minimum: 100
type: integer
successRate:
default: 1
maximum: 1
minimum: 0
type: number
type: object
request:
properties:
durationInSecond:
Expand Down Expand Up @@ -92,19 +109,6 @@ spec:
- roundNumber
- roundTimeoutMinute
type: object
success:
properties:
meanAccessDelayInMs:
default: 5000
format: int64
minimum: 1
type: integer
successRate:
default: 1
maximum: 1
minimum: 0
type: number
type: object
target:
properties:
clusterIP:
Expand Down
48 changes: 31 additions & 17 deletions docs/usage/apphttphealthy.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@ spec:
roundNumber: 2
roundTimeoutMinute: 1
schedule: 1 1
success:
expect:
meanAccessDelayInMs: 10000
successRate: 1
statusCode: 200
target:
body: kube-system/http-body
bodyConfigmapName: http-body
bodyConfigmapNamespace: kube-system
header:
- Accept:text/html
host: https://10.6.172.20:9443
http2: false
method: PUT
tls-secret: kube-system/https-cert
tlsSecretName: https-cert
tlsSecretNamespace: kube-system
status:
doneRound: 2
expectedRound: 2
Expand Down Expand Up @@ -77,32 +80,40 @@ status:

method: http method, must be one of GET POST PUT DELETE CONNECT OPTIONS PATCH HEAD
body: The configmap format for logging HTTP requests is namespace/configmap-name
bodyConfigmapName: The body configmap name
*
bodyConfigmapNamespace: The body configmap namespace
tls-cert: The secret format for logging HTTPS request certificates is namespace/configmap-name
tlsSecretName: The tls secret name
*
tlsSecretNamespace: The tls secret namespace

header: HTTP request header

http2: Requests are made using the http2 protocol

>notice: when test targetAgent case, it will send http request to all targets at the same time with spec.request.qps for each one. That meaning, the actually QPS may be bigger than spec.request.qps

* spec.success: define the success condition of the task result
* spec.expect: define the success condition of the task result

meanAccessDelayInMs: mean access delay in MS, if the actual delay is bigger than this, it results to be failure
meanAccessDelayInMs: mean access delay in MS, if the actual delay is bigger than this, it results to be failure

successRate: the success rate of all http requests. Notice, when a http response code is >=200 and < 400, it's treated as success. if the actual whole success rate is smaller than successRate, the task results to be failure
successRate: the success rate of all http requests. Notice, when a http response code is >=200 and < 400, it's treated as success. if the actual whole success rate is smaller than successRate, the task results to be failure
statusCode: Expect the HTTP status code returned by each request

* status: the status of the task
doneRound: how many rounds have finished

expectedRound: how many rounds the task expect
doneRound: how many rounds have finished

finish: whether all rounds of this task have finished
expectedRound: how many rounds the task expect

lastRoundStatus: the result of last round
finish: whether all rounds of this task have finished

lastRoundStatus: the result of last round

history:

roundNumber: the round number

status: the status of this round
Expand Down Expand Up @@ -142,17 +153,20 @@ spec:
roundNumber: 2
roundTimeoutMinute: 1
schedule: 1 1
success:
expect:
meanAccessDelayInMs: 10000
successRate: 1
statusCode: 200
target:
body: kube-system/http-body
bodyConfigmapName: http-body
bodyConfigmapNamespace: kube-system
header:
- Accept:text/html
host: https://10.6.172.20:9443
http2: false
method: PUT
tls-secret: kube-system/https-cert
tlsSecretName: https-cert
tlsSecretNamespace: kube-system
EOF
kubectl apply -f test-httpapphealthy.yaml

Expand Down Expand Up @@ -198,7 +212,7 @@ kubectl apply -f https-cert.yaml
when something wrong happen, see the log for your task with following command
```shell
#get log
CRD_KIND="httpapphealthy"
CRD_KIND="apphttphealthy"
CRD_NAME="httphealthy"
kubectl logs -n kube-system kdoctor-agent-v4vzx | grep -i "${CRD_KIND}.${CRD_NAME}"

Expand All @@ -210,7 +224,7 @@ kubectl logs -n kube-system kdoctor-agent-v4vzx | grep -i "${CRD_KIND}.${CRD_NA
when the kdoctor is not enabled to aggerate reports, all reports will be printed in the stdout of kdoctor agent.
Use the following command to get its report
```shell
kubectl logs -n kube-system kdoctor-agent-v4vzx | jq 'select( .TaskName=="httpapphealthy.httphealthy" )'
kubectl logs -n kube-system kdoctor-agent-v4vzx | jq 'select( .TaskName=="apphttphealthy.httphealthy" )'
```

when the kdoctor is enabled to aggregate reports, all reports will be collected in the PVC or hostPath of kdoctor controller.
Expand Down
23 changes: 13 additions & 10 deletions docs/usage/netdns.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ spec:
targetDns:
testIPv4: true
testIPv6: false
serviceNamespaceName: kube-system/test-app
serviceName: coredns
serviceNamespace: kube-system
targetUser:
server: 172.18.0.1
port: 53
protocol: udp
request:
durationInSecond: 10
qps: 20
perRequestTimeoutInMS: 500
domain: "kube-dns.kube-system.svc.cluster.local"
success:
protocol: udp
expect:
successRate: 1
meanAccessDelayInMs: 10000
EOF
Expand Down Expand Up @@ -79,11 +80,13 @@ kubectl apply -f netdns.yaml

testIPv6: test DNS server IPv6 address and request is type AAAA.

serviceNamespaceName: Specify the namespace and name of the DNS to be tested, do not fill in the default test cluster for all DNS servers
serviceName: Specify the name of the DNS to be tested
*
serviceNamespace: Specify the namespace of the DNS to be tested

protocol: Specify request protocol,Optional value udp,tcp,tcp-tls,default udp.

* spec.success: define the success condition of the task result
* spec.expect: define the success condition of the task result

meanAccessDelayInMs: mean access delay in MS, if the actual delay is bigger than this, it results to be failure

Expand Down Expand Up @@ -134,7 +137,6 @@ spec:
roundNumber: 2
roundTimeoutMinute: 1
target:
protocol: udp
targetUser:
server: 172.18.0.1
port: 53
Expand All @@ -143,7 +145,8 @@ spec:
qps: 10
perRequestTimeoutInMS: 500
domain: "baidu.com"
success:
protocol: udp
expect:
successRate: 1
meanAccessDelayInMs: 1000
EOF
Expand Down Expand Up @@ -176,7 +179,7 @@ spec:
qps: 10
perRequestTimeoutInMS: 500
domain: "baidu.com"
success:
expect:
successRate: 1
meanAccessDelayInMs: 1000
EOF
Expand Down Expand Up @@ -210,7 +213,7 @@ spec:
qps: 20
perRequestTimeoutInMS: 500
domain: "kube-dns.kube-system.svc.cluster.local"
success:
expect:
successRate: 1
meanAccessDelayInMs: 10000
EOF
Expand Down Expand Up @@ -244,7 +247,7 @@ spec:
qps: 20
perRequestTimeoutInMS: 500
domain: "kube-dns.kube-system.svc.cluster.local"
success:
expect:
successRate: 1
meanAccessDelayInMs: 10000
EOF
Expand Down
Loading

0 comments on commit d606747

Please sign in to comment.