Skip to content

feat(k8s): run Crawl4AI 0.9.5 in namespace devops #3884

Description

@dan-petty

Problem

The project has no service that returns the text of a web page. web_fetch_tool was removed in v0.2.39 (commit f209f6c), and firecrawl_search returns titles, URLs and descriptions only. The owner asked on 2026-11-07 to run Crawl4AI on the cluster. Upstream ships no Helm chart and no Kubernetes manifest, only a Dockerfile and docker-compose.yml (git tree of v0.9.5, read 2026-11-07), so this repository owns the manifests.

Expected

Manifests in k8s/devops/crawl4ai/: Deployment, Service, NetworkPolicy. Image unclecode/crawl4ai:0.9.5@sha256:0b05666882bfb67f45d559a5b827839c54127b74aedd723f8ab338a3571b5fc9. One replica, strategy Recreate. Pod Security restricted settings (numeric runAsUser checked in the image, drop ALL, RuntimeDefault seccomp, no service account token, read-only root if it starts). emptyDir for the six upstream tmpfs paths and a memory emptyDir of 1Gi at /dev/shm. Env: CRAWL4AI_API_TOKEN from Secret crawl4ai, GUNICORN_BIND=0.0.0.0:11235. Not set: CRAWL4AI_ALLOW_INTERNAL_URLS, CRAWL4AI_HOOKS_ENABLED, CRAWL4AI_EXECUTE_JS_ENABLED, any LLM key. Probes on /health. First limits: memory 4Gi, CPU 2, ephemeral storage 2Gi. No Ingress.

NetworkPolicy: devops-default-perimeter skips pods crawl4ai (NotIn). New crawl4ai-perimeter: ingress only from pods roadmap-service on 11235; egress only DNS and public TCP 80 and 443 with the private, shared, link-local and metadata ranges removed. New egress rule on pods roadmap-service to pods crawl4ai on 11235. Each file is in the kustomization and in MANIFESTS_BY_STACK["devops"]. k8s/README.md has a section for the service (what it is, the pin, the advisory watch, how to read the log).

Acceptance criteria

  • tests/invariants/test_k8s_argocd_apps.py::test_every_application_in_argocd_apps_maps_to_deploy_stack_counterpart fails on the base and passes once the files are in MANIFESTS_BY_STACK.
  • A new test fails on the base: the Deployment image has a tag and a digest; no env name from the list above is set; no Ingress or route names crawl4ai; automountServiceAccountToken is false; the pod meets restricted.
  • tests/commands/k8s/test_k8s_network_policies.py fails on the base: crawl4ai-perimeter admits ingress from roadmap-service only; the default perimeter does not select crawl4ai; no Job pod (devops-cli-job) may reach 11235.
  • tests/k8s/test_image_pins.py resolves the pin.
  • Live evidence in a PR comment, recorded in the proposal's ## Feasibility: the image user ID; the pod starts under restricted; IPv4 works with the GUNICORN_BIND value; the /md response shape; memory and CPU for 1, 2 and 4 concurrent pages. If the pod cannot start under restricted, STOP and return the item (rule 2). Do not lower the namespace level.
  • Renovate opens a bump for the image (check with renovate --dry-run or read the config: .github/renovate.json covers k8s/**/*.yaml).

Existing tool considered

Crawl4AI 0.9.5 (Apache-2.0), used unmodified, with the upstream compose limits as the model. Rejected: Firecrawl self-hosted (AGPL-3.0, latest release v2.11.0 from 2026-06-19, heavier stack, not read in detail); Kindly Web Search MCP (no release, no SSRF check, no auth). Cost of building our own fetcher: a hand-written one was already removed once.

Related

Depends on the token issue. Related: #3877 (research agent ADR), #3243 (research toolset), #3876 (DuckDuckGo fallback). The in-app SSRF filter had critical bypasses in 0.8.x and 0.9.0 (GHSA list, read 2026-11-07), so the NetworkPolicy is the main control.

Activity

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

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. The owner requested this on 2026-11-07 and it fills a capability gap, but it is a planned feature, not a defect or security fix.
    • Value: Medium. It restores the ability to fetch full page text, which was removed in v0.2.39.
    • Effort: Medium. It requires a Deployment, Service, NetworkPolicy, kustomization edits, README section, and several new tests.
    • Related: feat(k8s): add the Crawl4AI token to the cluster secrets #3882, which asks for a different change. Both concern the Crawl4AI service in the devops namespace, but #3882 adds the token secret while this item adds the Deployment, Service, and NetworkPolicy manifests.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Plan note of 2026-11-07. The SearXNG manifest item (feat(k8s): run SearXNG in namespace devops) edits the same three places as this item: the NotIn list of devops-default-perimeter, k8s/devops/kustomization.yaml and MANIFESTS_BY_STACK["devops"]. Whichever pull request merges second rebases and adds its own name to the list. The two services need different egress: SearXNG needs public TCP 443 only, Crawl4AI needs 80 and 443.

  5. added
    owner/agent
    on Nov 7, 2026
  6. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Note from the work on #3882 (PR #3937), so that the names match.

    • Secret devops/crawl4ai, key CRAWL4AI_API_TOKEN: the service reads it as an env var from secretKeyRef. The Secret has the label app.kubernetes.io/name: crawl4ai.
    • Secret devops/devops-cli, key DEVOPS_CLI_CRAWL4AI_API_TOKEN, not required: the roadmap Service reads it with envFrom as it reads its other keys. The credential is crawl4ai.api_token.
    • Argo CD already ignores Secret crawl4ai as an orphaned resource (k8s/argocd/apps/projects.yaml).
    • The row devops/crawl4ai in src/devops_cli/k8s/cluster_secrets.py has restarts=(). The gate test of restart targets accepts a workload only when a manifest holds it. This item must add Workload("deployment", "crawl4ai") to that row, and the matching cell of the Cluster Secrets table in k8s/README.md (deployment/crawl4ai), in the same pull request as the Deployment.
  7. added
    status/in-review
    and removed
    status/new
    on Nov 7, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 7, 2026
  9. added a commit that references this issue on Nov 7, 2026
  10. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-07 15:32 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/mediumpriority/p2-mediumscope/k8ssource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions