forked from akyriako/typesense-peer-resolver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
typesense.yml
145 lines (144 loc) · 4.09 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
apiVersion: v1
kind: ServiceAccount
metadata:
name: typesense-service-account
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: typesense-role
labels:
app.kubernetes.io/name: typesense
rules:
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: typesense-role-binding
labels:
app.kubernetes.io/name: typesense
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: typesense-role
subjects:
- kind: ServiceAccount
name: typesense-service-account
---
apiVersion: v1
kind: ConfigMap
metadata:
name: typesense-nodeslist
data:
nodes: typesense-ts-0.typesense-svc.typesense.svc.cluster.local:8107:8108,typesense-ts-1.typesense-svc.typesense.svc.cluster.local:8107:8108,typesense-ts-2.typesense-svc.typesense.svc.cluster.local:8107:8108
---
apiVersion: v1
kind: Secret
metadata:
name: typesense-api-keys
data:
typesense-api-key: 123
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: typesense-ts
labels:
app: typesense
spec:
serviceName: typesense-svc
podManagementPolicy: Parallel
replicas: 3
selector:
matchLabels:
app: typesense
template:
metadata:
labels:
app: typesense
spec:
containers:
- name: typesense
image: typesense/typesense:26.0
env:
- name: TYPESENSE_API_KEY
valueFrom:
secretKeyRef:
key: typesense-api-key
name: typesense-api-keys
- name: TYPESENSE_NODES
value: "/usr/share/typesense/nodes"
- name: TYPESENSE_DATA_DIR
value: "/usr/share/typesense/data"
- name: TYPESENSE_API_PORT
value: "8108"
- name: TYPESENSE_PEERING_PORT
value: "8107"
- name: TYPESENSE_ENABLE_CORS
value: "true"
- name: TYPESENSE_CORS_DOMAINS
value: "http://{{ .Values.docusaurus.host }},https://{{ .Values.docusaurus.host }},https://{{ .Values.typesenseReverseProxy.host }},http://{{ .Values.typesenseReverseProxy.host }}"
- name: TYPESENSE_RESET_PEERS_ON_ERROR
value: "true"
ports:
- containerPort: 8108
name: http
resources:
limits:
cpu: 1024m
memory: 512Mi
requests:
cpu: 128m
memory: 112Mi
volumeMounts:
- mountPath: /usr/share/typesense
name: nodeslist
- mountPath: /usr/share/typesense/data
name: data
- name: peer-resolver
image: akyriako78/typesense-peer-resolver:v0.1.0-dev.2
command:
- "/opt/tspr"
- "-namespace=typesense"
- "-service=typesense-svc"
volumeMounts:
- name: nodeslist
mountPath: /usr/share/typesense
serviceAccountName: typesense-service-account
securityContext:
fsGroup: 2000
runAsGroup: 3000
runAsNonRoot: true
runAsUser: 10000
terminationGracePeriodSeconds: 300
volumes:
- name: nodeslist
emptyDir: {}
updateStrategy: {}
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: csi-disk
---
apiVersion: v1
kind: Service
metadata:
name: typesense-svc
spec:
clusterIP: None
publishNotReadyAddresses: true
selector:
app: typesense
ports:
- name: http
port: 8108
targetPort: 8108