Enhance K8s Metadata 🔗︎

Overview 🔗︎

Fluentd Filter plugin to fetch several metadata for a Pod

Configuration 🔗︎

EnhanceK8s 🔗︎

Variable Name Type Required Default Description
in_namespace_path []string No [‘$.namespace’] parameters for read/write record
in_pod_path []string No [‘$.pod’,‘$.pod_name’]
data_type string No metrics Sumologic data type
kubernetes_url string No nil Kubernetes API URL
client_cert secret.Secret No nil Kubernetes API Client certificate
client_key secret.Secret No nil // Kubernetes API Client certificate key
ca_file secret.Secret No nil Kubernetes API CA file
secret_dir string No /var/run/secrets/kubernetes.io/serviceaccount Service account directory
bearer_token_file string No nil Bearer token path
verify_ssl *bool No true Verify SSL
core_api_versions []string No [‘v1’] Kubernetes core API version (for different Kubernetes versions)
api_groups []string No [“apps/v1”, “extensions/v1beta1”] Kubernetes resources api groups
ssl_partial_chain *bool No false 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
cache_size int No 1000 Cache size
cache_ttl int No 60602 Cache TTL
cache_refresh int No 60*60 Cache refresh
cache_refresh_variation int No 60*15 Cache refresh variation

Example EnhanceK8s filter configurations 🔗︎

apiVersion: logging.banzaicloud.io/v1beta1
kind: Flow
metadata:
 name: demo-flow
spec:
 filters:
   - enhanceK8s: {]
 selectors: {}
 localOutputRefs:
   - demo-output

Fluentd Config Result 🔗︎

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