Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for User Defined Annotations #313

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

frankgreco
Copy link
Collaborator

@frankgreco frankgreco commented Jun 7, 2022

What this PR does / why we need it:

There is no way to inject annotations into FluentBit DaemonSet pods. This is problematic as I cannot add the necessary annotations to my Prometheus scraper to scape the metrics that these pods expose.

Which issue(s) this PR fixes:

Fixes #311

Does this PR introduced a user-facing change?

Support for user defined annotations has been added. To add annotations to FluentBit pods, specify them in FluentBit.Spec.Annotations.

Additional documentation, usage docs, etc.:

I'm not sure what should go here. Is this referring to FluentBit documentation?

@frankgreco
Copy link
Collaborator Author

@wenchajun could you give approval for workflow runs on this PR?

@wenchajun
Copy link
Member

@wenchajun could you give approval for workflow runs on this PR?

Okay, but it looks like you submitted an extra commit, can you rebase it?

@frankgreco
Copy link
Collaborator Author

Here's the local e2e tests I ran locally.

$ make run
$ cat <<EOF | kubectl apply -f -
apiVersion: fluentbit.fluent.io/v1alpha2
kind: FluentBit
metadata:
  name: fluent-bit
  namespace: fluent
  labels:
    app.kubernetes.io/name: fluent-bit
spec:
  image: kubesphere/fluent-bit:v1.8.11
  fluentBitConfigName: fluent-bit-config
  annotations:
    foo.io: bar
EOF
$ kubectl -n fluent get po/fluent-bit-dfbp7 -o json | jq .metadata.annotations
{
  "foo": "bar"
}

@frankgreco frankgreco marked this pull request as ready for review June 7, 2022 04:33
@frankgreco frankgreco changed the title [WIP] Add Annotation Support Add Annotation Support Jun 7, 2022
@frankgreco frankgreco changed the title Add Annotation Support Add Support for User Defined Annotations Jun 7, 2022
@zhu733756
Copy link
Member

Do we add an annotation to codes like https://github.com/fluent/fluent-operator/blob/master/controllers/fluentbit_controller.go#L147?

Signed-off-by: Frank Greco Jr <fbgrecojr@me.com>
@wenchajun
Copy link
Member

/lgtm

@benjaminhuo
Copy link
Member

Thanks for the contribution @frankgreco

@benjaminhuo benjaminhuo merged commit aec1bc8 into fluent:master Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Annotation Support
4 participants