apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: couchbase
spec:
  serviceName: "couchbase"
  replicas: 2
  selector:
    matchLabels:
      app: couchbase
  template:
    metadata:
      labels:
        app: couchbase
    spec:
      terminationGracePeriodSeconds: 0
      containers:
      - name: couchbase
        image: saturnism/couchbase:k8s-petset
        ports:
        - containerPort: 8091
        volumeMounts:
        - name: couchbase-data
          mountPath: /opt/couchbase/var
        env:
          - name: COUCHBASE_MASTER
            value: "couchbase-0.couchbase.default.svc.cluster.local"
          - name: AUTO_REBALANCE
            value: "false"
  volumeClaimTemplates:
  - metadata:
      name: couchbase-data
      annotations:
        volume.beta.kubernetes.io/storage-class: openebs-jiva-default
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 5G
