Skip to content

feat(k8s): add k8s crawl4ai-check command - #4108

Merged
dan-petty merged 4 commits into
mainfrom
feat/3894-crawl4ai-check
Nov 8, 2026
Merged

dan-petty merged 4 commits into
mainfrom
feat/3894-crawl4ai-check

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Add devops k8s crawl4ai-check. It sends five routes to five internal targets with the keyring token through a port-forward, and sends each route once without the token. A throwaway pod that never becomes Ready tries two connects under the NetworkPolicy of the service. It exits 1 when a target is served, a request without the token is not refused, or a pod connection opens. Run it at each bump of the image digest. A gate check ties the command to the digest in the manifest.

Closes #3894

Change: openspec/changes/archive/2026-11-08-3894-crawl4ai-check-command/
Elapsed: 2.48s

Plans the change 3894-crawl4ai-check-command and writes its tests first. The tests fail on the base because the command, devops_cli.k8s.service_probe and devops_cli.k8s.crawl4ai_check do not exist.
Adds the command that forwards a port to Service crawl4ai, sends five routes to five internal targets with the keyring token, checks the refusal without the token, and probes the NetworkPolicy from a throwaway pod. The pod and forward code is in k8s/service_probe.py so the SearXNG check can reuse it.
@dan-petty dan-petty added type/feature Type feature: a new function scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 8, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record for #3894.

Tests first: commit d82b2fb added 3 test files (38 tests) that failed (exit 2 for the command, import errors for the modules). The feature commit makes them pass. This is a new command, not a fix, so no fail-to-pass run applies.

Full devops ci before the archive and the rebase: all rows passed except security (bandit B105 on a constant named NO_TOKEN). Fixed at the cause by a rename (commit 070d010); devops ci --only security then passed. The test row took 12m 54s (known class #3593; slowest test is test_k8s_monitoring_alerting, not this change). After the final rebase onto origin/main: docs generate --check passes, and the 38 narrow tests pass.

One run against the cluster by port-forward (exit 0, 11 s). The throwaway pod was in Terminating state at the end and never became Ready (readiness probe false, restricted Pod Security context).

Requests with the token, 5 routes (/md, /html, /screenshot, /pdf, /llm/{url}) by 5 targets (<metadata>, <loopback>, <kubernetes-api>, <crawl4ai-service>, <roadmap-service>): 25 of 25 answered 400 (55-byte body), result refused.

Requests without the token, 5 routes: 5 of 5 answered 401, result refused.

Pod with the label of the service, connect test: <metadata> blocked, <private-cluster-ip> blocked.

Image checked: unclecode/crawl4ai:0.9.5 at the digest of the manifest.

For a person to decide: the issue label says type/test, but the title uses feat because the change adds a command (owner choice of 2026-11-07).

@dan-petty
dan-petty marked this pull request as ready for review November 8, 2026 02:05
@dan-petty
dan-petty merged commit 32e247f into main Nov 8, 2026
25 checks passed
@dan-petty
dan-petty deleted the feat/3894-crawl4ai-check branch November 8, 2026 02:09
dan-petty pushed a commit that referenced this pull request Nov 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.87.0](v0.86.0...v0.87.0)
(2026-11-08)


### Features

* **k8s:** add k8s crawl4ai-check command
([#4108](#4108))
([32e247f](32e247f))


### Bug Fixes

* **repos:** keep unmanaged and ignored-data worktrees in add reclaim
([#4106](#4106))
([8978d56](8978d56))
* **roadmap:** check a split plan of the stage with every gate
([#4109](#4109))
([768dbd3](768dbd3))
* **roadmap:** count only answered searches in alternatives
([#4101](#4101))
([b34fe0e](b34fe0e))
* **roadmap:** keep a round alive on item-changed; fail on bad schedule
([#4102](#4102))
([9231dc3](9231dc3))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(k8s): live check that Crawl4AI refuses internal URLs

1 participant