Skip to content

feat(k8s): run SearXNG in namespace devops #3924

Description

@dan-petty

Problem

The project has no search service of its own. Firecrawl, the only keyed provider, answers HTTP 402 (the credit is used up). The DuckDuckGo fallback of #3876 queries from the Service pod and has no second path. The owner asked on 2026-11-07 to run SearXNG locally. Upstream ships no Helm chart and no Kubernetes manifest: searxng/searxng-docker is archived, and container/docker-compose.yml in the main repository is the upstream form (read 2026-11-07). So this repository owns the manifests.

Expected

Manifests in k8s/devops/searxng/: ConfigMap searxng-settings (settings.yml), Deployment, Service searxng on port 8080, NetworkPolicy searxng-perimeter, NetworkPolicy searxng-clients. Image docker.io/searxng/searxng:<newest tag at least 14 days old on the day of the change>@sha256:<digest>. On 2026-11-07 that is 2026.10.23-629368e40@sha256:aecad882e86eeb022b76351c8dce4eb48d0cbb16a5f1691f77ea32c96d317502, and the tag 2026.10.24-ef0ec03da qualifies after 08:53Z that day. One replica. No Ingress.

Pod: runAsNonRoot, numeric runAsUser and runAsGroup 977, fsGroup 977, RuntimeDefault seccomp, no service account token, drop ALL, no privilege escalation, read-only root, emptyDir at /tmp and /var/cache/searxng. Env SEARXNG_SECRET from Secret searxng. Probes on /healthz. First limits are a guess (requests 50m CPU and 256Mi; limits 1 CPU and 768Mi): replace them with the measured peak of 20 queries plus a margin.

settings.yml (no secret in it): use_default_settings with engines.keep_only of the keyless engines (duckduckgo, wikipedia, github, pypi, stackoverflow, askubuntu, superuser, arxiv, mdn, docker hub; check each name against the default file at the pinned commit); server.limiter false; server.public_instance false; server.image_proxy false; search.formats [html, json]; search.autocomplete empty; search.default_lang en; outgoing.request_timeout 5.0; outgoing.useragent_suffix the project URL (no e-mail address). No Brave engine, no google, no bing, no startpage, no mojeek, no qwant. No Valkey.

Secret row in src/devops_cli/k8s/cluster_secrets.py: devops/searxng key SEARXNG_SECRET, keyring-only value searxng_secret_key, SecretGenerator("hex", 32), restarts Deployment searxng. A person runs the push command. The change creates no secret.

NetworkPolicy: devops-default-perimeter skips pods searxng (NotIn). searxng-perimeter admits ingress only from pods roadmap-service on TCP 8080. Its egress is DNS in kube-system and public TCP 443 with the private, shared, link-local and metadata ranges removed (same except list as the default perimeter). searxng-clients lets pods roadmap-service reach pods searxng on 8080. Each file is in the kustomization and in MANIFESTS_BY_STACK["devops"]. k8s/devops/configmap.example.yaml gets search.searxng_url: http://searxng.devops.svc.cluster.local:8080 only when the search item has merged (see Related). k8s/README.md has a section for the service: what it is, the pin and its bump steps, the license (AGPL-3.0, unmodified image, not patched), the engine list, the log command.

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 image has a tag and a digest; no Ingress or route names searxng; automountServiceAccountToken is false; the pod meets restricted; the settings.yml has limiter: false, public_instance: false and formats with json.
  • A new test fails on the base: the ConfigMap enables none of brave, braveapi, google, bing, startpage, mojeek, qwant. Reason: these scraping engines were suspended by their upstream sites in October 2026 (SearXNG issues 6866 and 6819), and the keyed Brave engine is not used (owner decision of 2026-11-07).
  • A new test fails on the base: every name in keep_only exists in the default settings.yml at the pinned commit.
  • tests/commands/k8s/test_k8s_network_policies.py fails on the base: searxng-perimeter admits ingress from roadmap-service only and egress to DNS and public 443 only; the default perimeter does not select searxng; no Job pod (devops-cli-job) may reach 8080.
  • The Secret row test (tests/invariants/test_k8s_manifests.py, secret-table rows) fails on the base and passes: the row is in the table and in k8s/README.md.
  • tests/k8s/test_image_pins.py resolves the pin.
  • Live evidence in a PR comment, recorded in the proposal's ## Feasibility: the pod starts as user 977 under restricted with a read-only root (the researcher could not run the image, so this is NOT RUN until now); GET /search?q=<term>&format=json returns the keys query, results, answers, corrections, infoboxes, suggestions, unresponsive_engines; which categories the kept engines answer in (the technical engines may answer only when the request names their category); peak memory and CPU for 20 queries; a roadmap-service pod reaches port 8080 and a pod without the label does not (kube-router handling of the peer shape). 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 .github/renovate.json, which has no minimum release age: the PR text tells the person to check the 14-day age).

Existing tool considered

SearXNG (AGPL-3.0), used unmodified over HTTP, with container/docker-compose.yml of the main repository as the model. Rejected: a community Helm chart (Artifact Hub lists about 17, none official, the best has 4 stars, several lag the app by months); the archived searxng-docker; the SearXNG limiter with Valkey (needs a policy change for valkey-devops and fails plain machine clients; the NetworkPolicy replaces it); a Brave engine inside SearXNG (the key would force the whole settings file into a Secret, and Brave hits could not be told apart from other hits).

Related

Related: #3877 (ADR), #3884 (Crawl4AI manifests: edits the same three places, the second to merge rebases), #3876, #3243. Next: the SearXNG provider item and the live-check item. The key search.searxng_url is added by the SearXNG provider item, so the ConfigMap example line comes in that item.

Part of the search provider plan of 2026-11-07 (SearXNG; the Brave Search API was dropped by the owner on 2026-11-07).

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 it, but the project already has Firecrawl and a DuckDuckGo fallback, so it is an enhancement, not a blocker.
    • Value: Medium. Adds a second keyless search path and reduces reliance on a paid API, but the existing fallback already covers basic search.
    • Effort: Medium. Requires ConfigMap, Deployment, Service, two NetworkPolicies, a Secret row, tests, and a README section.
    • Related: feat(k8s): run Crawl4AI 0.9.5 in namespace devops #3884, which asks for a different change. Both deploy a new service in the devops namespace with manifests, NetworkPolicy, and a pinned image, but one runs SearXNG for search and the other runs Crawl4AI for page extraction.
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 7, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 7, 2026
  5. added a commit that references this issue on Nov 7, 2026
  6. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-07 22:00 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