Created
May 29, 2021 13:40
-
-
Save prabhatsharma/8b7bb470eff013638113ced95b540059 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: os | |
namespace: typesense | |
spec: | |
clusterIP: None | |
selector: | |
app: typesense | |
ports: | |
- name: http | |
port: 8108 | |
targetPort: 8108 | |
--- | |
apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
name: typesense | |
namespace: typesense | |
labels: | |
service: typesense | |
app: typesense | |
spec: | |
serviceName: os | |
# NOTE: This is number of nodes that we want to run | |
# you may update this | |
replicas: 1 | |
selector: | |
matchLabels: | |
service: typesense | |
app: typesense | |
template: | |
metadata: | |
labels: | |
service: typesense | |
app: typesense | |
spec: | |
terminationGracePeriodSeconds: 300 | |
initContainers: | |
# NOTE: | |
# This is to fix the permission on the volume | |
- name: fix-the-volume-permission | |
image: busybox | |
command: | |
- sh | |
- -c | |
- chown -R 1000:1000 /usr/share/typesense/data | |
securityContext: | |
privileged: true | |
volumeMounts: | |
- name: data | |
mountPath: /usr/share/typesense/data | |
containers: | |
- name: typesense | |
image: typesense/typesense:0.20.0 | |
command: | |
- "/opt/typesense-server" | |
- "-d" | |
- "/usr/share/typesense/data" | |
- "-a" | |
- "APIKey" | |
- "--api-port" | |
- "8108" | |
- "--api-address" | |
- "0.0.0.0" | |
ports: | |
- containerPort: 8108 | |
name: http | |
# NOTE: you can increase this resources | |
resources: | |
requests: | |
memory: 100Mi | |
cpu: "64m" | |
limits: | |
memory: 250Mi | |
volumeMounts: | |
- name: data | |
mountPath: /usr/share/typesense/data | |
volumeClaimTemplates: | |
- metadata: | |
name: data | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
storageClassName: ebs-sc | |
# NOTE: You can increase the storage size | |
resources: | |
requests: | |
storage: 10Gi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment