apiVersion: logging.openshift.io/v1
kind: ClusterLogForwarder
metadata:
  name: my-cluster-log-forwarder
  namespace: my-namespace
  labels:
    app: my-log-forwarder
spec:
  tuning:
    # Tuning parameters for the output. Specifying these parameters will alter the characteristics of log forwarder which may be different from its behavior without the tuning.
    properties:
      delivery:
        # Delivery mode for log forwarding.
        # - AtLeastOnce (default): if the forwarder crashes or is re-started, any logs that were read before the crash but not sent to their destination will be re-read and re-sent. Note it is possible that some logs are duplicated in the event of a crash - log records are delivered at-least-once.
        # - AtMostOnce: The forwarder makes no effort to recover logs lost during a crash. This mode may give better throughput, but could result in more log loss.
        enum:
          - AtLeastOnce  # Guaranteed delivery, but may result in duplicate logs after a crash
          - AtMostOnce  # Best throughput, but logs may be lost after a crash
        type: string
      compression:
        # Compression causes data to be compressed before sending over the network. It is an error if the compression type is not supported by the output.
        enum:
          - ''  # No compression
          - gzip  # Gzip compression
          - none  # No compression
          - snappy  # Snappy compression
          - zlib  # Zlib compression
          - zstd  # Zstandard compression
        type: string
      maxWrite:
        # MaxWrite limits the maximum payload in terms of bytes of a single "send" to the output.
        description: "Limits the maximum payload size of a single 'send' to the output."
        type: integer
      minRetryDuration:
        # MinRetryDuration is the minimum time to wait between attempts to retry after delivery a failure.
        description: "The minimum time to wait between retry attempts after a delivery failure."
        type: integer
      maxRetryDuration:
        # MaxRetryDuration is the maximum time to wait between retry attempts after a delivery failure.
        description: "The maximum time to wait between retry attempts after a delivery failure."
        type: integer
    # The type field indicates the data type of the object described within the "tuning" section. In this case, "type: object" specifies that the "tuning" section is an object, meaning it can contain multiple key-value pairs of properties.
    type: object
