Skip to content

Instantly share code, notes, and snippets.

@busyboy77
Forked from janeczku/clusterflow-archive.yaml
Created January 15, 2024 09:31
Show Gist options
  • Select an option

  • Save busyboy77/cc4d718985dceac6c91d0cbfadfa7d20 to your computer and use it in GitHub Desktop.

Select an option

Save busyboy77/cc4d718985dceac6c91d0cbfadfa7d20 to your computer and use it in GitHub Desktop.

Revisions

  1. @janeczku janeczku revised this gist Nov 2, 2020. 2 changed files with 55 additions and 0 deletions.
    File renamed without changes.
    55 changes: 55 additions & 0 deletions clusteroutput-s3.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    apiVersion: logging.banzaicloud.io/v1beta1
    kind: Output
    metadata:
    name: cluster-output-s3
    namespace: cattle-logging-system
    spec:
    s3:
    aws_key_id:
    valueFrom:
    secretKeyRef:
    name: s3-write-logs
    key: awsAccessKeyId
    aws_sec_key:
    valueFrom:
    secretKeyRef:
    name: s3-write-logs
    key: awsSecretAccessKey
    s3_bucket: log-archive-cluster-foo
    s3_region: eu-central-1
    path: logs/${tag}/%Y/%m/%d/
    buffer:
    timekey: 10m
    timekey_wait: 30s
    timekey_use_utc: true





    s3_bucket "${s3_bucket}"
    s3_region "${s3_region}"

    path "${s3_prefix}%Y/%m/%d/%H/$${tag}/"
    s3_object_key_format "%%{path}%%{time_slice}_%%{hex_random}_%%{index}_$${chunk_id}.%%{file_extension}"
    storage_class "${storage_class}"

    auto_create_bucket false
    check_bucket true

    <buffer tag,time>
    @type file

    path /td-agent/buffer/s3-buffer

    timekey 3600
    timekey_wait 10m
    timekey_use_utc true

    flush_at_shutdown true
    flush_thread_count 8
    retry_forever true
    retry_max_interval 128s
    </buffer>
    </store>
    %{ endif }
  2. @janeczku janeczku revised this gist Nov 2, 2020. 1 changed file with 13 additions and 2 deletions.
    15 changes: 13 additions & 2 deletions cluster-logging.yaml
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,17 @@ spec:
    port: 443
    scheme: https
    ssl_verify: false
    user: username
    password:
    valueFrom:
    secretKeyRef:
    name: es-log-writer
    key: token
    ca_file:
    valueFrom:
    secretKeyRef:
    name: es-log-writer
    key: ca.pem
    logstash_format: true
    logstash_prefix: k8s-cluster-foo
    logstash_dateformat: YYYY-MM-DD
    @@ -21,14 +32,14 @@ spec:
    buffer:
    type: file
    chunk_limit_size: 4M # Determines HTTP payload size
    total_limit_size: 256MB # Max total buffer size
    total_limit_size: 1024MB # Max total buffer size
    flush_mode: interval
    flush_interval: 10s
    flush_thread_count: 2 # Parallel send of logs
    overflow_action: block
    retry_forever: true # Never discard buffer chunks
    retry_type: exponential_backoff
    retry_max_interval: 60
    retry_max_interval: 60s
    ---
    apiVersion: logging.banzaicloud.io/v1beta1
    kind: ClusterFlow
  3. @janeczku janeczku renamed this gist Oct 29, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion clusterflow-catchall.yaml → clusterflow-archive.yaml
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    apiVersion: logging.banzaicloud.io/v1beta1
    kind: ClusterFlow
    metadata:
    name: catchall
    name: archive
    spec:
    match:
    - select: {}
  4. @janeczku janeczku revised this gist Oct 29, 2020. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions clusterflow-catchall.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    apiVersion: logging.banzaicloud.io/v1beta1
    kind: ClusterFlow
    metadata:
    name: catchall
    spec:
    match:
    - select: {}
    outputRefs:
    - s3
  5. @janeczku janeczku revised this gist Oct 29, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions cluster-logging.yaml
    Original file line number Diff line number Diff line change
    @@ -20,13 +20,13 @@ spec:
    reload_on_failure: true
    buffer:
    type: file
    chunk_limit_size: 4M
    queue_limit_length: 32
    chunk_limit_size: 4M # Determines HTTP payload size
    total_limit_size: 256MB # Max total buffer size
    flush_mode: interval
    flush_interval: 10s
    flush_thread_count: 2
    flush_thread_count: 2 # Parallel send of logs
    overflow_action: block
    retry_forever: true
    retry_forever: true # Never discard buffer chunks
    retry_type: exponential_backoff
    retry_max_interval: 60
    ---
  6. @janeczku janeczku revised this gist Oct 26, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions cluster-logging.yaml
    Original file line number Diff line number Diff line change
    @@ -15,9 +15,9 @@ spec:
    logstash_prefix: k8s-cluster-foo
    logstash_dateformat: YYYY-MM-DD
    include_tag_key: true
    reload_connections false
    reconnect_on_error true
    reload_on_failure true
    reload_connections: false
    reconnect_on_error: true
    reload_on_failure: true
    buffer:
    type: file
    chunk_limit_size: 4M
  7. @janeczku janeczku created this gist Oct 26, 2020.
    45 changes: 45 additions & 0 deletions cluster-logging.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    apiVersion: logging.banzaicloud.io/v1beta1
    kind: ClusterOutput
    metadata:
    name: cluster-output-es
    namespace: cattle-logging-system
    labels:
    someLabel: foo
    spec:
    elasticsearch:
    host: elasticsearch-elasticsearch-cluster.default.svc.cluster.local
    port: 443
    scheme: https
    ssl_verify: false
    logstash_format: true
    logstash_prefix: k8s-cluster-foo
    logstash_dateformat: YYYY-MM-DD
    include_tag_key: true
    reload_connections false
    reconnect_on_error true
    reload_on_failure true
    buffer:
    type: file
    chunk_limit_size: 4M
    queue_limit_length: 32
    flush_mode: interval
    flush_interval: 10s
    flush_thread_count: 2
    overflow_action: block
    retry_forever: true
    retry_type: exponential_backoff
    retry_max_interval: 60
    ---
    apiVersion: logging.banzaicloud.io/v1beta1
    kind: ClusterFlow
    metadata:
    name: log-all-elastic
    namespace: cattle-logging-system
    labels:
    someLabel: foo
    spec:
    filters:
    - tag_normaliser: {}
    selectors: {}
    globalOutputRefs:
    - cluster-output-es