You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: prd/001-readinessprobe-server.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Overview
4
4
5
-
This document outlines the implementation of a readiness probe for the Gitpod server deployment. The readiness probe will ensure that the server is only considered ready when it has established connections to both the database and SpiceDB authorizer.
5
+
This document outlines the implementation of a readiness probe for the Gitpod server deployment. The readiness probe will ensure that the server is only considered ready when it has established connections to the database, SpiceDB authorizer, and Redis.
6
6
7
7
## Background
8
8
@@ -13,6 +13,7 @@ Currently, the server deployment has a liveness probe that checks the event loop
13
13
1. Create a readiness endpoint in the server that checks:
14
14
- Database connectivity
15
15
- SpiceDB authorizer connectivity
16
+
- Redis connectivity
16
17
2. Configure the Kubernetes deployment to use this endpoint as a readiness probe
17
18
18
19
## Implementation Details
@@ -22,7 +23,8 @@ Currently, the server deployment has a liveness probe that checks the event loop
22
23
We've created a new `ReadinessController` class in `components/server/src/liveness/readiness-controller.ts` that:
23
24
- Checks database connectivity by executing a simple query
24
25
- Checks SpiceDB connectivity by attempting to get a client
25
-
- Returns a 200 status code only if both checks pass, otherwise returns a 503 status code
26
+
- Checks Redis connectivity by executing a PING command
27
+
- Returns a 200 status code only if all checks pass, otherwise returns a 503 status code
1. The server is only considered ready when both databaseand SpiceDB connections are established
151
-
2. The server is not considered ready if either connection fails
152
+
1. The server is only considered ready when database, SpiceDB, and Redis connections are established
153
+
2. The server is not considered ready if any connection fails
152
154
3. The server becomes ready again when connections are re-established
153
155
154
156
## Deployment Considerations
@@ -161,7 +163,7 @@ The readiness probe should be tested to ensure:
161
163
162
164
The readiness probe implementation includes a ConfigCat feature flag called `server_readiness_probe` that controls whether the actual connectivity checks are performed:
163
165
164
-
- When the flag is set to `true` (default): The readiness probe will always return a 200 status code, bypassing the actual databaseand SpiceDB connectivity checks
166
+
- When the flag is set to `true` (default): The readiness probe will always return a 200 status code, bypassing the actual database, SpiceDB, and Redis connectivity checks
165
167
- When the flag is set to `false`: The readiness probe will perform the actual checks and return the appropriate status code based on the results
166
168
167
169
This feature flag provides several benefits:
@@ -173,9 +175,10 @@ This feature flag provides several benefits:
173
175
## Future Improvements
174
176
175
177
- Add more sophisticated checks for SpiceDB connectivity, such as a simple permission check
178
+
- Add more sophisticated checks for Redis connectivity, such as a simple key-value operation
176
179
- Add metrics for readiness probe failures
177
180
- Consider adding more dependencies to the readiness check as needed
178
181
179
182
## Conclusion
180
183
181
-
This implementation ensures that the server is only considered ready when it has established connections to both the database and SpiceDB authorizer. This improves the reliability of the deployment by preventing traffic from being sent to instances that are not fully initialized.
184
+
This implementation ensures that the server is only considered ready when it has established connections to the database, SpiceDB authorizer, and Redis. This improves the reliability of the deployment by preventing traffic from being sent to instances that are not fully initialized.
0 commit comments