GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Standardize health probes with shared helpers by marcleblanc2 · Pull Request #971 · sourcegraph/deploy-sourcegraph-helm Conversation
|
| Helper | Containers |
|---|---|
sourcegraph.probes (/healthz + /ready on http-debug) |
frontend, worker, precise-code-intel-worker, syntactic-code-intel-worker, gitserver, searcher, blobstore |
sourcegraph.httpProbes (generic, path/port params) |
grafana, cadvisor, prometheus, jaeger, otel-collector, otel-agent, node-exporter, syntect-server, zoekt-indexserver |
sourcegraph.postgresProbes (/liveness.sh + /ready.sh) |
pgsql, codeintel-db, codeinsights-db |
sourcegraph.redisProbes (tcp + redis-cli ping) |
redis-cache, redis-store |
Shape: a startup probe (1s period, failureThreshold = startupDeadlineSeconds) that holds liveness and readiness off until it passes; a liveness probe at 10s/5s/3 (restart after ~30s of failures); a readiness probe at 5s/5s. sourcegraph.startupDeadlineSeconds defaults to 300, overridable per service. The three Postgres databases and prometheus default to 3600 for crash recovery, major-version upgrades, and WAL replay.
#296: repo-updater (since removed) had a 1s/3-failure liveness probe with no delay, so a resource-starved pod was killed before it could bind its port. The same pattern, softened by a flat initialDelaySeconds, was still on every Go service: a readiness probe that fires at 0s and fails until startup finishes, and a liveness probe that is useless for the first 60–300s and then can still kill a slow start. /healthz on every sourcegraph/sourcegraph binary is a static 200 the moment the debugserver listens, so a liveness failure during startup only ever means "hasn't bound the port yet". A startup probe is the right tool for that.
postgresql-16-codeinsights image ships the same /ready.sh and /liveness.sh as postgresql-16; it now matches pgsql and codeintel-db.GET / on the S3 API port. It is a svcmain binary like the others, so it now exposes http-debug: 6060 and probes /healthz and /ready there./healthz), prometheus (/-/healthy), jaeger (/status), zoekt-indexserver (/debug); new liveness + readiness on grafana (/healthz, /api/health; both are root-level middleware in Grafana 7.5 so they work with serve_from_sub_path)./healthz rather than /readyz; zoekt increments Crashes while loading so the aggregator already treats results as incomplete.failureThreshold goes from 2 to the standard 3; redis-cache from 5 to 3. Readiness still fails on LOADING, liveness still passes on an open socket, so a long RDB load keeps the pod alive but out of rotation, same as before.tcpSocket to /health./-/healthy liveness probe.pgsql-exporter and redis-exporter sidecars (never had probes), and the migrator init container.Rendered from helm template on main and on this branch with syntacticCodeIntel, jaeger, and openTelemetry.agent enabled. Unchanged values are plain; old new marks a change; + value marks a probe that did not exist before. delay is initialDelaySeconds. Where main omitted a field, the Kubernetes default (delay 0 / period 10 / timeout 1 / failures 3) is shown.
| container | target | delay | period | timeout | failures |
|---|---|---|---|---|---|
| blobstore | + /ready on http-debug |
+ 0 | + 1 | + 5 | + 300 |
| cadvisor | + /healthz on http |
+ 0 | + 1 | + 5 | + 300 |
| codeinsights-db / codeinsights | + /liveness.sh |
+ 0 | + 1 | + 5 | + 3600 |
| codeintel-db / pgsql | /liveness.sh |
0 | |||
| gitserver | /ready on http-debug |
0 | 1 | ||
| grafana | + /api/health on http |
+ 0 | + 1 | + 5 | + 300 |
| indexed-search / zoekt-indexserver | + /debug on grpc-indexer |
+ 0 | + 1 | + 5 | + 300 |
| jaeger | + /status on health |
+ 0 | + 1 | + 5 | + 300 |
| node-exporter | + / on metrics |
+ 0 | + 1 | + 5 | + 300 |
| otel-agent | + / on 13133 |
+ 0 | + 1 | + 5 | + 300 |
| otel-collector | + / on 13133 |
+ 0 | + 1 | + 5 | + 300 |
| pgsql | /liveness.sh |
0 | |||
| precise-code-intel-worker | + /ready on http-debug |
+ 0 | + 1 | + 5 | + 300 |
| prometheus | + /-/ready on http |
+ 0 | + 1 | + 5 | + 3600 |
| redis-cache | + tcp on redis |
+ 0 | + 1 | + 5 | + 300 |
| redis-store | + tcp on redis |
+ 0 | + 1 | + 5 | + 300 |
| searcher | + /ready on http-debug |
+ 0 | + 1 | + 5 | + 300 |
| sourcegraph-frontend / frontend | + /ready on http-debug |
+ 0 | + 1 | + 5 | + 300 |
| syntactic-code-intel-worker | + /ready on http-debug |
+ 0 | + 1 | + 5 | + 300 |
| syntect-server | + /health on http |
+ 0 | + 1 | + 5 | + 300 |
| worker | + /ready on http-debug |
+ 0 | + 1 | + 5 | + 300 |
| container | target | delay | period | timeout | failures |
|---|---|---|---|---|---|
| blobstore | / on http/healthz on http-debug |
10 | 5 | 3 | |
| cadvisor | + /healthz on http |
+ 0 | + 10 | + 5 | + 3 |
| codeinsights-db / codeinsights | + /liveness.sh |
+ 0 | + 10 | + 5 | + 3 |
| codeintel-db / pgsql | /liveness.sh |
10 | 3 | ||
| gitserver | /healthz on http-debug |
10 | 5 | 3 | |
| grafana | + /healthz on http |
+ 0 | + 10 | + 5 | + 3 |
| indexed-search / zoekt-indexserver | + /debug on grpc-indexer |
+ 0 | + 10 | + 5 | + 3 |
| indexed-search / zoekt-webserver | /healthz on grpc |
120 | 60 | 5 | 10 |
| jaeger | + /status on health |
+ 0 | + 10 | + 5 | + 3 |
| node-exporter | / on metrics |
0 | 10 | 3 | |
| otel-agent | / on 13133 |
0 | 10 | 3 | |
| otel-collector | / on 13133 |
0 | 10 | 3 | |
| pgsql | /liveness.sh |
10 | 3 | ||
| precise-code-intel-worker | /healthz on http-debug |
10 | 5 | 3 | |
| prometheus | + /-/healthy on http |
+ 0 | + 10 | + 5 | + 3 |
| redis-cache | tcp on redis |
5 | |||
| redis-store | tcp on redis |
5 | |||
| searcher | + /healthz on http-debug |
+ 0 | + 10 | + 5 | + 3 |
| sourcegraph-frontend / frontend | /healthz on http-debug |
10 | 5 | 3 | |
| syntactic-code-intel-worker | /healthz on http-debug |
10 | 5 | 3 | |
| syntect-server | /health on http |
10 | 5 | 3 | |
| worker | /healthz on http-debug |
10 | 5 | 3 |
| container | target | delay | period | timeout | failures |
|---|---|---|---|---|---|
| blobstore | / on http/ready on http-debug |
0 | 5 | 5 | 3 |
| codeinsights-db / codeinsights | + /ready.sh |
+ 0 | + 5 | + 5 | + 3 |
| codeintel-db / pgsql | /ready.sh |
0 | 3 | ||
| gitserver | /ready on http-debug |
0 | 5 | 5 | 3 |
| grafana | + /api/health on http |
+ 0 | + 5 | + 5 | + 3 |
| indexed-search / zoekt-webserver | /healthz on grpc |
0 | 5 | 5 | 3 |
| jaeger | /status on 13133/status on health |
3 | |||
| node-exporter | / on metrics |
0 | 3 | ||
| otel-agent | / on 13133 |
0 | 3 | ||
| otel-collector | / on 13133 |
0 | 3 | ||
| pgsql | /ready.sh |
0 | 3 | ||
| precise-code-intel-worker | /ready on http-debug |
0 | 5 | 5 | 3 |
| prometheus | /-/ready on http |
0 | 5 | ||
| redis-cache | redis-cli ping |
5 | |||
| redis-store | redis-cli ping |
5 | 3 | ||
| searcher | /ready on http-debug |
0 | 5 | 5 | 3 |
| sourcegraph-frontend / frontend | /ready on http-debug |
0 | 5 | 5 | 3 |
| syntactic-code-intel-worker | /ready on http-debug |
0 | 5 | 5 | 3 |
| syntect-server | http/health on http |
0 | 3 | ||
| worker | /ready on http-debug |
0 | 5 | 5 | 3 |
helm unittest charts/sourcegraph: 33 suites / 204 tests pass, including the new tests/probes_test.yaml (standard shape, global deadline applied through every helper, per-service override, 1h default for databases and prometheus, codeinsights-db probes present, redis/blobstore/grafana/zoekt-indexserver specifics).helm lint charts/sourcegraph clean; ./scripts/helm-docs.sh regenerated the README with no stray diff.helm template with syntacticCodeIntel, jaeger, and openTelemetry.agent enabled, then dumped every container's startup/liveness/readiness probe to confirm all 21 probed containers render the expected paths, ports, and thresholds.blobstore answers on :6060/ready, grafana on :3370/healthz and /api/health, and zoekt-indexserver on :6072/debug. All three were verified against source, not a running pod.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add sourcegraph.probes, sourcegraph.httpProbes, sourcegraph.postgresProbes, and sourcegraph.redisProbes under templates/_helpers, and use them for every probed container in the chart. Each container gets a startup probe that holds liveness and readiness off until it passes, a liveness probe that restarts after 30s of failures, and a readiness probe every 5s. Add sourcegraph.startupDeadlineSeconds (default 300) with a per-service <serviceName>.startupDeadlineSeconds override; the Postgres databases and prometheus default to 3600 for crash recovery, upgrades, and WAL replay. Add the missing probes to codeinsights-db, a liveness probe to searcher, cadvisor, prometheus, jaeger, and zoekt-indexserver, and liveness and readiness probes to grafana. Probe blobstore on its debug port instead of the S3 API root. Fixes #296 Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-01a1572b-fce8-7159-abd5-f4142c8f68a2
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Background services livenessProbe is too aggressive
There was an error while loading. Please reload this page.