Skip to content

out_stackdriver: add k8s_cluster resource type#8349

Merged
braydonk merged 2 commits intofluent:masterfrom
ryanohnemus:stackdriver_add_k8s_cluster
Jan 23, 2024
Merged

out_stackdriver: add k8s_cluster resource type#8349
braydonk merged 2 commits intofluent:masterfrom
ryanohnemus:stackdriver_add_k8s_cluster

Conversation

@ryanohnemus
Copy link
Contributor

@ryanohnemus ryanohnemus commented Jan 4, 2024

Add k8s_cluster resource type to out_stackdriver plugin.

This can be used in combination with the in_kubernetes_events to write k8s_cluster type events to stackdriver (such as any non-Pod based kubernetes events)


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
[INPUT]
    Name kubernetes_events
    Tag k8s_events

[FILTER]
    Name rewrite_tag
    Match k8s_events
    Rule $involvedObject['Kind'] Pod k8s_events.$metadata['namespace'].k8s_pod false
    Rule $metadata['namespace'] .* k8s_events.$metadata['namespace'].k8s_cluster false

[OUTPUT]
    Name stackdriver
    Match k8s_events*k8s_cluster
    resource k8s_cluster
    k8s_cluster_name my-cluster-name
    k8s_cluster_location us-central1
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@ryanohnemus
Copy link
Contributor Author

test failure looks like a flake

Copy link
Contributor

@braydonk braydonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me!

Would you mind adding a test for this as well? You can use this other resource test as a reference. I can intuitively see that this will work based on the implementation, so it's just a matter of getting a test for it.

I'll be good to merge it after a test is added!

this can be used in combination with the in_kubernetes_events
to write k8s_cluster type events to stackdriver(such as replicaset events)

Signed-off-by: ryanohnemus <ryanohnemus@gmail.com>
Signed-off-by: ryanohnemus <ryanohnemus@gmail.com>
@ryanohnemus
Copy link
Contributor Author

@braydonk, just rebased and pushed with a test. I will watch the CI checks for any failures, but otherwise we should be good to go

Copy link
Contributor

@braydonk braydonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, unless something in CI fails I will merge.

@braydonk braydonk merged commit dde6ba5 into fluent:master Jan 23, 2024
@ryanohnemus ryanohnemus deleted the stackdriver_add_k8s_cluster branch January 24, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants