Skip to content

fix(k8s): Give crawl4ai a liveness probe #6108

Done

Description

@dan-petty

Problem

The Deployment devops/crawl4ai (k8s/devops/crawl4ai/deployment.yaml) has a startup probe and a readiness probe on /health, but no liveness probe. If the app stops answering after its start, Kubernetes does not start the pod again. The kube-linter row of devops ci (#6068) reports no-liveness-probe for it, and the Deployment holds the exception annotation ignore-check.kube-linter.io/no-liveness-probe until this item.

Rule RL2 of docs/SERVICE_PATTERNS.md asks for a liveness probe that checks only that the process makes progress. The latency of /health while Chromium renders a slow page is not measured, so a short timeout could start the pod again during a render.

Expected behavior

  • Measure the latency of /health during renders of slow pages.
  • Add a liveness probe whose period, timeout and failure threshold are above the measured latency.
  • Remove the annotation ignore-check.kube-linter.io/no-liveness-probe from the Deployment, and uv run devops k8s lint passes.

Related

Alternatives check of 2026-11-24: partly.
Tool: prometheus/blackbox_exporter (https://github.com/prometheus/blackbox_exporter), Apache-2.0, last activity 2026-11-16, maintained.
Reason: Searches found no tool that adds or tunes a Kubernetes liveness probe; the blackbox exporter probes HTTP endpoints from outside and returns timing metrics, so it measures /health latency during renders but writes no probe into the Deployment.

Covers:

  • HTTP probes of the /health route from outside the pod
  • Timing metrics that measure how long /health takes
  • probe_success to show whether the route answers

Lacks:

  • No liveness probe added to the Deployment
  • No removal of the kube-linter exception annotation
  • No period, timeout or failure-threshold values

Proposed design

Problem statement

Add a liveness probe to the container crawl4ai of k8s/devops/crawl4ai/deployment.yaml, and remove the annotation ignore-check.kube-linter.io/no-liveness-probe. The Deployment has a startup probe and a readiness probe on /health, but no liveness probe. Without one, Kubernetes never starts again a pod whose app stops answering. The latency of /health during a slow render is not measured, so this change sets safe first values and issue #6320 sizes them from a measurement.

Acceptance criteria

Requirement: Liveness probe on the health route

The container crawl4ai MUST have a liveness probe that calls /health on port 11235 with periodSeconds: 20, timeoutSeconds: 10 and failureThreshold: 3.

Scenario: kube-linter finds the liveness probe

  • WHEN uv run devops ci --check --only kube-linter runs on the change
  • THEN the command exits 0 and reports no no-liveness-probe finding for k8s/devops/crawl4ai/deployment.yaml.

Requirement: The k8s folder renders with the new probe

The change MUST pass the checks of the k8s row of devops ci.

Scenario: The k8s row passes

  • WHEN uv run devops ci --check --only k8s runs on the change
  • THEN the command exits 0.

Requirement: Pending a person after the merge

The live Deployment devops/crawl4ai MUST NOT hold the annotation ignore-check.kube-linter.io/no-liveness-probe.

Scenario: The live Deployment shows the probe and no exception

  • WHEN kubectl -n devops get deployment crawl4ai -o yaml runs after Argo CD syncs the change
  • THEN the output holds no ignore-check.kube-linter.io/no-liveness-probe.

Existing Tool Considered

prometheus/blackbox_exporter, verdict partly. The alternatives check of 2026-11-24 in the issue body lists what the tool covers and what it lacks. This change does what the tool lacks: it sets periodSeconds: 20, timeoutSeconds: 10 and failureThreshold: 3 on a liveness probe in k8s/devops/crawl4ai/deployment.yaml, and it removes the exception annotation. The tool stays the way to record the /health latency, and issue #6320 uses it for that measurement.

Key questions

  • Which period, timeout and failure threshold keep a slow render from a restart?: Set periodSeconds: 20, timeoutSeconds: 10 and failureThreshold: 3. The timeout is twice the readiness timeout of 5 s, and three failures give 60 s before a restart. The startup probe gates the liveness probe, so the probe needs no initialDelaySeconds. (best practice) [sources: k8s/devops/crawl4ai/deployment.yaml, docs/SERVICE_PATTERNS.md]
    • Chosen: Twice the readiness timeout, three failures (period 20 s, timeout 10 s, failureThreshold 3). The timeout of 10 s stays above the 5 s that the readiness probe already allows, and three failures give 60 s before a restart.
    • Rejected: Kubernetes defaults (period 10 s, timeout 1 s, failureThreshold 3). The 1 s timeout is below the readiness timeout of 5 s, so a slow render starts the pod again.
    • Rejected: Long probe (period 30 s, timeout 10 s, failureThreshold 5). A dead process waits 150 s, and a long wait hides a real stop of the app.
  • Which route and port does the liveness probe call?: Call /health on port 11235. It is the only route of the image that needs no token, and the startup probe and the readiness probe already call it. Redis runs in the same pod, so the route names no dependency outside the pod. (best practice) [sources: k8s/devops/crawl4ai/deployment.yaml, docs/SERVICE_PATTERNS.md]
    • Chosen: /health on port 11235. The startup probe and the readiness probe use this route, and the image needs no token for it.
    • Rejected: A tcpSocket probe on port 11235. It shows only that the port accepts a connection, not that the app answers, so a hung worker stays undetected. Rule RL2 asks for progress.
    • Rejected: A new /healthz route. The image is upstream and pinned by digest, so a new route needs a change outside this repository.
  • Which check proves the change?: The kube-linter row of devops ci, with uv run devops ci --check --only kube-linter. It reports no-liveness-probe for this Deployment. No pytest test reads the probe fields, because CT1 of docs/SERVICE_PATTERNS.md gives a manifest value to a schema or policy tool. (best practice) [sources: docs/SERVICE_PATTERNS.md, k8s/devops/crawl4ai/deployment.yaml]
    • Chosen: The kube-linter row of devops ci. It is the row that reports no-liveness-probe, and it runs again on each change.
    • Rejected: A pytest test that reads the probe fields. CT1 of docs/SERVICE_PATTERNS.md gives a manifest value to a schema or policy tool, not to a test of the source code.
  • Does this change wait on the measured /health latency?: No. This change sets first values now, and issue fix(k8s): Size crawl4ai liveness probe from /health latency #6320 replaces them with measured ones. The Deployment already follows this order for its resources: First limits, from the compose file of the project. Measure, then change. (best practice) [sources: k8s/devops/crawl4ai/deployment.yaml, docs/SERVICE_PATTERNS.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#6320

Activity

  1. added
    type/bug
    scope/k8s
    source/agent
    status/new
    value/medium
    effort/low
    on Nov 17, 2026
  2. dan-petty commented on Nov 17, 2026

    @dan-petty
    OwnerAuthor
    • Related: dan-petty/homelab#365, which asks for a different change. Both add a liveness probe to a k8s Deployment, but dan-petty/homelab#365 targets Qdrant while this targets Crawl4AI.
  3. added
    priority/p2-medium
    on Nov 17, 2026
  4. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (8)

    Tools considered:

    Searches run:

    • kubernetes liveness probe latency measurement tool open source, results: 5
    • measure HTTP endpoint latency during load test tool k6 vegeta hey, results: 5
    • Crawl4AI /health endpoint latency during render slow page, results: 5
    • kube-score auto-fix add liveness probe deployment, results: 5
    • grafana k6 http latency percentiles load test github repository, results: 5
    • automatic liveness probe threshold tuning kubernetes tool github, results: 5
    • prometheus blackbox exporter http probe latency histogram, results: 5
    • measure kubernetes health endpoint response time during workload tool, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 18, 2026
  6. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 4ddf77e (see proposed design in issue body).

    Moved to new items: #6320.

  7. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  8. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  10. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 11:55 UTC

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions