Skip to content

Commit c3cc428

Browse files
authored
Merge pull request #1696 from kube-logging/fluentbit-namespace-labels
feat: kubernetes namespace labels and annotations with fluent-bit 3.0
2 parents 5152000 + 1f76e91 commit c3cc428

File tree

8 files changed

+69
-0
lines changed

8 files changed

+69
-0
lines changed

charts/logging-operator/crds/logging.banzaicloud.io_fluentbitagents.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,12 @@ spec:
10871087
type: string
10881088
Use_Kubelet:
10891089
type: string
1090+
kube_meta_namespace_cache_ttl:
1091+
type: string
1092+
namespace_annotations:
1093+
type: string
1094+
namespace_labels:
1095+
type: string
10901096
tls.debug:
10911097
type: string
10921098
tls.verify:

charts/logging-operator/crds/logging.banzaicloud.io_loggings.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,6 +2104,12 @@ spec:
21042104
type: string
21052105
Use_Kubelet:
21062106
type: string
2107+
kube_meta_namespace_cache_ttl:
2108+
type: string
2109+
namespace_annotations:
2110+
type: string
2111+
namespace_labels:
2112+
type: string
21072113
tls.debug:
21082114
type: string
21092115
tls.verify:
@@ -10778,6 +10784,12 @@ spec:
1077810784
type: string
1077910785
Use_Kubelet:
1078010786
type: string
10787+
kube_meta_namespace_cache_ttl:
10788+
type: string
10789+
namespace_annotations:
10790+
type: string
10791+
namespace_labels:
10792+
type: string
1078110793
tls.debug:
1078210794
type: string
1078310795
tls.verify:

charts/logging-operator/crds/logging.banzaicloud.io_nodeagents.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,6 +3644,12 @@ spec:
36443644
type: string
36453645
Use_Kubelet:
36463646
type: string
3647+
kube_meta_namespace_cache_ttl:
3648+
type: string
3649+
namespace_annotations:
3650+
type: string
3651+
namespace_labels:
3652+
type: string
36473653
tls.debug:
36483654
type: string
36493655
tls.verify:

config/crd/bases/logging.banzaicloud.io_fluentbitagents.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,12 @@ spec:
10871087
type: string
10881088
Use_Kubelet:
10891089
type: string
1090+
kube_meta_namespace_cache_ttl:
1091+
type: string
1092+
namespace_annotations:
1093+
type: string
1094+
namespace_labels:
1095+
type: string
10901096
tls.debug:
10911097
type: string
10921098
tls.verify:

config/crd/bases/logging.banzaicloud.io_loggings.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2104,6 +2104,12 @@ spec:
21042104
type: string
21052105
Use_Kubelet:
21062106
type: string
2107+
kube_meta_namespace_cache_ttl:
2108+
type: string
2109+
namespace_annotations:
2110+
type: string
2111+
namespace_labels:
2112+
type: string
21072113
tls.debug:
21082114
type: string
21092115
tls.verify:
@@ -10778,6 +10784,12 @@ spec:
1077810784
type: string
1077910785
Use_Kubelet:
1078010786
type: string
10787+
kube_meta_namespace_cache_ttl:
10788+
type: string
10789+
namespace_annotations:
10790+
type: string
10791+
namespace_labels:
10792+
type: string
1078110793
tls.debug:
1078210794
type: string
1078310795
tls.verify:

config/crd/bases/logging.banzaicloud.io_nodeagents.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3644,6 +3644,12 @@ spec:
36443644
type: string
36453645
Use_Kubelet:
36463646
type: string
3647+
kube_meta_namespace_cache_ttl:
3648+
type: string
3649+
namespace_annotations:
3650+
type: string
3651+
namespace_labels:
3652+
type: string
36473653
tls.debug:
36483654
type: string
36493655
tls.verify:

docs/configuration/crds/v1beta1/fluentbit_types.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,21 @@ Default: On
698698
Optional parser name to specify how to parse the data contained in the log key. Recommended use is for developers or testing only.
699699

700700

701+
### namespace_annotations (string, optional) {#filterkubernetes-namespace_annotations}
702+
703+
Include Kubernetes namespace annotations on every record
704+
705+
706+
### kube_meta_namespace_cache_ttl (string, optional) {#filterkubernetes-kube_meta_namespace_cache_ttl}
707+
708+
Configurable TTL for K8s cached namespace metadata. (15m)
709+
710+
711+
### namespace_labels (string, optional) {#filterkubernetes-namespace_labels}
712+
713+
Include Kubernetes namespace labels on every record
714+
715+
701716
### Regex_Parser (string, optional) {#filterkubernetes-regex_parser}
702717

703718
Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id. The parser must be registered in a parsers file (refer to parser filter-kube-test as an example).

pkg/sdk/logging/api/v1beta1/fluentbit_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,12 @@ type FilterKubernetes struct {
328328
Labels string `json:"Labels,omitempty"`
329329
// Include Kubernetes resource annotations in the extra metadata. (default:On)
330330
Annotations string `json:"Annotations,omitempty"`
331+
// Include Kubernetes namespace labels on every record
332+
NamespaceLabels string `json:"namespace_labels,omitempty"`
333+
// Include Kubernetes namespace annotations on every record
334+
NamespaceAnnotations string `json:"namespace_annotations,omitempty"`
335+
// Configurable TTL for K8s cached namespace metadata. (15m)
336+
NamespaceCacheTTL string `json:"kube_meta_namespace_cache_ttl,omitempty"`
331337
// If set, Kubernetes meta-data can be cached/pre-loaded from files in JSON format in this directory, named as namespace-pod.meta
332338
KubeMetaPreloadCacheDir string `json:"Kube_meta_preload_cache_dir,omitempty"`
333339
// If set, use dummy-meta data (for test/dev purposes) (default:Off)

0 commit comments

Comments
 (0)