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-5.0.1
  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:
      annotations:
        checksum/secrets: bde85bf0e789068912500ddf7c5550674cdb1be7ed7ca049a3028a5c3e5a64e4
      labels:
        app.kubernetes.io/controller: api
        app.kubernetes.io/instance: searxng
        app.kubernetes.io/name: searxng
    spec:
      enableServiceLinks: false
      serviceAccountName: searxng
      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:d137e9b7877b7982c5e8ccf878fda0a05d3c8564ebace7f66424a5a19a3c29d9
          name: main
          resources:
            requests:
              cpu: 1m
              memory: 120Mi
          volumeMounts:
            - mountPath: /etc/searxng
              name: api-data
            - mountPath: /etc/searxng/
              mountPropagation: None
              name: config
              readOnly: true
      volumes:
        - name: api-data
          persistentVolumeClaim:
            claimName: searxng-api-data
        - csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: searxng-api-config
          name: config
