From d22b5a18f51780e24ee8738a8eb11408c72fc7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csjliu1=E2=80=9D?= <“sj_liu123@163.com”> Date: Thu, 14 Sep 2023 09:39:31 +0800 Subject: [PATCH 1/3] [summerospp]add fluentbit nginx plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “sjliu1” <“sj_liu123@163.com”> --- apis/fluentbit/v1alpha2/clusterinput_types.go | 2 + .../fluentbit/v1alpha2/plugins/input/nginx.go | 47 +++++++++++++++++++ .../plugins/input/zz_generated.deepcopy.go | 25 ++++++++++ .../v1alpha2/zz_generated.deepcopy.go | 5 ++ .../fluentbit.fluent.io_clusterinputs.yaml | 21 +++++++++ .../fluentbit.fluent.io_clusterinputs.yaml | 21 +++++++++ docs/fluentbit.md | 1 + docs/plugins/fluentbit/input/nginx.md | 11 +++++ go.mod | 4 ++ go.sum | 11 +++++ manifests/setup/fluent-operator-crd.yaml | 21 +++++++++ manifests/setup/setup.yaml | 21 +++++++++ 12 files changed, 190 insertions(+) create mode 100644 apis/fluentbit/v1alpha2/plugins/input/nginx.go create mode 100644 docs/plugins/fluentbit/input/nginx.md diff --git a/apis/fluentbit/v1alpha2/clusterinput_types.go b/apis/fluentbit/v1alpha2/clusterinput_types.go index 266e009ac..a52970815 100644 --- a/apis/fluentbit/v1alpha2/clusterinput_types.go +++ b/apis/fluentbit/v1alpha2/clusterinput_types.go @@ -63,6 +63,8 @@ type InputSpec struct { MQTT *input.MQTT `json:"mqtt,omitempty"` // Collectd defines the Collectd input plugin configuration Collectd *input.Collectd `json:"collectd,omitempty"` + // Collectd defines the Collectd input plugin configuration + Nginx *input.Nginx `json:"nginx,omitempty"` } // +kubebuilder:object:root=true diff --git a/apis/fluentbit/v1alpha2/plugins/input/nginx.go b/apis/fluentbit/v1alpha2/plugins/input/nginx.go new file mode 100644 index 000000000..4d607653e --- /dev/null +++ b/apis/fluentbit/v1alpha2/plugins/input/nginx.go @@ -0,0 +1,47 @@ +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 + +// NGINX Exporter Metrics input plugin scrapes metrics from the NGINX stub status handler.
+// **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/nginx** +type Nginx struct { + // Name of the target host or IP address to check, default: localhost + Host string `json:"host,omitempty"` + // Port of the target nginx service to connect to, default: 80 + // +kubebuilder:validation:Minimum:=1 + // +kubebuilder:validation:Maximum:=65535 + Port *int32 `json:"port,omitempty"` + // The URL of the Stub Status Handler,default: /status + StatusURL string `json:"statusURL,omitempty"` + // Turn on NGINX plus mode,default: true + NginxPlus *bool `json:"nginxPlus,omitempty"` +} + +func (_ *Nginx) Name() string { + return "nginx_metrics" +} + +// implement Section() method +func (n *Nginx) Params(_ plugins.SecretLoader) (*params.KVs, error) { + kvs := params.NewKVs() + if n.Host != "" { + kvs.Insert("Host", n.Host) + } + if n.Port != nil { + kvs.Insert("Port", fmt.Sprint(*n.Port)) + } + if n.StatusURL != "" { + kvs.Insert("Status_URL", n.StatusURL) + } + if n.NginxPlus != nil { + kvs.Insert("Nginx_Plus", fmt.Sprint(*n.NginxPlus)) + } + return kvs, nil +} diff --git a/apis/fluentbit/v1alpha2/plugins/input/zz_generated.deepcopy.go b/apis/fluentbit/v1alpha2/plugins/input/zz_generated.deepcopy.go index d3ab99473..382eb35a3 100644 --- a/apis/fluentbit/v1alpha2/plugins/input/zz_generated.deepcopy.go +++ b/apis/fluentbit/v1alpha2/plugins/input/zz_generated.deepcopy.go @@ -160,6 +160,31 @@ func (in *MQTT) DeepCopy() *MQTT { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Nginx) DeepCopyInto(out *Nginx) { + *out = *in + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(int32) + **out = **in + } + if in.NginxPlus != nil { + in, out := &in.NginxPlus, &out.NginxPlus + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Nginx. +func (in *Nginx) DeepCopy() *Nginx { + if in == nil { + return nil + } + out := new(Nginx) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeExporterMetrics) DeepCopyInto(out *NodeExporterMetrics) { *out = *in diff --git a/apis/fluentbit/v1alpha2/zz_generated.deepcopy.go b/apis/fluentbit/v1alpha2/zz_generated.deepcopy.go index 43cc5623e..d761b7d8f 100644 --- a/apis/fluentbit/v1alpha2/zz_generated.deepcopy.go +++ b/apis/fluentbit/v1alpha2/zz_generated.deepcopy.go @@ -1098,6 +1098,11 @@ func (in *InputSpec) DeepCopyInto(out *InputSpec) { *out = new(input.Collectd) (*in).DeepCopyInto(*out) } + if in.Nginx != nil { + in, out := &in.Nginx, &out.Nginx + *out = new(input.Nginx) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InputSpec. diff --git a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml index f947812b7..00e80d340 100644 --- a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml +++ b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml @@ -266,6 +266,27 @@ spec: minimum: 1 type: integer type: object + nginx: + description: Collectd defines the Collectd input plugin configuration + properties: + host: + description: 'Name of the target host or IP address to check, + default: localhost' + type: string + nginxPlus: + description: 'Turn on NGINX plus mode,default: true' + type: boolean + port: + description: 'Port of the target nginx service to connect to, + default: 80' + format: int32 + maximum: 65535 + minimum: 1 + type: integer + statusURL: + description: 'The URL of the Stub Status Handler,default: /status' + type: string + type: object nodeExporterMetrics: description: NodeExporterMetrics defines Node Exporter Metrics Input configuration. diff --git a/config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml b/config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml index f947812b7..00e80d340 100644 --- a/config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml @@ -266,6 +266,27 @@ spec: minimum: 1 type: integer type: object + nginx: + description: Collectd defines the Collectd input plugin configuration + properties: + host: + description: 'Name of the target host or IP address to check, + default: localhost' + type: string + nginxPlus: + description: 'Turn on NGINX plus mode,default: true' + type: boolean + port: + description: 'Port of the target nginx service to connect to, + default: 80' + format: int32 + maximum: 65535 + minimum: 1 + type: integer + statusURL: + description: 'The URL of the Stub Status Handler,default: /status' + type: string + type: object nodeExporterMetrics: description: NodeExporterMetrics defines Node Exporter Metrics Input configuration. diff --git a/docs/fluentbit.md b/docs/fluentbit.md index eafd4ff09..a30b69324 100644 --- a/docs/fluentbit.md +++ b/docs/fluentbit.md @@ -423,6 +423,7 @@ InputSpec defines the desired state of ClusterInput | http | HTTP defines the HTTP input plugin configuration | *[input.HTTP](plugins/input/http.md) | | mqtt | MQTT defines the MQTT input plugin configuration | *[input.MQTT](plugins/input/mqtt.md) | | collectd | Collectd defines the Collectd input plugin configuration | *[input.Collectd](plugins/input/collectd.md) | +| nginx | Collectd defines the Collectd input plugin configuration | *[input.Nginx](plugins/input/nginx.md) | [Back to TOC](#table-of-contents) # NamespacedFluentBitCfgSpec diff --git a/docs/plugins/fluentbit/input/nginx.md b/docs/plugins/fluentbit/input/nginx.md new file mode 100644 index 000000000..686245ed2 --- /dev/null +++ b/docs/plugins/fluentbit/input/nginx.md @@ -0,0 +1,11 @@ +# Nginx + +NGINX Exporter Metrics input plugin scrapes metrics from the NGINX stub status handler.
**For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/nginx** + + +| Field | Description | Scheme | +| ----- | ----------- | ------ | +| host | Name of the target host or IP address to check, default: localhost | string | +| port | Port of the target nginx service to connect to, default: 80 | *int32 | +| statusURL | The URL of the Stub Status Handler,default: /status | string | +| nginxPlus | Turn on NGINX plus mode,default: true | *bool | diff --git a/go.mod b/go.mod index b9f366363..d13074e85 100644 --- a/go.mod +++ b/go.mod @@ -58,12 +58,14 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.7.0 // indirect go.uber.org/zap v1.24.0 // indirect + golang.org/x/mod v0.10.0 // indirect golang.org/x/net v0.12.0 // indirect golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b // indirect golang.org/x/sys v0.10.0 // indirect golang.org/x/term v0.10.0 // indirect golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.9.3 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect @@ -72,7 +74,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.26.1 // indirect + k8s.io/code-generator v0.26.1 // indirect k8s.io/component-base v0.26.1 // indirect + k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/go.sum b/go.sum index d90085cdb..dbd240f06 100644 --- a/go.sum +++ b/go.sum @@ -89,6 +89,7 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= @@ -349,6 +350,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= +golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -503,6 +506,7 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -513,6 +517,7 @@ golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= +golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -640,8 +645,13 @@ k8s.io/apimachinery v0.27.4 h1:CdxflD4AF61yewuid0fLl6bM4a3q04jWel0IlP+aYjs= k8s.io/apimachinery v0.27.4/go.mod h1:XNfZ6xklnMCOGGFNqXG7bUrQCoR04dh/E7FprV6pb+E= k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s= k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ= +k8s.io/code-generator v0.26.1 h1:dusFDsnNSKlMFYhzIM0jAO1OlnTN5WYwQQ+Ai12IIlo= +k8s.io/code-generator v0.26.1/go.mod h1:OMoJ5Dqx1wgaQzKgc+ZWaZPfGjdRq/Y3WubFrZmeI3I= k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4= k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU= +k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08= +k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= @@ -657,5 +667,6 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/manifests/setup/fluent-operator-crd.yaml b/manifests/setup/fluent-operator-crd.yaml index dd1ed3760..620a8bc4b 100644 --- a/manifests/setup/fluent-operator-crd.yaml +++ b/manifests/setup/fluent-operator-crd.yaml @@ -2015,6 +2015,27 @@ spec: minimum: 1 type: integer type: object + nginx: + description: Collectd defines the Collectd input plugin configuration + properties: + host: + description: 'Name of the target host or IP address to check, + default: localhost' + type: string + nginxPlus: + description: 'Turn on NGINX plus mode,default: true' + type: boolean + port: + description: 'Port of the target nginx service to connect to, + default: 80' + format: int32 + maximum: 65535 + minimum: 1 + type: integer + statusURL: + description: 'The URL of the Stub Status Handler,default: /status' + type: string + type: object nodeExporterMetrics: description: NodeExporterMetrics defines Node Exporter Metrics Input configuration. diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index 940b1bd44..3d1f02d80 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -2015,6 +2015,27 @@ spec: minimum: 1 type: integer type: object + nginx: + description: Collectd defines the Collectd input plugin configuration + properties: + host: + description: 'Name of the target host or IP address to check, + default: localhost' + type: string + nginxPlus: + description: 'Turn on NGINX plus mode,default: true' + type: boolean + port: + description: 'Port of the target nginx service to connect to, + default: 80' + format: int32 + maximum: 65535 + minimum: 1 + type: integer + statusURL: + description: 'The URL of the Stub Status Handler,default: /status' + type: string + type: object nodeExporterMetrics: description: NodeExporterMetrics defines Node Exporter Metrics Input configuration. From 0411c80df8a93ff5b71e586bd949c841b8f8ca70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Csjliu1=E2=80=9D?= <“sj_liu123@163.com”> Date: Thu, 14 Sep 2023 10:03:29 +0800 Subject: [PATCH 2/3] [summerospp]add fluentbit nginx plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “sjliu1” <“sj_liu123@163.com”> --- apis/fluentbit/v1alpha2/clusterinput_types.go | 2 +- .../fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml | 2 +- config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml | 2 +- docs/fluentbit.md | 2 +- manifests/setup/fluent-operator-crd.yaml | 2 +- manifests/setup/setup.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apis/fluentbit/v1alpha2/clusterinput_types.go b/apis/fluentbit/v1alpha2/clusterinput_types.go index a52970815..29c5d79ac 100644 --- a/apis/fluentbit/v1alpha2/clusterinput_types.go +++ b/apis/fluentbit/v1alpha2/clusterinput_types.go @@ -63,7 +63,7 @@ type InputSpec struct { MQTT *input.MQTT `json:"mqtt,omitempty"` // Collectd defines the Collectd input plugin configuration Collectd *input.Collectd `json:"collectd,omitempty"` - // Collectd defines the Collectd input plugin configuration + // Nginx defines the Nginx input plugin configuration Nginx *input.Nginx `json:"nginx,omitempty"` } diff --git a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml index 00e80d340..d9c73669c 100644 --- a/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml +++ b/charts/fluent-operator/charts/fluent-bit-crds/crds/fluentbit.fluent.io_clusterinputs.yaml @@ -267,7 +267,7 @@ spec: type: integer type: object nginx: - description: Collectd defines the Collectd input plugin configuration + description: Nginx defines the Nginx input plugin configuration properties: host: description: 'Name of the target host or IP address to check, diff --git a/config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml b/config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml index 00e80d340..d9c73669c 100644 --- a/config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml +++ b/config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml @@ -267,7 +267,7 @@ spec: type: integer type: object nginx: - description: Collectd defines the Collectd input plugin configuration + description: Nginx defines the Nginx input plugin configuration properties: host: description: 'Name of the target host or IP address to check, diff --git a/docs/fluentbit.md b/docs/fluentbit.md index a30b69324..c724b6c09 100644 --- a/docs/fluentbit.md +++ b/docs/fluentbit.md @@ -423,7 +423,7 @@ InputSpec defines the desired state of ClusterInput | http | HTTP defines the HTTP input plugin configuration | *[input.HTTP](plugins/input/http.md) | | mqtt | MQTT defines the MQTT input plugin configuration | *[input.MQTT](plugins/input/mqtt.md) | | collectd | Collectd defines the Collectd input plugin configuration | *[input.Collectd](plugins/input/collectd.md) | -| nginx | Collectd defines the Collectd input plugin configuration | *[input.Nginx](plugins/input/nginx.md) | +| nginx | Nginx defines the Nginx input plugin configuration | *[input.Nginx](plugins/input/nginx.md) | [Back to TOC](#table-of-contents) # NamespacedFluentBitCfgSpec diff --git a/manifests/setup/fluent-operator-crd.yaml b/manifests/setup/fluent-operator-crd.yaml index 620a8bc4b..398af8ba8 100644 --- a/manifests/setup/fluent-operator-crd.yaml +++ b/manifests/setup/fluent-operator-crd.yaml @@ -2016,7 +2016,7 @@ spec: type: integer type: object nginx: - description: Collectd defines the Collectd input plugin configuration + description: Nginx defines the Nginx input plugin configuration properties: host: description: 'Name of the target host or IP address to check, diff --git a/manifests/setup/setup.yaml b/manifests/setup/setup.yaml index 3d1f02d80..86d0f39ff 100644 --- a/manifests/setup/setup.yaml +++ b/manifests/setup/setup.yaml @@ -2016,7 +2016,7 @@ spec: type: integer type: object nginx: - description: Collectd defines the Collectd input plugin configuration + description: Nginx defines the Nginx input plugin configuration properties: host: description: 'Name of the target host or IP address to check, From 55e358f4147dabe06293ef769b0d0ab076a45847 Mon Sep 17 00:00:00 2001 From: sjliu1 Date: Tue, 19 Sep 2023 21:50:51 +0800 Subject: [PATCH 3/3] [summerospp]add fluentbit nginx plugin Signed-off-by: sjliu1 --- apis/fluentbit/v1alpha2/clusterinput_types.go | 4 ++-- apis/fluentbit/v1alpha2/zz_generated.deepcopy.go | 8 +++++--- docs/fluentbit.md | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apis/fluentbit/v1alpha2/clusterinput_types.go b/apis/fluentbit/v1alpha2/clusterinput_types.go index dd106ada0..b46c64add 100644 --- a/apis/fluentbit/v1alpha2/clusterinput_types.go +++ b/apis/fluentbit/v1alpha2/clusterinput_types.go @@ -63,10 +63,10 @@ type InputSpec struct { MQTT *input.MQTT `json:"mqtt,omitempty"` // Collectd defines the Collectd input plugin configuration Collectd *input.Collectd `json:"collectd,omitempty"` - // Nginx defines the Nginx input plugin configuration - Nginx *input.Nginx `json:"nginx,omitempty"` // StatsD defines the StatsD input plugin configuration StatsD *input.StatsD `json:"statsd,omitempty"` + // Nginx defines the Nginx input plugin configuration + Nginx *input.Nginx `json:"nginx,omitempty"` } // +kubebuilder:object:root=true diff --git a/apis/fluentbit/v1alpha2/zz_generated.deepcopy.go b/apis/fluentbit/v1alpha2/zz_generated.deepcopy.go index 9fc1f5451..e98f814ef 100644 --- a/apis/fluentbit/v1alpha2/zz_generated.deepcopy.go +++ b/apis/fluentbit/v1alpha2/zz_generated.deepcopy.go @@ -1098,14 +1098,16 @@ func (in *InputSpec) DeepCopyInto(out *InputSpec) { *out = new(input.Collectd) (*in).DeepCopyInto(*out) } - if in.Nginx != nil { - in, out := &in.Nginx, &out.Nginx - *out = new(input.Nginx) if in.StatsD != nil { in, out := &in.StatsD, &out.StatsD *out = new(input.StatsD) (*in).DeepCopyInto(*out) } + if in.Nginx != nil { + in, out := &in.Nginx, &out.Nginx + *out = new(input.Nginx) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InputSpec. diff --git a/docs/fluentbit.md b/docs/fluentbit.md index 354997512..3b86bfbbb 100644 --- a/docs/fluentbit.md +++ b/docs/fluentbit.md @@ -384,6 +384,7 @@ FluentBitSpec defines the desired state of FluentBit | priorityClassName | PriorityClassName represents the pod's priority class. | string | | volumes | List of volumes that can be mounted by containers belonging to the pod. | []corev1.Volume | | volumesMounts | Pod volumes to mount into the container's filesystem. | []corev1.VolumeMount | +| disableLogVolumes | DisableLogVolumes removes the hostPath mounts for varlibcontainers, varlogs and systemd. | bool | | annotations | Annotations to add to each Fluentbit pod. | map[string]string | | serviceAccountAnnotations | Annotations to add to the Fluentbit service account | map[string]string | | labels | Labels to add to each FluentBit pod | map[string]string | @@ -400,7 +401,6 @@ FluentBitSpec defines the desired state of FluentBit | metricsPort | MetricsPort is the port used by the metrics server. If this option is set, HttpPort from ClusterFluentBitConfig needs to match this value. Default is 2020. | int32 | | service | Service represents configurations on the fluent-bit service. | FluentBitService | | schedulerName | SchedulerName represents the desired scheduler for fluent-bit pods. | string | -| disableLogVolumes | DisableLogVolumes removes the hostPath mounts for varlibcontainers, varlogs and systemd. | bool | [Back to TOC](#table-of-contents) # InputSpec @@ -424,8 +424,8 @@ InputSpec defines the desired state of ClusterInput | http | HTTP defines the HTTP input plugin configuration | *[input.HTTP](plugins/input/http.md) | | mqtt | MQTT defines the MQTT input plugin configuration | *[input.MQTT](plugins/input/mqtt.md) | | collectd | Collectd defines the Collectd input plugin configuration | *[input.Collectd](plugins/input/collectd.md) | -| nginx | Nginx defines the Nginx input plugin configuration | *[input.Nginx](plugins/input/nginx.md) | | statsd | StatsD defines the StatsD input plugin configuration | *[input.StatsD](plugins/input/statsd.md) | +| nginx | Nginx defines the Nginx input plugin configuration | *[input.Nginx](plugins/input/nginx.md) | [Back to TOC](#table-of-contents) # NamespacedFluentBitCfgSpec