apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: typesense
spec:
  serviceName: "typesense"
  replicas: 3  
  selector:
    matchLabels:
      app: typesense
  template:
    metadata:
      labels:
        app: typesense
    spec:
      containers:
      - name: typesense
        image: typesense/typesense:27.0  
        ports:
        - containerPort: 8108
        volumeMounts:
        - name: typesense-storage
          mountPath: /data 
        env:
        - name: TYPESENSE_DATA_DIR 
          value: /data  
        - name: TYPESENSE_API_KEY 
          value: typesense 
  volumeClaimTemplates: 
  - metadata:
      name: typesense-storage
    spec:
      accessModes: 
        - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi  
