Use /livez/ for the API liveness probe and a cheaper readiness probe
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 62/100
Hướng nghiên cứu
The default probes are defined in controllers/deployment.go: the liveness httpGet and the readiness exec of /usr/bin/readyz.py, both pointing at api/v3/status/. Start there and change the liveness path to api/v3/livez/ with the existing timings, then decide the readiness timings or endpoint with a maintainer. Done means the defaults match the issue and the Pulp CR overrides still apply.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
The default API probes call /status/. This is the same in 2.0.0 and on main, in controllers/deployment.go:
- Liveness:
httpGetto<API_ROOT>api/v3/status/, every 20s, timeout 10s,failureThreshold: 10. - Readiness:
exec/usr/bin/readyz.py <API_ROOT>api/v3/status/, every 10s, timeout 10s,failureThreshold: 1.
/status/ is not a light check. It runs some database queries, and with object storage it runs SUM(size) over all artifacts (pulp/pulpcore#8196). Because the probes call it on every API pod all the time, this causes two problems:
- Database load. The load grows with the number of API replicas and the number of artifacts.
- Restarts that do not help. When the database is slow,
/status/takes more than 10s, and the liveness probe restarts API pods that are healthy. A restart does not make the database faster, and requests in progress fail.
Describe the solution you'd like
- Liveness: use
<API_ROOT>api/v3/livez/. Since pulp/pulpcore#7721,/livez/does not use the database, so it checks only that the API process answers. This is the correct check for a liveness probe. - Readiness: keep the database and Redis check, but make it cheaper. For example, call
/status/less often, with a longer timeout andfailureThresholdabove 1. Or add a light endpoint in pulpcore that checks only the database and Redis connections.
Describe alternatives you've considered
We override the probes in the Pulp CR (spec.api.livenessProbe, spec.api.readinessProbe):
- Liveness:
httpGet<API_ROOT>api/v3/livez/, with the default timings. - Readiness: the default
readyz.pycommand, every 60s, timeout 30s,failureThreshold: 3.
This works for us, but every user of the defaults has the same problem.
Additional context
/status/cost in pulpcore: pulp/pulpcore#8196- Similar aggregate in the telemetry task: pulp/pulpcore#7475
/livez/without the database: pulp/pulpcore#7721
- Ngôn ngữ chính
- Go
- Star
- 88
- Fork
- 69
- Merge trung bình
- 3 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pulp/pulp-operator
-
settings.py flaps between reconciles: needsMigrationSetting depends on map iteration orderCó thể đã có người làm @fontaineajulien đã nhận 26 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
pulp/pulp-operator#1691 ·
-
Documentation for metadata signing (APT/RPM) removed but still relevantCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởIssue Triage-Needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pulp/pulp-operator#1644 ·
-
Feature Triage-Needed
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
pulp/pulp-operator#1697 · 2 reaction ·
-
Issue Triage-Needed
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
pulp/pulp-operator#1685 ·
-
Gateway API compatibilityĐang mởFeature Triage-Needed
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
pulp/pulp-operator#1682 ·
Tất cả issue của pulp/pulp-operator
Issue tương tự
-
Headerless responses block while skipping duplicate status linesCó thể đã có người làm @mynhe đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
projectdiscovery/rawhttp#554 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
lognorman20/monaco#7428 ·
-
docs(prompts): IF BLOCKED workflow-scope branch says to comment on the issue on jira/local trackersĐang mởagent-butler-finding bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
jordansmall/spindrift#6238 ·
Maintainer thường phản hồi trong vòng 1 ngày