You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying fluent-bit with the operator with a cluster input configured to collect Kubernetes Events, fluent-bit outputs some warn logs:
[2024/07/30 13:24:04] [ info] [input:kubernetes_events:kubernetes_events.1] Requesting /api/v1/events?watch=1&resourceVersion=297456085
[2024/07/30 13:24:04] [ warn] [input:kubernetes_events:kubernetes_events.1] events watch failure, http_status=403 payload={"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"events is forbidden: User \"system:serviceaccount:fluent-operator:fluent-bit\" cannot watch resource \"events\" in API group \"\" at the cluster scope","reason":"Forbidden","details":{"kind":"events"},"code":403}
A missing verb watch in the RBAC rules of the fluent-bit deployment causes this. I tried to fix it by adding the watch verb to my fluent bit CRD using the rbacRules attribute. As mentioned in the values.yaml file, fluent-bit can only be granted permissions the operator also has. Unfortunately, the operator currently doesn't have the watch verb allowed for events.
To Reproduce
You can use the following manifest once the operator has been deployed in your cluster:
This manifest will deploy a FluentBit CRD into the fluent-operator namespace, and fluent-bit will be configured to collect Kubernetes events, and send them to stdout.
Expected behavior
Warning logs must disappear and events must be logged instead.
Then, if I add the following rbacRules to my FluentBit CRD, it works properly and events are printed to stdout:
# rest of fluent-bit CRDrbacRules:
- apiGroups:
- ""resources:
- eventsverbs:
- list
- watch
I'll provide a PR to fix this issue, so that users will not need to patch anything independently. IMHO, the operator chart (but also other installation methods) must properly configure this ClusterRole.
You can assign me this issue!
The text was updated successfully, but these errors were encountered:
Describe the issue
When deploying fluent-bit with the operator with a cluster input configured to collect Kubernetes Events, fluent-bit outputs some warn logs:
A missing verb
watch
in the RBAC rules of the fluent-bit deployment causes this. I tried to fix it by adding thewatch
verb to my fluent bit CRD using therbacRules
attribute. As mentioned in thevalues.yaml
file, fluent-bit can only be granted permissions the operator also has. Unfortunately, the operator currently doesn't have thewatch
verb allowed forevents
.To Reproduce
You can use the following manifest once the operator has been deployed in your cluster:
This manifest will deploy a
FluentBit
CRD into thefluent-operator
namespace, and fluent-bit will be configured to collect Kubernetes events, and send them to stdout.Expected behavior
Warning logs must disappear and events must be logged instead.
Your Environment
How did you install fluent operator?
With the official Helm chart from the repository https://github.com/fluent/helm-charts.
Additional context
As a workaround, it is possible to fix this issue by editing the fluent-operator
ClusterRole
to add thewatch
verb for the events:Then, if I add the following
rbacRules
to myFluentBit
CRD, it works properly and events are printed to stdout:I'll provide a PR to fix this issue, so that users will not need to patch anything independently. IMHO, the operator chart (but also other installation methods) must properly configure this
ClusterRole
.You can assign me this issue!
The text was updated successfully, but these errors were encountered: