apiVersion: apps/v1
kind: Deployment
metadata:
  name: searxng-api
  labels:
    app.kubernetes.io/controller: api
    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: api
      app.kubernetes.io/name: searxng
      app.kubernetes.io/instance: searxng
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: api
        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: http://searxng-api.searxng:8080
            - name: SEARXNG_QUERY_URL
              value: http://searxng-api.searxng:8080/search?q=<query>
            - name: SEARXNG_HOSTNAME
              value: searxng-api.searxng
            - name: ENABLE_RAG_WEB_SEARCH
              value: "true"
            - name: RAG_WEB_SEARCH_ENGINE
              value: searxng
            - name: RAG_WEB_SEARCH_RESULT_COUNT
              value: "3"
            - name: RAG_WEB_SEARCH_CONCURRENT_REQUESTS
              value: "10"
          image: searxng/searxng:latest@sha256:670bd1076097640fc25221bf92a8af7d344503ce17ba3305abedf28e3634e807
          imagePullPolicy: IfNotPresent
          name: main
          resources:
            requests:
              cpu: 10m
              memory: 256Mi
          volumeMounts:
            - mountPath: /etc/searxng
              name: api-data
            - mountPath: /etc/searxng/settings.yml
              mountPropagation: None
              name: config
              readOnly: true
              subPath: settings.yml
            - mountPath: /etc/searxng/limiter.toml
              mountPropagation: None
              name: config
              readOnly: true
              subPath: limiter.toml
      volumes:
        - name: api-data
          persistentVolumeClaim:
            claimName: searxng-api-data
        - name: config
          secret:
            secretName: searxng-api-config-secret
