forked from seeruk/tsns
-
Notifications
You must be signed in to change notification settings - Fork 6
/
typesense.yml
153 lines (153 loc) · 3.28 KB
/
typesense.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
apiVersion: v1
kind: Namespace
metadata:
name: typesense
---
apiVersion: v1
kind: Service
metadata:
name: ts
namespace: typesense
labels:
app: typesense
spec:
clusterIP: None
publishNotReadyAddresses: true
selector:
app: typesense
ports:
- name: http
port: 8108
targetPort: 8108
---
# apiVersion: v1
# kind: ConfigMap
# metadata:
# name: typesense-config
# namespace: typesense
# data:
# TYPESENSE_ENABLE_CORS: "true"
# ---
apiVersion: v1
kind: Secret
metadata:
name: typesense-secret
namespace: typesense
data:
TYPESENSE_API_KEY: YWJj # abc in base64
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: typesense
namespace: typesense
labels:
service: typesense
app: typesense
spec:
serviceName: ts
podManagementPolicy: Parallel
replicas: 3
selector:
matchLabels:
service: typesense
app: typesense
template:
metadata:
labels:
service: typesense
app: typesense
spec:
serviceAccountName: typesense-service-account
securityContext:
fsGroup: 2000
runAsUser: 10000
runAsGroup: 3000
runAsNonRoot: true
terminationGracePeriodSeconds: 300
containers:
- name: typesense
envFrom:
# - configMapRef:
# name: typesense-config
- secretRef:
name: typesense-secret
image: typesense/typesense:0.22.2
command:
- "/opt/typesense-server"
- "-d"
- "/usr/share/typesense/data"
- "--api-port"
- "8108"
- "--peering-port"
- "8107"
- "--nodes"
- "/usr/share/typesense/nodes"
ports:
- containerPort: 8108
name: http
resources:
requests:
memory: 100Mi
cpu: "100m"
limits:
memory: 1Gi
cpu: "1000m"
volumeMounts:
- name: nodeslist
mountPath: /usr/share/typesense
- name: data
mountPath: /usr/share/typesense/data
- name: typesense-node-resolver
image: alasano/typesense-node-resolver
command:
- "/opt/tsns"
- "-namespace=typesense"
volumeMounts:
- name: nodeslist
mountPath: /usr/share/typesense
volumes:
- name: nodeslist
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
storageClassName: default
resources:
requests:
storage: 30Gi
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: typesense-service-account
namespace: typesense
# imagePullSecrets:
# - name: your-image-pull-secret
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: typesense
name: typesense-role
rules:
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: typesense-role-binding
namespace: typesense
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: typesense-role
subjects:
- kind: ServiceAccount
name: typesense-service-account
namespace: typesense