Last active
August 8, 2024 02:36
-
-
Save prabhatsharma/c128fa54183be8e26915f48a164a436b 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
# Not working as typsense does not resilve DNS names inc luster mode. Just IP addresses | |
# refer to https://github.com/typesense/typesense/issues/203 | |
--- | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: typesense | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: os | |
namespace: typesense | |
spec: | |
clusterIP: None | |
selector: | |
app: typesense | |
ports: | |
- name: http | |
port: 8108 | |
targetPort: 8108 | |
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: nodeslist | |
namespace: typesense | |
data: | |
nodes: "typesense-0.os.typesense.svc.cluster.local:8107:8108,typesense-1.os.typesense.svc.cluster.local:8107:8108,typesense-2.os.typesense.svc.cluster.local:8107:8108" | |
--- | |
apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
name: typesense | |
namespace: typesense | |
labels: | |
service: typesense | |
app: typesense | |
spec: | |
serviceName: os | |
podManagementPolicy: Parallel | |
# NOTE: This is number of nodes that we want to run | |
# you may update this | |
replicas: 3 | |
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.21.0.rc-k8s-2 | |
command: | |
- "/opt/typesense-server" | |
- "-d" | |
- "/usr/share/typesense/data" | |
- "-a" | |
- "243324234" | |
- "--api-port" | |
- "8108" | |
- "--peering-port" | |
- "8107" | |
- "--nodes" | |
- "/usr/share/typesense/nodes" | |
ports: | |
- containerPort: 8108 | |
name: http | |
# NOTE: you can increase these resources | |
resources: | |
requests: | |
memory: 100Mi | |
cpu: "64m" | |
limits: | |
memory: 250Mi | |
volumeMounts: | |
- name: nodeslist | |
mountPath: /usr/share/typesense | |
- name: data | |
mountPath: /usr/share/typesense/data | |
volumes: | |
- name: nodeslist | |
configMap: | |
name: nodeslist | |
items: | |
- key: nodes | |
path: nodes | |
volumeClaimTemplates: | |
- metadata: | |
name: data | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
# 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
Thanks for this yaml. It works perfect!!!