apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: logstorages.operator.tigera.io
spec:
  group: operator.tigera.io
  names:
    kind: LogStorage
    listKind: LogStorageList
    plural: logstorages
    singular: logstorage
  scope: Cluster
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: LogStorage installs the components required for Tigera flow and
          DNS log storage. At most one instance of this resource is supported. It
          must be named "tigera-secure". When created, this installs an Elasticsearch
          cluster for use by Calico Enterprise.
        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/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/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: Specification of the desired state for Tigera log storage.
            properties:
              dataNodeSelector:
                additionalProperties:
                  type: string
                description: DataNodeSelector gives you more control over the node
                  that Elasticsearch will run on. The contents of DataNodeSelector
                  will be added to the PodSpec of the Elasticsearch nodes. For the
                  pod to be eligible to run on a node, the node must have each of
                  the indicated key-value pairs as labels as well as access to the
                  specified StorageClassName.
                type: object
              indices:
                description: Index defines the configuration for the indices in the
                  Elasticsearch cluster.
                properties:
                  replicas:
                    description: Replicas defines how many replicas each index will
                      have. See https://www.elastic.co/guide/en/elasticsearch/reference/current/scalability.html
                    format: int32
                    type: integer
                type: object
              nodes:
                description: Nodes defines the configuration for a set of identical
                  Elasticsearch cluster nodes, each of type master, data, and ingest.
                properties:
                  count:
                    description: Count defines the number of nodes in the Elasticsearch
                      cluster.
                    format: int64
                    type: integer
                  nodeSets:
                    description: NodeSets defines configuration specific to each Elasticsearch
                      Node Set
                    items:
                      description: NodeSets defines configuration specific to each
                        Elasticsearch Node Set
                      properties:
                        selectionAttributes:
                          description: SelectionAttributes defines K8s node attributes
                            a NodeSet should use when setting the Node Affinity selectors
                            and Elasticsearch cluster awareness attributes for the
                            Elasticsearch nodes. The list of SelectionAttributes are
                            used to define Node Affinities and set the node awareness
                            configuration in the running Elasticsearch instance.
                          items:
                            description: NodeSetSelectionAttribute defines a K8s node
                              "attribute" the Elasticsearch nodes should be aware
                              of. The "Name" and "Value" are used together to set
                              the "awareness" attributes in Elasticsearch, while the
                              "NodeLabel" and "Value" are used together to define
                              Node Affinity for the Pods created for the Elasticsearch
                              nodes.
                            properties:
                              name:
                                type: string
                              nodeLabel:
                                type: string
                              value:
                                type: string
                            required:
                            - name
                            - nodeLabel
                            - value
                            type: object
                          type: array
                      type: object
                    type: array
                  resourceRequirements:
                    description: ResourceRequirements defines the resource limits
                      and requirements for the Elasticsearch cluster.
                    properties:
                      limits:
                        additionalProperties:
                          anyOf:
                          - type: integer
                          - type: string
                          pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                          x-kubernetes-int-or-string: true
                        description: 'Limits describes the maximum amount of compute
                          resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
                        type: object
                      requests:
                        additionalProperties:
                          anyOf:
                          - type: integer
                          - type: string
                          pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                          x-kubernetes-int-or-string: true
                        description: 'Requests describes the minimum amount of compute
                          resources required. If Requests is omitted for a container,
                          it defaults to Limits if that is explicitly specified, otherwise
                          to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
                        type: object
                    type: object
                type: object
              retention:
                description: Retention defines how long data is retained in the Elasticsearch
                  cluster before it is cleared.
                properties:
                  auditReports:
                    description: 'AuditReports configures the retention period for
                      audit logs, in days.  Logs written on a day that started at
                      least this long ago are removed.  To keep logs for at least
                      x days, use a retention period of x+1. Default: 91'
                    format: int32
                    type: integer
                  complianceReports:
                    description: 'ComplianceReports configures the retention period
                      for compliance reports, in days. Reports are output from the
                      analysis of the system state and audit events for compliance
                      reporting. Consult the Compliance Reporting documentation for
                      more details on reports. Logs written on a day that started
                      at least this long ago are removed.  To keep logs for at least
                      x days, use a retention period of x+1. Default: 91'
                    format: int32
                    type: integer
                  flows:
                    description: 'Flows configures the retention period for flow logs,
                      in days.  Logs written on a day that started at least this long
                      ago are removed.  To keep logs for at least x days, use a retention
                      period of x+1. Default: 8'
                    format: int32
                    type: integer
                  snapshots:
                    description: 'Snapshots configures the retention period for snapshots,
                      in days. Snapshots are periodic captures of resources which
                      along with audit events are used to generate reports. Consult
                      the Compliance Reporting documentation for more details on snapshots.
                      Logs written on a day that started at least this long ago are
                      removed.  To keep logs for at least x days, use a retention
                      period of x+1. Default: 91'
                    format: int32
                    type: integer
                type: object
              storageClassName:
                description: 'StorageClassName will populate the PersistentVolumeClaim.StorageClassName
                  that is used to provision disks to the Tigera Elasticsearch cluster.
                  The StorageClassName should only be modified when no LogStorage
                  is currently active. We recommend choosing a storage class dedicated
                  to Tigera LogStorage only. Otherwise, data retention cannot be guaranteed
                  during upgrades. See https://docs.tigera.io/maintenance/upgrading
                  for up-to-date instructions. Default: tigera-elasticsearch'
                type: string
            type: object
          status:
            description: Most recently observed state for Tigera log storage.
            properties:
              elasticsearchHash:
                description: ElasticsearchHash represents the current revision and
                  configuration of the installed Elasticsearch cluster. This is an
                  opaque string which can be monitored for changes to perform actions
                  when Elasticsearch is modified.
                type: string
              kibanaHash:
                description: KibanaHash represents the current revision and configuration
                  of the installed Kibana dashboard. This is an opaque string which
                  can be monitored for changes to perform actions when Kibana is modified.
                type: string
              state:
                description: State provides user-readable status.
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
