CouchbaseEphemeralBucket Resource

The Couchbase Autonomous Operator operates on CouchbaseCluster objects. Buckets are decoupled from this configuration and are selected for inclusion within a cluster with configurable label selectors.

CouchbaseEphemeralBucket resources provide highly available data. They are used for caching and in-memory only database operations. They may be used for cross data center replication (XDCR).

The following YAML shows all possible fields that may be configured for a CouchbaseEphemeralBucket. This configuration may not be valid and is only for illustrative purposes.

All available CouchbaseEphemeralBucket configuration parameters
apiVersion: couchbase.com/v2
kind: CouchbaseEphemeralBucket
metadata:
  name: my-bucket
  labels:
    cluster: my-cluster
spec:
  memoryQuota: 100Mi
  replicas: 2
  ioPriority: low
  evictionPolicy: noEviction
  conflictResolution: lww
  enableFlush: false
  compressionMode: passive

Top-Level Definitions

The following are relevant generic parameters that can be defined:

apiVersion: couchbase.com/v2
kind: CouchbaseEphemeralBucket
metadata:
  name: my-bucket
  labels:
    cluster: my-cluster

apiVersion

The apiVersion defines which version of the resource this configuration refers to.

Field rules: This field is required and must be set to couchbase.com/v2

kind

The kind defines the type of resource this configuration refers to.

Field rules: This field is required and must be set to CouchbaseEphemeralBucket

metadata.name

The metadata name defines the name of the resource. The name must be unique for the kind defined. Furthermore the name must be unique for all bucket kinds defined and used by the cluster. For example you cannot have a CouchbaseEphemeralBucket named "default" and a CouchbaseBucket also named "default".

Field rules: This field is required and must be unique as described above.

metadata.labels

The metadata labels allow the resource to be tagged so that it is only selected by specific CouchbaseCluster resources. Further details about resource selection can be found on the Couchbase Resources and RBAC page.

Field rules: This field is optional and must be a map of string key/value pairs.

spec

The following are parameters that may be set on the bucket:

spec:
  memoryQuota: 100Mi
  replicas: 2
  ioPriority: low
  evictionPolicy: noEviction
  conflictResolution: lww
  enableFlush: false
  compressionMode: passive

spec.memoryQuota

This field specifies the amount of memory to allocate to this bucket per-node. It is deducted from the per-node spec.cluster.dataServiceMemoryQuota parameter in a related CouchbaseCluster resource. The total quota allocated for all buckets must not exceed the spec.cluster.dataServiceMemoryQuota parameter in a related CouchbaseCluster resource. The minimum size is 100Mi. If not specified this field will default to 100Mi.

Field rules: This field is optional and must be a Kubernetes resource quantity greater than or equal to 100Mi.

spec.replicas

This field specifies the number of replicas that should be created for this bucket. This value may be set between 0 and 3 inclusive. If not specified this field will default to 1. Modification of this field will cause data to rebalanced across the cluster.

Field rules: This field is optional and must be an integer between 0 and 3.

spec.ioPriority

This field sets the IO priority of background threads for this bucket. If not specified this field will default to low.

Field rules: This field is optional and must be either low or high.

spec.evictionPolicy

This field sets the in-memory cache eviction policy for this bucket. Ephemeral buckets support either noEviction or nruEviction.

Specifying noEviction means that the bucket will not evict items from the cache if the cache is full. This type of eviction policy should be used for in-memory database use cases.

Specifying nruEviction means that items not recently used will be evicted from memory when all the memory in the bucket is used. This type of eviction policy should be used for caching use cases.

Field rules: This field is optional and must be either noEviction or nruEviction.

spec.conflictResolution

This field specifies the bucket’s conflict resolution mechanism which is to be used if a conflict occurs during cross data center replication (XDCR). There are two supported mechanisms: sequence-based and timestamp-based.

The sequence-based conflict resolution mechanism — seqno — selects the document that has been updated the greatest number of times since the last sync. For example, if one cluster has updated a document twice since the last sync, and the other cluster has updated the document three times, the document updated three times is selected regardless of the specific times at which these updates took place.

The timestamp-based conflict resolution mechanism — lww — selects the document with the most recent timestamp. This is only supported when all of the clocks on all of the nodes are fully synchronized.

If not specified this field will default to seqno

Field rules: This field is optional and must be either seqno or lww.

spec.enableFlush

This field specifies whether or not to enable the flush command on this bucket. This parameter defaults to false if it is not specified.

Field rules: This field is optional and must be a boolean.

spec.compressionMode

This field sets the compression mode for the specified bucket. This parameter defaults to passive if not specified.

Field rules: This field is optional and must be either off, passive or active.