apiVersion: apps/v1
kind: Deployment
metadata:
  name: searxng-browser
  labels:
    app.kubernetes.io/controller: browser
    app.kubernetes.io/instance: searxng
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: searxng
    helm.sh/chart: searxng-4.6.2
  namespace: searxng
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: browser
      app.kubernetes.io/name: searxng
      app.kubernetes.io/instance: searxng
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: browser
        app.kubernetes.io/instance: searxng
        app.kubernetes.io/name: searxng
    spec:
      enableServiceLinks: false
      serviceAccountName: default
      automountServiceAccountToken: true
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - env:
            - name: SEARXNG_BASE_URL
              value: https://searxng.alexlebens.net/
            - name: SEARXNG_QUERY_URL
              value: https://searxng.alexlebens.net/search?q=<query>
            - name: SEARXNG_HOSTNAME
              value: searxng.alexlebens.net
            - name: SEARXNG_VALKEY_URL
              value: valkey://127.0.0.1:6379/0
            - name: GRANIAN_HOST
              value: 0.0.0.0
            - name: GRANIAN_PORT
              value: "8080"
          image: searxng/searxng:latest@sha256:670bd1076097640fc25221bf92a8af7d344503ce17ba3305abedf28e3634e807
          imagePullPolicy: IfNotPresent
          name: main
          resources:
            requests:
              cpu: 10m
              memory: 256Mi
          volumeMounts:
            - mountPath: /etc/searxng
              name: browser-data
        - image: valkey/valkey:9.0.0-alpine3.22
          imagePullPolicy: IfNotPresent
          name: valkey
          resources:
            requests:
              cpu: 10m
              memory: 128Mi
          volumeMounts:
            - mountPath: /data
              name: valkey-data
      volumes:
        - name: browser-data
          persistentVolumeClaim:
            claimName: searxng-browser-data
        - name: valkey-data
          persistentVolumeClaim:
            claimName: searxng-valkey-data
