Skip to content

Commit

Permalink
Add grpc and etcdctl command for livez and readyz.
Browse files Browse the repository at this point in the history
tested with
`bin/etcdctl endpoint readyz --cluster`
Output:
```
http://127.0.0.1:2379: /readyz is OK,: took = 1.382416ms
[+]ping ok
[+]serializable_read ok
[+]data_corruption ok

http://127.0.0.1:32379: /readyz is OK,: took = 1.778917ms
[+]ping ok
[+]serializable_read ok
[+]data_corruption ok

http://127.0.0.1:22379: /readyz is OK,: took = 1.775041ms
[+]ping ok
[+]serializable_read ok
[+]data_corruption ok
```

and the output for livez is
```
http://127.0.0.1:32379: /livez is OK,: took = 1.904625ms
[+]ping ok
[+]serializable_read ok

http://127.0.0.1:2379: /livez is OK,: took = 2.125209ms
[+]ping ok
[+]serializable_read ok

http://127.0.0.1:22379: /livez is OK,: took = 2.12025ms
[+]ping ok
[+]serializable_read ok
```
  • Loading branch information
siyuanfoundation committed Sep 25, 2023
1 parent 043b6c4 commit 293f087
Show file tree
Hide file tree
Showing 18 changed files with 1,821 additions and 428 deletions.
134 changes: 134 additions & 0 deletions Documentation/dev-guide/apispec/swagger/rpc.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,102 @@
]
}
},
"/v3/maintenance/healthz": {
"post": {
"operationId": "Maintenance_Healthz",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etcdserverpbHealthResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/etcdserverpbHealthRequest"
}
}
],
"tags": [
"Maintenance"
]
}
},
"/v3/maintenance/livez": {
"post": {
"operationId": "Maintenance_Livez",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etcdserverpbHealthResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/etcdserverpbHealthRequest"
}
}
],
"tags": [
"Maintenance"
]
}
},
"/v3/maintenance/readyz": {
"post": {
"operationId": "Maintenance_Readyz",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etcdserverpbHealthResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/etcdserverpbHealthRequest"
}
}
],
"tags": [
"Maintenance"
]
}
},
"/v3/maintenance/snapshot": {
"post": {
"summary": "Snapshot sends a snapshot of the entire backend from a member over a stream to a client.",
Expand Down Expand Up @@ -1563,6 +1659,17 @@
],
"default": "PUT"
},
"HealthRequestStringArray": {
"type": "object",
"properties": {
"values": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"RangeRequestSortOrder": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -2209,6 +2316,33 @@
}
}
},
"etcdserverpbHealthRequest": {
"type": "object",
"properties": {
"exclude": {
"$ref": "#/definitions/HealthRequestStringArray",
"description": "List of health checks to exclude."
},
"allowlist": {
"$ref": "#/definitions/HealthRequestStringArray",
"description": "List of health checks to allowlist.\nCannot be used with exclude."
}
}
},
"etcdserverpbHealthResponse": {
"type": "object",
"properties": {
"header": {
"$ref": "#/definitions/etcdserverpbResponseHeader"
},
"ok": {
"type": "boolean"
},
"reason": {
"type": "string"
}
}
},
"etcdserverpbLeaseGrantRequest": {
"type": "object",
"properties": {
Expand Down
Loading

0 comments on commit 293f087

Please sign in to comment.