GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Standardize health probes with shared helpers by marcleblanc2 · Pull Request #971 · sourcegraph/deploy-sourcegraph-helm

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Oct 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fixes #296.

Every probed container in the sourcegraph chart now renders the same three-probe shape from one of four helpers under templates/_helpers/:

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.

Why

#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.

Behaviour changes worth a look

  • codeinsights-db had no probes at all. The postgresql-16-codeinsights image ships the same /ready.sh and /liveness.sh as postgresql-16; it now matches pgsql and codeintel-db.
  • blobstore probed 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.
  • New liveness probes on searcher, cadvisor (/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).
  • zoekt-indexserver gets liveness only. A readiness probe on it would gate the pod's Service endpoints and pull zoekt-webserver out of rotation whenever the indexer blinks.
  • zoekt-webserver is unchanged. Per CU-3205 the team decided to keep readiness on /healthz rather than /readyz; zoekt increments Crashes while loading so the aggregator already treats results as incomplete.
  • redis-store liveness 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.
  • syntect-server readiness moves from tcpSocket to /health.
  • Startup budgets: frontend 300s (unchanged), workers 60s → 300s, gitserver 120s → 300s. Postgres 3600s (unchanged). Prometheus readiness used to retry for 600s then never kill; it now has a 3600s startup deadline and a /-/healthy liveness probe.
  • Pods not touched: the pgsql-exporter and redis-exporter sidecars (never had probes), and the migrator init container.

Every probe, before and after

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.

startupProbe

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 10 1 1 5 360 3600
gitserver /ready on http-debug 0 1 1 5 120 300
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 10 1 1 5 360 3600
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

livenessProbe

container target delay period timeout failures
blobstore / on http /healthz on http-debug 60 0 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 15 0 10 1 5 3
gitserver /healthz on http-debug 5 0 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 1 5 3
otel-agent / on 13133 0 10 1 5 3
otel-collector / on 13133 0 10 1 5 3
pgsql /liveness.sh 15 0 10 1 5 3
precise-code-intel-worker /healthz on http-debug 60 0 10 5 3
prometheus + /-/healthy on http + 0 + 10 + 5 + 3
redis-cache tcp on redis 60 0 30 10 5 5 3
redis-store tcp on redis 60 0 30 10 5 2 3
searcher + /healthz on http-debug + 0 + 10 + 5 + 3
sourcegraph-frontend / frontend /healthz on http-debug 300 0 10 5 3
syntactic-code-intel-worker /healthz on http-debug 60 0 10 5 3
syntect-server /health on http 5 0 10 5 3
worker /healthz on http-debug 60 0 10 5 3

readinessProbe

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 10 5 1 5 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 5 0 10 5 1 5 3
node-exporter / on metrics 0 10 5 1 5 3
otel-agent / on 13133 0 10 5 1 5 3
otel-collector / on 13133 0 10 5 1 5 3
pgsql /ready.sh 0 10 5 1 5 3
precise-code-intel-worker /ready on http-debug 0 5 5 3
prometheus /-/ready on http 0 5 3 5 120 3
redis-cache redis-cli ping 10 0 10 5 5 5 3
redis-store redis-cli ping 10 0 10 5 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 tcp on http /health on http 0 10 5 1 5 3
worker /ready on http-debug 0 5 5 3

Checklist

  • Follow the manual testing process
  • Update changelog
  • Update Kubernetes update doc

Test plan

  • 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.
  • Not yet done: deploy to a cluster and confirm 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@marcleblanc2 @ampagent
sourcegraph: standardize health probes with shared helpers
85af304
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
@github-actions

github-actions Bot commented Oct 20, 2026

Copy link
Copy Markdown

Open the Diff Tour for this PR in Sourcegraph

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marcleblanc2
marcleblanc2 requested a review from a team October 22, 2026 05:38
@marcleblanc2 marcleblanc2 changed the title sourcegraph: standardize health probes with shared helpers Standardize health probes with shared helpers Nov 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Background services livenessProbe is too aggressive

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@marcleblanc2
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.