Skip to content

Commit

Permalink
Merge branch 'master' into nginx
Browse files Browse the repository at this point in the history
Signed-off-by: SjLiu <[email protected]>
  • Loading branch information
sjliu1 authored Sep 19, 2023
2 parents 0411c80 + 6be240a commit c63f76d
Show file tree
Hide file tree
Showing 15 changed files with 248 additions and 71 deletions.
2 changes: 2 additions & 0 deletions apis/fluentbit/v1alpha2/clusterinput_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ type InputSpec struct {
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"`
}

// +kubebuilder:object:root=true
Expand Down
2 changes: 2 additions & 0 deletions apis/fluentbit/v1alpha2/fluentbit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ type FluentBitSpec struct {
Volumes []corev1.Volume `json:"volumes,omitempty"`
// Pod volumes to mount into the container's filesystem.
VolumesMounts []corev1.VolumeMount `json:"volumesMounts,omitempty"`
// DisableLogVolumes removes the hostPath mounts for varlibcontainers, varlogs and systemd.
DisableLogVolumes bool `json:"disableLogVolumes,omitempty"`
// Annotations to add to each Fluentbit pod.
Annotations map[string]string `json:"annotations,omitempty"`
// Annotations to add to the Fluentbit service account
Expand Down
37 changes: 37 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/input/statsd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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 StatsD input plugin allows you to receive metrics via StatsD protocol.<br />
// **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/statsd**
type StatsD struct {
// Listener network interface, default: 0.0.0.0
Listen string `json:"listen,omitempty"`
// UDP port where listening for connections, default: 8125
// +kubebuilder:validation:Minimum:=1
// +kubebuilder:validation:Maximum:=65535
Port *int32 `json:"port,omitempty"`
}

func (_ *StatsD) Name() string {
return "statsd"
}

// implement Section() method
func (s *StatsD) Params(_ plugins.SecretLoader) (*params.KVs, error) {
kvs := params.NewKVs()
if s.Listen != "" {
kvs.Insert("Listen", s.Listen)
}
if s.Port != nil {
kvs.Insert("Port", fmt.Sprint(*s.Port))
}
return kvs, nil
}
20 changes: 20 additions & 0 deletions 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.

3 changes: 3 additions & 0 deletions apis/fluentbit/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,20 @@ spec:
plugin
type: string
type: object
statsd:
description: StatsD defines the StatsD input plugin configuration
properties:
listen:
description: 'Listener network interface, default: 0.0.0.0'
type: string
port:
description: 'UDP port where listening for connections, default:
8125'
format: int32
maximum: 65535
minimum: 1
type: integer
type: object
systemd:
description: Systemd defines Systemd Input configuration.
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,10 @@ spec:
type: string
type: object
type: object
disableLogVolumes:
description: DisableLogVolumes removes the hostPath mounts for varlibcontainers,
varlogs and systemd.
type: boolean
disableService:
description: DisableService tells if the fluentbit service should
be deployed.
Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_clusterinputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,20 @@ spec:
plugin
type: string
type: object
statsd:
description: StatsD defines the StatsD input plugin configuration
properties:
listen:
description: 'Listener network interface, default: 0.0.0.0'
type: string
port:
description: 'UDP port where listening for connections, default:
8125'
format: int32
maximum: 65535
minimum: 1
type: integer
type: object
systemd:
description: Systemd defines Systemd Input configuration.
properties:
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/fluentbit.fluent.io_fluentbits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,10 @@ spec:
type: string
type: object
type: object
disableLogVolumes:
description: DisableLogVolumes removes the hostPath mounts for varlibcontainers,
varlogs and systemd.
type: boolean
disableService:
description: DisableService tells if the fluentbit service should
be deployed.
Expand Down
1 change: 1 addition & 0 deletions config/samples/fluentbit_v1alpha2_fluentbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ spec:
hostPath:
path: /var/lib/fluent-bit/
fluentBitConfigName: fluentbitconfig-sample
disableLogVolumes: false
2 changes: 2 additions & 0 deletions docs/fluentbit.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ 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
Expand All @@ -424,6 +425,7 @@ InputSpec defines the desired state of ClusterInput
| 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) |

[Back to TOC](#table-of-contents)
# NamespacedFluentBitCfgSpec
Expand Down
9 changes: 9 additions & 0 deletions docs/plugins/fluentbit/input/statsd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# StatsD

The StatsD input plugin allows you to receive metrics via StatsD protocol.<br /> **For full documentation, refer to https://docs.fluentbit.io/manual/pipeline/inputs/statsd**


| Field | Description | Scheme |
| ----- | ----------- | ------ |
| listen | Listener network interface, default: 0.0.0.0 | string |
| port | UDP port where listening for connections, default: 8125 | *int32 |
18 changes: 18 additions & 0 deletions manifests/setup/fluent-operator-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2124,6 +2124,20 @@ spec:
plugin
type: string
type: object
statsd:
description: StatsD defines the StatsD input plugin configuration
properties:
listen:
description: 'Listener network interface, default: 0.0.0.0'
type: string
port:
description: 'UDP port where listening for connections, default:
8125'
format: int32
maximum: 65535
minimum: 1
type: integer
type: object
systemd:
description: Systemd defines Systemd Input configuration.
properties:
Expand Down Expand Up @@ -13161,6 +13175,10 @@ spec:
type: string
type: object
type: object
disableLogVolumes:
description: DisableLogVolumes removes the hostPath mounts for varlibcontainers,
varlogs and systemd.
type: boolean
disableService:
description: DisableService tells if the fluentbit service should
be deployed.
Expand Down
18 changes: 18 additions & 0 deletions manifests/setup/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2124,6 +2124,20 @@ spec:
plugin
type: string
type: object
statsd:
description: StatsD defines the StatsD input plugin configuration
properties:
listen:
description: 'Listener network interface, default: 0.0.0.0'
type: string
port:
description: 'UDP port where listening for connections, default:
8125'
format: int32
maximum: 65535
minimum: 1
type: integer
type: object
systemd:
description: Systemd defines Systemd Input configuration.
properties:
Expand Down Expand Up @@ -13161,6 +13175,10 @@ spec:
type: string
type: object
type: object
disableLogVolumes:
description: DisableLogVolumes removes the hostPath mounts for varlibcontainers,
varlogs and systemd.
type: boolean
disableService:
description: DisableService tells if the fluentbit service should
be deployed.
Expand Down
Loading

0 comments on commit c63f76d

Please sign in to comment.