Recently the searx instance I generally used suddenly went down, so I decided to host my own. If you don’t know what searx is it’s a metasearch engine which strips any tracking info and aggregates other search engines. Check out their github page for more info.

Now, for simplicity sake right now, we are going to use a pre-build docker image provided by wonderfall. In the future we’ll be building our own along with the inclusion of some proxy changes.

Deployment is very straight forward in this case. I will be using an ingress rule for routing of the traffic and kube-lego for generating and managing an SSL certificate. Then in 30 seconds we will have a running searx instance in our own Kubernetes cluster.

Here is the complete yml config, edit the settings and deploy this using kubectl create -f searx.yml.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: searx
  namespace: searx
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: searx
    spec:
      containers:
      - name: searx
        image: wonderfall/searx:latest
        imagePullPolicy: Always
        env:
        - name: IMAGE_PROXY
          value: False
          name: BASE_URL
          value: https://my.search.com
        ports:
        - containerPort: 8888
---
kind: Service
apiVersion: v1
metadata:
  name: searx
  namespace: searx
spec:
  selector:
    app: searx
  type: LoadBalancer
  ports:
  - name: http
    port: 8888
    targetPort: 8888
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: searx
  namespace: searx
  annotations:
    kubernetes.io/tls-acme: "true"
    kubernetes.io/ingress.class: "nginx"
spec:
  tls:
  - hosts:
    - my.search.com
    secretName: searx-tls
  rules:
  - host: my.search.com
    http:
      paths:
      - path: /
        backend:
          serviceName: searx
          servicePort: 8888