Skip to content

Commit eb4e7ae

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

File tree

8 files changed

+38
-0
lines changed

8 files changed

+38
-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+
// Include Kubernetes owner references in the extra metadata.
107+
OwnerReferences *bool `json:"ownerReferences,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.OwnerReferences != nil {
223+
kvs.Insert("Owner_References", fmt.Sprint(*k.OwnerReferences))
224+
}
220225
return kvs, nil
221226
}
222227

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ spec:
279279
Include Kubernetes namespace metadata only and no pod metadata.
280280
If this is set, the values of Labels and Annotations are ignored.
281281
type: boolean
282+
ownerReferences:
283+
description: Include Kubernetes owner references in the
284+
extra metadata.
285+
type: boolean
282286
regexParser:
283287
description: |-
284288
Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ spec:
279279
Include Kubernetes namespace metadata only and no pod metadata.
280280
If this is set, the values of Labels and Annotations are ignored.
281281
type: boolean
282+
ownerReferences:
283+
description: Include Kubernetes owner references in the
284+
extra metadata.
285+
type: boolean
282286
regexParser:
283287
description: |-
284288
Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ spec:
279279
Include Kubernetes namespace metadata only and no pod metadata.
280280
If this is set, the values of Labels and Annotations are ignored.
281281
type: boolean
282+
ownerReferences:
283+
description: Include Kubernetes owner references in the
284+
extra metadata.
285+
type: boolean
282286
regexParser:
283287
description: |-
284288
Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ spec:
279279
Include Kubernetes namespace metadata only and no pod metadata.
280280
If this is set, the values of Labels and Annotations are ignored.
281281
type: boolean
282+
ownerReferences:
283+
description: Include Kubernetes owner references in the
284+
extra metadata.
285+
type: boolean
282286
regexParser:
283287
description: |-
284288
Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id.

docs/plugins/fluentbit/filter/kubernetes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ Kubernetes filter allows to enrich your log files with Kubernetes metadata. <br
3939
| namespaceLabels | Include Kubernetes namespace resource labels in the extra metadata. | *bool |
4040
| namespaceAnnotations | Include Kubernetes namespace resource annotations in the extra metadata. | *bool |
4141
| namespaceMetadataOnly | Include Kubernetes namespace metadata only and no pod metadata. If this is set, the values of Labels and Annotations are ignored. | *bool |
42+
| ownerReferences | Include Kubernetes owner references in the extra metadata. | *bool |

manifests/setup/fluent-operator-crd.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ spec:
278278
Include Kubernetes namespace metadata only and no pod metadata.
279279
If this is set, the values of Labels and Annotations are ignored.
280280
type: boolean
281+
ownerReferences:
282+
description: Include Kubernetes owner references in the
283+
extra metadata.
284+
type: boolean
281285
regexParser:
282286
description: |-
283287
Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id.
@@ -14919,6 +14923,10 @@ spec:
1491914923
Include Kubernetes namespace metadata only and no pod metadata.
1492014924
If this is set, the values of Labels and Annotations are ignored.
1492114925
type: boolean
14926+
ownerReferences:
14927+
description: Include Kubernetes owner references in the
14928+
extra metadata.
14929+
type: boolean
1492214930
regexParser:
1492314931
description: |-
1492414932
Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id.

manifests/setup/setup.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ spec:
278278
Include Kubernetes namespace metadata only and no pod metadata.
279279
If this is set, the values of Labels and Annotations are ignored.
280280
type: boolean
281+
ownerReferences:
282+
description: Include Kubernetes owner references in the
283+
extra metadata.
284+
type: boolean
281285
regexParser:
282286
description: |-
283287
Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id.
@@ -14919,6 +14923,10 @@ spec:
1491914923
Include Kubernetes namespace metadata only and no pod metadata.
1492014924
If this is set, the values of Labels and Annotations are ignored.
1492114925
type: boolean
14926+
ownerReferences:
14927+
description: Include Kubernetes owner references in the
14928+
extra metadata.
14929+
type: boolean
1492214930
regexParser:
1492314931
description: |-
1492414932
Set an alternative Parser to process record Tag and extract pod_name, namespace_name, container_name and docker_id.

0 commit comments

Comments
 (0)