Enhance K8s Metadata

Enhance K8s Metadata

Overview

Fluentd Filter plugin to fetch several metadata for a Pod

Configuration

EnhanceK8s

in_namespace_path ([]string, optional)

parameters for read/write record

Default: [’$.namespace']

in_pod_path ([]string, optional)

Default: [’$.pod’,’$.pod_name']

data_type (string, optional)

Sumologic data type

Default: metrics

kubernetes_url (string, optional)

Kubernetes API URL

Default: nil

client_cert (secret.Secret, optional)

Kubernetes API Client certificate

Default: nil

client_key (secret.Secret, optional)

// Kubernetes API Client certificate key

Default: nil

ca_file (secret.Secret, optional)

Kubernetes API CA file

Default: nil

secret_dir (string, optional)

Service account directory

Default: /var/run/secrets/kubernetes.io/serviceaccount

bearer_token_file (string, optional)

Bearer token path

Default: nil

verify_ssl (*bool, optional)

Verify SSL

Default: true

core_api_versions ([]string, optional)

Kubernetes core API version (for different Kubernetes versions)

Default: [‘v1’]

api_groups ([]string, optional)

Kubernetes resources api groups

Default: [“apps/v1”, “extensions/v1beta1”]

ssl_partial_chain (*bool, optional)

if ca_file is for an intermediate CA, or otherwise we do not have the root CA and want to trust the intermediate CA certs we do have, set this to true - this corresponds to the openssl s_client -partial_chain flag and X509_V_FLAG_PARTIAL_CHAIN

Default: false

cache_size (int, optional)

Cache size

Default: 1000

cache_ttl (int, optional)

Cache TTL

Default: 60602

cache_refresh (int, optional)

Cache refresh

Default: 60*60

cache_refresh_variation (int, optional)

Cache refresh variation

Default: 60*15

Example EnhanceK8s filter configurations

apiVersion: logging.banzaicloud.io/v1beta1
kind: Logging
metadata:
  name: demo-flow
spec:
  globalFilters:
    - enhanceK8s: {}

Fluentd config result:

<filter **>
  @type enhance_k8s_metadata
  @id test_enhanceK8s
</filter>

Last modified December 27, 2023: Version number bumps (00b4afd)