Enhance K8s Metadata

Enhance K8s Metadata

Fluentd Filter plugin to fetch several metadata for a Pod

Configuration

EnhanceK8s

api_groups ([]string, optional)

Kubernetes resources api groups

Default: ["apps/v1", "extensions/v1beta1"]

bearer_token_file (string, optional)

Bearer token path

Default: nil

ca_file (secret.Secret, optional)

Kubernetes API CA file

Default: nil

cache_refresh (int, optional)

Cache refresh

Default: 60*60

cache_refresh_variation (int, optional)

Cache refresh variation

Default: 60*15

cache_size (int, optional)

Cache size

Default: 1000

cache_ttl (int, optional)

Cache TTL

Default: 60602

client_cert (secret.Secret, optional)

Kubernetes API Client certificate

Default: nil

client_key (secret.Secret, optional)

Kubernetes API Client certificate key

Default: nil

core_api_versions ([]string, optional)

Kubernetes core API version (for different Kubernetes versions)

Default: [‘v1’]

data_type (string, optional)

Sumo Logic data type

Default: metrics

in_namespace_path ([]string, optional)

parameters for read/write record

Default: ['$.namespace']

in_pod_path ([]string, optional)

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

kubernetes_url (string, optional)

Kubernetes API URL

Default: nil

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

secret_dir (string, optional)

Service account directory

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

verify_ssl (*bool, optional)

Verify SSL

Default: true

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 June 3, 2024: [4.6] Blog link fix (cc4602a)