-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add wasm filter piugin #1325
add wasm filter piugin #1325
Conversation
Signed-off-by: jiuxia211 <2064166368@qq.com>
@wanjunlei @wenchajun pls help to review |
@@ -107,6 +107,8 @@ type FluentBitSpec struct { | |||
SchedulerName string `json:"schedulerName,omitempty"` | |||
// Optional duration in seconds the pod needs to terminate gracefully. Value must be non-negative integer. | |||
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` | |||
// Storage for wasm file. You will use it if wasm filter is enabled. | |||
WasmFile corev1.VolumeSource `json:"wasmFile,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Volumes and VolumesMounts can be used to mount wasm files. Does it need to add additional fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it doesn't need additional fields, just specify the hostPath of the wasm file.
Like this:
wasmFile:
hostPath:
path: /etc/wasm/
…t field Signed-off-by: jiuxia211 <2064166368@qq.com>
pkg/operator/daemonset.go
Outdated
}) | ||
ds.Spec.Template.Spec.Containers[0].VolumeMounts = append(ds.Spec.Template.Spec.Containers[0].VolumeMounts, corev1.VolumeMount{ | ||
Name: "wasm", | ||
MountPath: "/fluent-bit/wasm", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean the WasmPath
must begin with /fluent-bit/wasm
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Because I noticed that's what PositionDB does. Maybe more comments should be added or is there a better way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend using Volumes and VolumesMounts to mount wasm files, so you can specify any directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK,I have updated it
Signed-off-by: jiuxia211 <2064166368@qq.com>
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Does this PR introduced a user-facing change?
The wasm file needs to be mounted to the fluent bit. I tried writing the wasm file to secret or configmap, but it was too long, and I ended up mimicking the way Position DB was mounted.
Additional documentation, usage docs, etc.: