-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add wasm filter piugin Signed-off-by: jiuxia211 <[email protected]> * feat: update AccessiblePaths type to string[] and correct Event_Format field Signed-off-by: jiuxia211 <[email protected]> * delete the WASM file mounting in Fluent Bit DaemonSet Signed-off-by: jiuxia211 <[email protected]> * add exec wasi input plugin Signed-off-by: jiuxia211 <[email protected]> * update docs for wasm filter and exec wasi input plugin Signed-off-by: jiuxia211 <[email protected]> --------- Signed-off-by: jiuxia211 <[email protected]>
- Loading branch information
Showing
11 changed files
with
306 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package input | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins" | ||
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins/params" | ||
) | ||
|
||
// +kubebuilder:object:generate:=true | ||
|
||
// The exec_wasi input plugin, allows to execute WASM program that is WASI target like as external program and collects event logs from there. | ||
// **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/exec-wasi** | ||
type ExecWasi struct { | ||
// The place of a WASM program file. | ||
WASIPath string `json:"wasiPath,omitempty"` | ||
// Specify the name of a parser to interpret the entry as a structured message. | ||
Parser string `json:"parser,omitempty"` | ||
// Specify the whitelist of paths to be able to access paths from WASM programs. | ||
AccessiblePaths []string `json:"accessiblePaths,omitempty"` | ||
// Polling interval (seconds). | ||
IntervalSec *int32 `json:"intervalSec,omitempty"` | ||
// Polling interval (nanoseconds). | ||
IntervalNSec *int64 `json:"intervalNSec,omitempty"` | ||
// +kubebuilder:validation:Pattern:="^\\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$" | ||
WasmHeapSize string `json:"wasmHeapSize,omitempty"` | ||
// Size of the stack size of Wasm execution. Review unit sizes for allowed values. | ||
// +kubebuilder:validation:Pattern:="^\\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$" | ||
WasmStackSize string `json:"wasmStackSize,omitempty"` | ||
// Size of the buffer (check unit sizes for allowed values) | ||
// +kubebuilder:validation:Pattern:="^\\d+(k|K|KB|kb|m|M|MB|mb|g|G|GB|gb)?$" | ||
BufSize string `json:"bufSize,omitempty"` | ||
// Indicates whether to run this input in its own thread. Default: false. | ||
Threaded *bool `json:"threaded,omitempty"` | ||
} | ||
|
||
func (_ *ExecWasi) Name() string { | ||
return "exec_wasi" | ||
} | ||
|
||
// Params implement Section() method | ||
func (w *ExecWasi) Params(_ plugins.SecretLoader) (*params.KVs, error) { | ||
kvs := params.NewKVs() | ||
|
||
if w.WASIPath != "" { | ||
kvs.Insert("WASI_Path", w.WASIPath) | ||
} | ||
if w.Parser != "" { | ||
kvs.Insert("Parser", w.Parser) | ||
} | ||
for _, p := range w.AccessiblePaths { | ||
kvs.Insert("Accessible_Paths", p) | ||
} | ||
if w.IntervalSec != nil { | ||
kvs.Insert("Interval_Sec", fmt.Sprint(*w.IntervalSec)) | ||
} | ||
if w.IntervalNSec != nil { | ||
kvs.Insert("Interval_NSec", fmt.Sprint(*w.IntervalNSec)) | ||
} | ||
if w.WasmHeapSize != "" { | ||
kvs.Insert("Wasm_Heap_Size", w.WasmHeapSize) | ||
} | ||
if w.WasmStackSize != "" { | ||
kvs.Insert("Wasm_Stack_Size", w.WasmStackSize) | ||
} | ||
if w.BufSize != "" { | ||
kvs.Insert("Buf_Size", w.BufSize) | ||
} | ||
if w.Threaded != nil { | ||
kvs.Insert("Threaded", fmt.Sprint(*w.Threaded)) | ||
} | ||
return kvs, nil | ||
} |
35 changes: 35 additions & 0 deletions
35
apis/fluentbit/v1alpha2/plugins/input/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
# WASM | ||
# Wasm | ||
|
||
The Wasm Filter allows you to modify the incoming records using Wasm technology. <br /> **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/filters/wasm** | ||
Wasm Filter allows you to modify the incoming records using Wasm technology. **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/filters/wasm** | ||
|
||
|
||
| Field | Description | Scheme | | ||
| ----- | ----------- | ------ | | ||
| wasmPath | Path to the built Wasm program that will be used. This can be a relative path against the main configuration file. | string | | ||
| eventFormat | Define event format to interact with Wasm programs: msgpack or json. Default: json | string | | ||
| functionName | Wasm function name that will be triggered to do filtering. It's assumed that the function is built inside the Wasm program specified above. | string | | ||
| accessiblePaths | Specify the whitelist of paths to be able to access paths from WASM programs. | string | | ||
| accessiblePaths | Specify the whitelist of paths to be able to access paths from WASM programs. | []string | | ||
| wasmHeapSize | Size of the heap size of Wasm execution. Review unit sizes for allowed values. | string | | ||
| wasmStackSize | Size of the stack size of Wasm execution. Review unit sizes for allowed values. | string | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# ExecWasi | ||
|
||
The exec_wasi input plugin, allows to execute WASM program that is WASI target like as external program and collects event logs from there. **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/exec-wasi** | ||
|
||
|
||
| Field | Description | Scheme | | ||
| ----- | ----------- | ------ | | ||
| wasiPath | The place of a WASM program file. | string | | ||
| parser | Specify the name of a parser to interpret the entry as a structured message. | string | | ||
| accessiblePaths | Specify the whitelist of paths to be able to access paths from WASM programs. | []string | | ||
| intervalSec | Polling interval (seconds). | *int32 | | ||
| intervalNSec | Polling interval (nanoseconds). | *int64 | | ||
| wasmHeapSize | | string | | ||
| wasmStackSize | Size of the stack size of Wasm execution. Review unit sizes for allowed values. | string | | ||
| bufSize | Size of the buffer (check unit sizes for allowed values) | string | | ||
| threaded | Indicates whether to run this input in its own thread. Default: false. | *bool | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters