# ====================================
# ======== Cluster Definition ========
# ====================================
apiVersion: couchbase.com/v2
kind: CouchbaseCluster
metadata:
  name: cb-example
spec:
  antiAffinity: true
  image: couchbase/server:7.2.5
  upgradeProcess: DeltaRecovery
  security:
    adminSecret: cb-example-auth
  buckets:
    managed: true
  cluster:
    autoFailoverTimeout: 5s
    dataServiceMemoryQuota: 6Gi
    indexServiceMemoryQuota: 5Gi
    indexer:
      storageMode: plasma
  serverGroups:
    - us-east-2a
    - us-east-2b
    - us-east-2c
  servers:
    - size: 6
      name: data-only
      serverGroups:
        - us-east-2a
        - us-east-2b
        - us-east-2c
      services:
        - data
      volumeMounts:
        default: couchbase
        data: couchbase
      pod:
        spec:
          nodeSelector:
            couchbase-node: "true"
    - size: 4
      name: index-query
      serverGroups:
        - us-east-2a
        - us-east-2b
        - us-east-2c
      services:
        - index
        - query
      volumeMounts:
        default: couchbase
        index: couchbase
      pod:
        spec:
          nodeSelector:
            couchbase-node: "true"
    - size: 4
      name: analytics
      serverGroups:
        - us-east-2a
        - us-east-2b
        - us-east-2c
      services:
        - analytics
      volumeMounts:
        default: couchbase
        analytics:
        - couchbase
      pod:
        spec:
          nodeSelector:
            couchbase-node: "true"
    - size: 4
      name: eventing
      serverGroups:
        - us-east-2a
        - us-east-2b
        - us-east-2c
      services:
        - eventing
      volumeMounts:
        default: couchbase
      pod:
        spec:
          nodeSelector:
            couchbase-node: "true"
  securityContext:
    fsGroup: 1000
  volumeClaimTemplates:
    - metadata:
        name: couchbase
      spec:
        resources:
          requests:
            storage: 80Gi
