Skip to content

fix(k8s): start SearXNG when its metrics Secret is missing #6805

Closed

Description

@dan-petty

Problem

SearXNG does not start a new pod when the Secret of its optional metrics endpoint is missing.

Proposed remedy

Make the reference optional (optional: true). When the Secret is missing, render-settings writes the settings with the OpenMetrics endpoint off and logs one line that names the Secret. The ServiceMonitor scrape then fails and its alert shows the missing Secret, but search runs.

Acceptance criteria

  • A render test: with no Secret, the rendered settings turn the metrics endpoint off, and the init container exits 0.
  • With the Secret, the rendered settings hold the password, as now.
  • k8s/README.md row of devops/searxng-metrics-auth says that the Secret is optional.

Dependencies

None. Related: #4201, #5193.

Activity

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

    @dan-petty
    OwnerAuthor
    • Priority: P1-High. The missing Secret degraded the SearXNG Deployment for over 8 hours, leaving only 1 of 2 replicas ready.
    • Related: fix(monitoring): Grafana starts when the renderer token is missing #5200, which asks for a different change. Both make an optional Secret reference non-blocking so the main service starts; #5200 targets Grafana renderer token, this targets SearXNG metrics Secret.
  3. added
    priority/p1-high
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 22, 2026
  4. dan-petty commented on Nov 22, 2026

    @dan-petty
    OwnerAuthor

    Evidence of 2026-11-22 for the remedy: the scrape does not fail while the Secret is missing. It is absent.

    • Alloy (k8s-monitoring-alloy-metrics, component prometheus.operator.servicemonitors) logged error generating scrapeconfig from serviceMonitor ... name=searxng err="secrets \"searxng-metrics-auth\" not found" at 13:24 and at 18:39 UTC, and made no scrape config for the ServiceMonitor.
    • So Prometheus had no up series for SearXNG (up{namespace="devops"} gave only roadmap-service). An alert on up == 0 cannot fire for this case.
    • After the Secret was pushed, the Deployment rolled out, but Alloy makes the scrape config again only at its next reconcile, not when the Secret appears.

    So the sentence of the remedy "The ServiceMonitor scrape then fails and its alert shows the missing Secret" is false here. A check that sees this case uses absent(up{job="searxng"}) (or the job label that the ServiceMonitor gives), and the docs say that Alloy reads the Secret only when it makes the scrape config.

  5. added
    status/in-review
    and removed
    status/in-progress
    on Nov 23, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 23, 2026
  7. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-23 01:38 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/p1-highscope/k8ssource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions