Skip to content

Commit 2d312a1

Browse files
committed
Added the ability to set Use_Tag_For_Meta on fluentbit kubernetes filter
Signed-off-by: Fred Heinecke <[email protected]>
1 parent 087a7da commit 2d312a1

File tree

7 files changed

+45
-0
lines changed

7 files changed

+45
-0
lines changed

apis/fluentbit/v1alpha2/plugins/filter/kubernetes_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ type Kubernetes struct {
103103
// Include Kubernetes namespace metadata only and no pod metadata.
104104
// If this is set, the values of Labels and Annotations are ignored.
105105
NamespaceMetadataOnly *bool `json:"namespaceMetadataOnly,omitempty"`
106+
// If true, Kubernetes metadata (e.g., pod_name, container_name, namespace_name etc) will be extracted from the tag itself.
107+
UseTagForMeta *bool `json:"useTagForMeta,omitempty"`
106108
}
107109

108110
func (_ *Kubernetes) Name() string {
@@ -217,6 +219,9 @@ func (k *Kubernetes) Params(_ plugins.SecretLoader) (*params.KVs, error) {
217219
if k.NamespaceMetadataOnly != nil {
218220
kvs.Insert("Namespace_Metadata_Only", fmt.Sprint(*k.NamespaceMetadataOnly))
219221
}
222+
if k.UseTagForMeta != nil {
223+
kvs.Insert("Use_Tag_For_Meta", fmt.Sprint(*k.UseTagForMeta))
224+
}
220225
return kvs, nil
221226
}
222227

charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterfilters.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ spec:
313313
instead of calling Kube Server API to enhance the log.
314314
This could mitigate the Kube API heavy traffic issue for large cluster.
315315
type: boolean
316+
useTagForMeta:
317+
description: If true, Kubernetes metadata (e.g., pod_name,
318+
container_name, namespace_name etc) will be extracted
319+
from the tag itself.
320+
type: boolean
316321
type: object
317322
logToMetrics:
318323
description: LogToMetrics defines a Log to Metrics Filter configuration.

charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_filters.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ spec:
313313
instead of calling Kube Server API to enhance the log.
314314
This could mitigate the Kube API heavy traffic issue for large cluster.
315315
type: boolean
316+
useTagForMeta:
317+
description: If true, Kubernetes metadata (e.g., pod_name,
318+
container_name, namespace_name etc) will be extracted
319+
from the tag itself.
320+
type: boolean
316321
type: object
317322
logToMetrics:
318323
description: LogToMetrics defines a Log to Metrics Filter configuration.

config/crd/bases/fluentbit.fluent.io_clusterfilters.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ spec:
313313
instead of calling Kube Server API to enhance the log.
314314
This could mitigate the Kube API heavy traffic issue for large cluster.
315315
type: boolean
316+
useTagForMeta:
317+
description: If true, Kubernetes metadata (e.g., pod_name,
318+
container_name, namespace_name etc) will be extracted
319+
from the tag itself.
320+
type: boolean
316321
type: object
317322
logToMetrics:
318323
description: LogToMetrics defines a Log to Metrics Filter configuration.

config/crd/bases/fluentbit.fluent.io_filters.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,11 @@ spec:
313313
instead of calling Kube Server API to enhance the log.
314314
This could mitigate the Kube API heavy traffic issue for large cluster.
315315
type: boolean
316+
useTagForMeta:
317+
description: If true, Kubernetes metadata (e.g., pod_name,
318+
container_name, namespace_name etc) will be extracted
319+
from the tag itself.
320+
type: boolean
316321
type: object
317322
logToMetrics:
318323
description: LogToMetrics defines a Log to Metrics Filter configuration.

manifests/setup/fluent-operator-crd.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ spec:
312312
instead of calling Kube Server API to enhance the log.
313313
This could mitigate the Kube API heavy traffic issue for large cluster.
314314
type: boolean
315+
useTagForMeta:
316+
description: If true, Kubernetes metadata (e.g., pod_name,
317+
container_name, namespace_name etc) will be extracted
318+
from the tag itself.
319+
type: boolean
315320
type: object
316321
logToMetrics:
317322
description: LogToMetrics defines a Log to Metrics Filter configuration.
@@ -14953,6 +14958,11 @@ spec:
1495314958
instead of calling Kube Server API to enhance the log.
1495414959
This could mitigate the Kube API heavy traffic issue for large cluster.
1495514960
type: boolean
14961+
useTagForMeta:
14962+
description: If true, Kubernetes metadata (e.g., pod_name,
14963+
container_name, namespace_name etc) will be extracted
14964+
from the tag itself.
14965+
type: boolean
1495614966
type: object
1495714967
logToMetrics:
1495814968
description: LogToMetrics defines a Log to Metrics Filter configuration.

manifests/setup/setup.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ spec:
312312
instead of calling Kube Server API to enhance the log.
313313
This could mitigate the Kube API heavy traffic issue for large cluster.
314314
type: boolean
315+
useTagForMeta:
316+
description: If true, Kubernetes metadata (e.g., pod_name,
317+
container_name, namespace_name etc) will be extracted
318+
from the tag itself.
319+
type: boolean
315320
type: object
316321
logToMetrics:
317322
description: LogToMetrics defines a Log to Metrics Filter configuration.
@@ -14953,6 +14958,11 @@ spec:
1495314958
instead of calling Kube Server API to enhance the log.
1495414959
This could mitigate the Kube API heavy traffic issue for large cluster.
1495514960
type: boolean
14961+
useTagForMeta:
14962+
description: If true, Kubernetes metadata (e.g., pod_name,
14963+
container_name, namespace_name etc) will be extracted
14964+
from the tag itself.
14965+
type: boolean
1495614966
type: object
1495714967
logToMetrics:
1495814968
description: LogToMetrics defines a Log to Metrics Filter configuration.

0 commit comments

Comments
 (0)