---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.2.8
  name: couchbasebuckets.couchbase.com
spec:
  group: couchbase.com
  names:
    kind: CouchbaseBucket
    listKind: CouchbaseBucketList
    plural: couchbasebuckets
    singular: couchbasebucket
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.memoryQuota
      name: memory quota
      type: string
    - jsonPath: .spec.replicas
      name: replicas
      type: integer
    - jsonPath: .spec.ioPriority
      name: io priority
      type: string
    - jsonPath: .spec.evictionPolicy
      name: eviction policy
      type: string
    - jsonPath: .spec.conflictResolution
      name: conflict resolution
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: age
      type: date
    name: v2
    schema:
      openAPIV3Schema:
        description: The CouchbaseBucket resource defines a set of documents in Couchbase server. A Couchbase client connects to and operates on a bucket, which provides independent management of a set documents and a security boundary for role based access control. A CouchbaseBucket provides replication and persistence for documents contained by it.
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            default: {}
            description: CouchbaseBucketSpec is the specification for a Couchbase bucket resource, and allows the bucket to be customized.
            properties:
              compressionMode:
                default: passive
                description: CompressionMode defines how Couchbase server handles document compression.  When off, documents are stored in memory, and transferred to the client uncompressed. When passive, documents are stored compressed in memory, and transferred to the client compressed when requested.  When active, documents are stored compresses in memory and when transferred to the client.  This field must be "off", "passive" or "active", defaulting to "passive".  Be aware "off" in YAML 1.2 is a boolean, so must be quoted as a string in configuration files.
                enum:
                - "off"
                - passive
                - active
                type: string
              conflictResolution:
                default: seqno
                description: ConflictResolution defines how XDCR handles concurrent write conflicts.  Sequence number based resolution selects the document with the highest sequence number as the most recent. Timestamp based resolution selects the document that was written to most recently as the most recent.  This field must be "seqno" (sequence based), or "lww" (timestamp based), defaulting to "seqno".
                enum:
                - seqno
                - lww
                type: string
              enableFlush:
                description: EnableFlush defines whether a client can delete all documents in a bucket. This field defaults to false.
                type: boolean
              enableIndexReplica:
                description: EnableIndexReplica defines whether indexes for this bucket are replicated. This field defaults to false.
                type: boolean
              evictionPolicy:
                default: valueOnly
                description: EvictionPolicy controls how Couchbase handles memory exhaustion.  Value only eviction flushes documents to disk but maintains document metadata in memory in order to improve query performance.  Full eviction removes all data from memory after the document is flushed to disk.  This field must be "valueOnly" or "fullEviction", defaulting to "valueOnly".
                enum:
                - valueOnly
                - fullEviction
                type: string
              ioPriority:
                default: low
                description: IOPriority controls how many threads a bucket has, per pod, to process reads and writes. This field must be "low" or "high", defaulting to "low".  Modification of this field will cause a temporary service disruption as threads are restarted.
                enum:
                - low
                - high
                type: string
              maxTTL:
                description: 'MaxTTL defines how long a document is permitted to exist for, without modification, until it is automatically deleted.  This is a default and maximum time-to-live and may be set to a lower value by the client.  If the client specifies a higher value, then it is truncated to the maximum durability.  Documents are removed by Couchbase, after they have expired, when either accessed, the expiry pager is run, or the bucket is compacted.  When set to 0, then documents are not expired by default.  This field must be a duration in the range 0-2147483648s, defaulting to 0.  More info: https://golang.org/pkg/time/#ParseDuration'
                type: string
              memoryQuota:
                anyOf:
                - type: integer
                - type: string
                default: 100Mi
                description: 'MemoryQuota is a memory limit to the size of a bucket.  When this limit is exceeded, documents will be evicted from memory to disk as defined by the eviction policy.  The memory quota is defined per Couchbase pod running the data service.  This field defaults to, and must be greater than or equal to 100Mi.  More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes'
                pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                type: string
                x-kubernetes-int-or-string: true
              minimumDurability:
                description: MiniumumDurability defines how durable a document write is by default, and can be made more durable by the client.  This feature enables ACID transactions. When none, Couchbase server will respond when the document is in memory, it will become eventually consistent across the cluster.  When majority, Couchbase server will respond when the document is replicated to at least half of the pods running the data service in the cluster.  When majorityAndPersistActive, Couchbase server will respond when the document is replicated to at least half of the pods running the data service in the cluster and the document has been persisted to disk on the document master pod.  When persistToMajority, Couchbase server will respond when the document is replicated and persisted to disk on at least half of the pods running the data service in the cluster.  This field must be either "none", "majority", "majorityAndPersistActive" or "persistToMajority", defaulting to "none".
                enum:
                - none
                - majority
                - majorityAndPersistActive
                - persistToMajority
                type: string
              name:
                description: Name is the name of the bucket within Couchbase server.  By default the Operator will use the `metadata.name` field to define the bucket name.  The `metadata.name` field only supports a subset of the supported character set.  When specified, this field overrides `metadata.name`.  Legal bucket names have a maximum length of 100 characters and may be composed of any character from "a-z", "A-Z", "0-9" and "-_%\.".
                maxLength: 100
                pattern: ^[a-zA-Z0-9-_%\.]+$
                type: string
              replicas:
                default: 1
                description: Replicas defines how many copies of documents Couchbase server maintains.  This directly affects how fault tolerant a Couchbase cluster is.  With a single replica, the cluster can tolerate one data pod going down and still service requests without data loss.  The number of replicas also affect memory use.  With a single replica, the effective memory quota for documents is halved, with two replicas it is one third.  The number of replicas must be between 0 and 3, defaulting to 1.
                maximum: 3
                minimum: 0
                type: integer
            type: object
        type: object
    served: true
    storage: true
