From dc7a2093aeeac4945c0ef5839c5681a1f31a9c8f Mon Sep 17 00:00:00 2001 From: ALI YESILKAYA Date: Mon, 22 Jun 2026 22:50:46 +0200 Subject: [PATCH] =?UTF-8?q?fix(searxng):=20crash=20port=20=E2=80=94=20enab?= =?UTF-8?q?leServiceLinks:false=20+=20port/bind=20explicites=20(#50)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le pod SearXNG crashait en boucle : granian recevait --port tcp://:8080 au lieu d'un entier. Cause classique k8s : le Service « searxng » fait injecter l'env service-link SEARXNG_PORT=tcp://:8080, que l'entrypoint SearXNG lit comme port de bind. - enableServiceLinks:false (coupe l'injection des env service-link, inutiles ici) - SEARXNG_PORT=8080 + SEARXNG_BIND_ADDRESS=0.0.0.0 explicites (défense en profondeur) Co-authored-by: Claude Opus 4.8 --- k8s/apps/searxng/deployment.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/k8s/apps/searxng/deployment.yaml b/k8s/apps/searxng/deployment.yaml index 43d0e50..3668c68 100644 --- a/k8s/apps/searxng/deployment.yaml +++ b/k8s/apps/searxng/deployment.yaml @@ -16,6 +16,11 @@ spec: # Redéploie le pod quand settings.yml change (le hash bouge → nouveau rollout). checksum/config: "searxng-settings-v1" spec: + # CRITIQUE : le Service s'appelle « searxng » → sans ça, k8s injecte la variable + # SEARXNG_PORT=tcp://:8080 (env « service link » façon Docker), que l'entrypoint + # SearXNG lit comme PORT de bind → granian crash (« 'tcp://…:8080' is not a valid integer »). + # On coupe l'injection des service-links (inutiles ici) ; on fixe aussi le port en dur ci-dessous. + enableServiceLinks: false # Conformité PodSecurity "restricted" (namespace ai). L'image tourne en uid 977 (searxng). # fsGroup 977 → l'emptyDir /etc/searxng est accessible en écriture par l'init + le main. securityContext: @@ -51,6 +56,12 @@ spec: ports: - containerPort: 8080 env: + # Port/bind explicites (défense en profondeur vs l'env service-link, déjà coupé + # par enableServiceLinks:false) — l'entrypoint SearXNG lit ces variables. + - name: SEARXNG_PORT + value: "8080" + - name: SEARXNG_BIND_ADDRESS + value: "0.0.0.0" # Base URL interne (pas d'exposition WAN). Requis par SearXNG pour générer ses liens. - name: SEARXNG_BASE_URL value: "http://searxng.lab.local/"