Skip to content

Commit

Permalink
Merge branch 'master' into karak/support_file_system_as_storage
Browse files Browse the repository at this point in the history
Signed-off-by: karan k <[email protected]>
  • Loading branch information
karan56625 authored Jul 7, 2023
2 parents e1363f7 + 5b16383 commit 2712a73
Show file tree
Hide file tree
Showing 97 changed files with 5,836 additions and 562 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-fb-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ on:
- "pkg/filenotify/**"

env:
FB_IMG: 'kubesphere/fluent-bit:v2.1.3'
FB_IMG_DEBUG: 'kubesphere/fluent-bit:v2.1.3-debug'
FB_IMG: 'kubesphere/fluent-bit:v2.1.4'
FB_IMG_DEBUG: 'kubesphere/fluent-bit:v2.1.4-debug'

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: ct lint --chart-dirs charts/fluent-operator --config charts/ct.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.5.0
uses: helm/kind-action@v1.7.0
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
## 2.3.0 / 2023-06-05
### Features
- Feat: Adding influxdb plugin (#690)
- Feat: Add EnvVars support to FluentD (#697)
- Feat: Add Pod Annotations support to FluentD (#698)
- Feat: Fluent operator & fluentbit: Added tolerations, nodeSelector + more (#704)
- Feat: Add fluentbit.affinity configuration (#726)
- Feat: Allow setting fluentd PodSecurityContext (#744)
- Feat: Fluentd in_tail plugin (#753)
- Feat: Add missing fluentd buffer options (#757)
- Feat: Add AWS Kinesis Data Streams output plugin for Fluent Bit (#768)
- Feat: Add global log_level support for fluentd (#770)
- Feat: Add scheduler support for fluentbit & fluentd (#771)

### ENHANCEMENT
- EnvVars support in fluentbit helm template (#706)
- Add uri field for each telemetry type in opentelemetry plugin, remove old uri field (#708)
- Adjust fluentd watcher dependabot (#716)
- remove the deprecated -i flag in go build (#720)
- Adjust fluentd arm64 image build timeout (#721)
- Adjust edge metrics collection config (#736)
- Add some fluentbit helm opts (#743)
- Align CRDs and Operator with the fluentbit loki output (#756)
- Fluent-bit upgrade to v2.1.4 (#767)
- build(deps): Bump k8s.io/apimachinery from 0.26.3 to 0.27.1 (#701)
- build(deps): Bump helm/chart-testing-action from 2.1.0 to 2.4.0 (#710)
- build(deps): Bump k8s.io/klog/v2 from 2.90.1 to 2.100.1 (#712)
- build(deps): Bump golang from 1.20.3-alpine3.17 to 1.20.4-alpine3.17 in /cmd/fluent-manager (#713)
- build(deps): Bump golang from 1.20.3-alpine3.16 to 1.20.4-alpine3.16 in /cmd/fluent-watcher/fluentbit (#714)
- build(deps): Bump golang from 1.20.2 to 1.20.4 in /docs/best-practice/forwarding-logs-via-http (#715)
- build(deps): Bump golang from 1.19.2-alpine3.16 to 1.20.4-alpine3.16 in /cmd/fluent-watcher/fluentd (#717)
- build(deps): Bump arm64v8/ruby from 3.1-slim-bullseye to 3.2-slim-bullseye in /cmd/fluent-watcher/fluentd (#718)
- build(deps): Bump alpine from 3.16 to 3.17 in /cmd/fluent-watcher/fluentd (#719)
- build(deps): Bump github.com/onsi/gomega from 1.27.6 to 1.27.7 (#748)
- build(deps): Bump k8s.io/apimachinery from 0.27.1 to 0.27.2 (#751)
- build(deps): Bump helm/kind-action from 1.5.0 to 1.7.0 (#765)

### BUGFIX
- Fix: Fix missing log level (#691)
- Fix: Fix rewrite_tag match rule and trim start of string pattern (#692)
- Fix(docs): Update cluster outputs docs link (#724)
- Fix: dereference pointers in parser filter plugin for fluentd (#745)
- Fix: fluentbit namespace-logging: only generate rewrite tag config once (#746)
- Fix: minor typo fix for firehose (#764)
- Fix: fix typo for estimate_current_event in fluentd (#769)

## 2.2.0 / 2023-04-07
### Features
- Feat: Adding Fluentd cloudwatch plugin (#586)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION?=$(shell cat VERSION | tr -d " \t\n\r")
# Image URL to use all building/pushing image targets
FB_IMG ?= kubesphere/fluent-bit:v2.1.3
FB_IMG_DEBUG ?= kubesphere/fluent-bit:v2.1.3-debug
FB_IMG ?= kubesphere/fluent-bit:v2.1.4
FB_IMG_DEBUG ?= kubesphere/fluent-bit:v2.1.4-debug
FD_IMG ?= kubesphere/fluentd:v1.15.3
FO_IMG ?= kubesphere/fluent-operator:$(VERSION)
FD_IMG_BASE ?= kubesphere/fluentd:v1.15.3-arm64-base
Expand Down
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This page describes the release process and the currently planned schedule for u
| v2.0.1 | 2023-02-08 | Elon Cheng (GitHub: @wenchajun) |
| v2.1.0 | 2023-03-13 | Elon Cheng (GitHub: @wenchajun) |
| v2.2.0 | 2023-04-07 | Elon Cheng (GitHub: @wenchajun) |
| v2.3.0 | 2023-06-05 | Elon Cheng (GitHub: @wenchajun) |

# How to cut a new release

Expand Down
6 changes: 5 additions & 1 deletion apis/fluentbit/v1alpha2/clusteroutput_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ type OutputSpec struct {
// DataDog defines DataDog Output configuration.
DataDog *output.DataDog `json:"datadog,omitempty"`
// Firehose defines Firehose Output configuration.
Fireose *output.Firehose `json:"firehose,omitempty"`
Firehose *output.Firehose `json:"firehose,omitempty"`
// Kinesis defines Kinesis Output configuration.
Kinesis *output.Kinesis `json:"kinesis,omitempty"`
// Stackdriver defines Stackdriver Output Configuration
Stackdriver *output.Stackdriver `json:"stackdriver,omitempty"`
// Splunk defines Splunk Output Configuration
Expand All @@ -92,6 +94,8 @@ type OutputSpec struct {
OpenTelemetry *output.OpenTelemetry `json:"opentelemetry,omitempty"`
// PrometheusRemoteWrite_types defines Prometheus Remote Write configuration.
PrometheusRemoteWrite *output.PrometheusRemoteWrite `json:"prometheusRemoteWrite,omitempty"`
// S3 defines S3 Output configuration.
S3 *output.S3 `json:"s3,omitempty"`

// CustomPlugin defines Custom Output configuration.
CustomPlugin *custom.CustomPlugin `json:"customPlugin,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions apis/fluentbit/v1alpha2/collector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ type CollectorSpec struct {
Ports []corev1.ContainerPort `json:"ports,omitempty"`
// Service represents configurations on the fluent-bit service.
Service CollectorService `json:"service,omitempty"`
// SchedulerName represents the desired scheduler for the Fluentbit collector pods
SchedulerName string `json:"schedulerName,omitempty"`
}

// CollectorService defines the service of the FluentBit
Expand Down
4 changes: 4 additions & 0 deletions apis/fluentbit/v1alpha2/fluentbit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ type FluentBitSpec struct {
Labels map[string]string `json:"labels,omitempty"`
// SecurityContext holds pod-level security attributes and common container settings.
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
// ContainerSecurityContext holds container-level security attributes.
ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"`
// Host networking is requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.
HostNetwork bool `json:"hostNetwork,omitempty"`
// EnvVars represent environment variables that can be passed to fluentbit pods.
Expand All @@ -96,6 +98,8 @@ type FluentBitSpec struct {
MetricsPort int32 `json:"metricsPort,omitempty"`
// Service represents configurations on the fluent-bit service.
Service FluentBitService `json:"service,omitempty"`
// SchedulerName represents the desired scheduler for fluent-bit pods.
SchedulerName string `json:"schedulerName,omitempty"`
}

// FluentBitService defines the service of the FluentBit
Expand Down
2 changes: 1 addition & 1 deletion apis/fluentbit/v1alpha2/plugins/custom/custom_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// +kubebuilder:object:generate:=true

// CustomPlugin is used to support filter plugins that are not implemented yet. <br />
// **For example usage, refer to https://github.com/jjsiv/fluent-operator/blob/master/docs/best-practice/custom-plugin.md**
// **For example usage, refer to https://github.com/fluent/fluent-operator/blob/master/docs/best-practice/custom-plugin.md**
type CustomPlugin struct {
Config string `json:"config,omitempty"`
}
Expand Down
78 changes: 78 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/kinesis_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package output

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 Kinesis output plugin, allows to ingest your records into AWS Kinesis. <br />
// It uses the new high performance and highly efficient kinesis plugin is called kinesis_streams instead of the older Golang Fluent Bit plugin released in 2019.
// https://docs.fluentbit.io/manual/pipeline/outputs/kinesis <br />
// https://github.com/aws/amazon-kinesis-streams-for-fluent-bit <br />
type Kinesis struct {
// The AWS region.
Region string `json:"region"`
// The name of the Kinesis Streams Delivery stream that you want log records sent to.
Stream string `json:"stream"`
// Add the timestamp to the record under this key. By default the timestamp from Fluent Bit will not be added to records sent to Kinesis.
TimeKey string `json:"timeKey,omitempty"`
// strftime compliant format string for the timestamp; for example, the default is '%Y-%m-%dT%H:%M:%S'. Supports millisecond precision with '%3N' and supports nanosecond precision with '%9N' and '%L'; for example, adding '%3N' to support millisecond '%Y-%m-%dT%H:%M:%S.%3N'. This option is used with time_key.
TimeKeyFormat string `json:"timeKeyFormat,omitempty"`
// By default, the whole log record will be sent to Kinesis. If you specify a key name with this option, then only the value of that key will be sent to Kinesis. For example, if you are using the Fluentd Docker log driver, you can specify log_key log and only the log message will be sent to Kinesis.
LogKey string `json:"logKey,omitempty"`
// ARN of an IAM role to assume (for cross account access).
RoleARN string `json:"roleARN,omitempty"`
// Specify a custom endpoint for the Kinesis API.
Endpoint string `json:"endpoint,omitempty"`
// Custom endpoint for the STS API.
STSEndpoint string `json:"stsEndpoint,omitempty"`
// Immediately retry failed requests to AWS services once. This option does not affect the normal Fluent Bit retry mechanism with backoff. Instead, it enables an immediate retry with no delay for networking errors, which may help improve throughput when there are transient/random networking issues. This option defaults to true.
AutoRetryRequests *bool `json:"autoRetryRequests,omitempty"`
// Specify an external ID for the STS API, can be used with the role_arn parameter if your role requires an external ID.
ExternalID string `json:"externalID,omitempty"`
}

// Name implement Section() method
func (*Kinesis) Name() string {
return "kinesis_streams"
}

// Params implement Section() method
func (k *Kinesis) Params(_ plugins.SecretLoader) (*params.KVs, error) {
kvs := params.NewKVs()
if k.Region != "" {
kvs.Insert("region", k.Region)
}
if k.Stream != "" {
kvs.Insert("stream", k.Stream)
}
if k.TimeKey != "" {
kvs.Insert("time_key", k.TimeKey)
}
if k.TimeKeyFormat != "" {
kvs.Insert("time_key_format", k.TimeKeyFormat)
}
if k.LogKey != "" {
kvs.Insert("log_key", k.LogKey)
}
if k.RoleARN != "" {
kvs.Insert("role_arn", k.RoleARN)
}
if k.Endpoint != "" {
kvs.Insert("endpoint", k.Endpoint)
}
if k.STSEndpoint != "" {
kvs.Insert("sts_endpoint", k.STSEndpoint)
}
if k.AutoRetryRequests != nil {
kvs.Insert("auto_retry_requests", fmt.Sprint(*k.AutoRetryRequests))
}
if k.ExternalID != "" {
kvs.Insert("external_id", k.ExternalID)
}

return kvs, nil
}
43 changes: 43 additions & 0 deletions apis/fluentbit/v1alpha2/plugins/output/kinesis_types_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package output

import (
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins"
"github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2/plugins/params"
"github.com/onsi/gomega"
"testing"
)

func TestOutput_Kinesis_Params(t *testing.T) {
g := gomega.NewWithT(t)

sl := plugins.NewSecretLoader(nil, "test namespace")

ki := Kinesis{
Region: "us-east-1",
Stream: "test_stream",
TimeKey: "test_time_key",
TimeKeyFormat: "%Y-%m-%dT%H:%M:%S.%3N",
LogKey: "test_time_key",
RoleARN: "arn:aws:iam:test",
Endpoint: "test_endpoint",
STSEndpoint: "test_sts_endpoint",
AutoRetryRequests: ptrBool(true),
ExternalID: "test_external_id",
}

expected := params.NewKVs()
expected.Insert("region", "us-east-1")
expected.Insert("stream", "test_stream")
expected.Insert("time_key", "test_time_key")
expected.Insert("time_key_format", "%Y-%m-%dT%H:%M:%S.%3N")
expected.Insert("log_key", "test_time_key")
expected.Insert("role_arn", "arn:aws:iam:test")
expected.Insert("endpoint", "test_endpoint")
expected.Insert("sts_endpoint", "test_sts_endpoint")
expected.Insert("auto_retry_requests", "true")
expected.Insert("external_id", "test_external_id")

kvs, err := ki.Params(sl)
g.Expect(err).NotTo(gomega.HaveOccurred())
g.Expect(kvs).To(gomega.Equal(expected))
}
6 changes: 3 additions & 3 deletions apis/fluentbit/v1alpha2/plugins/output/loki_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ type Loki struct {
// If set to true, it will add all Kubernetes labels to the Stream labels.
// +kubebuilder:validation:Enum:=on;off
AutoKubernetesLabels string `json:"autoKubernetesLabels,omitempty"`
// Specify the name of the key from the original record that contains the Tenant ID.
// Specify the name of the key from the original record that contains the Tenant ID.
// The value of the key is set as X-Scope-OrgID of HTTP header. It is useful to set Tenant ID dynamically.
TenantIDKey string `json:"tenantIDKey,omitempty"`
*plugins.TLS `json:"tls,omitempty"`
TenantIDKey string `json:"tenantIDKey,omitempty"`
*plugins.TLS `json:"tls,omitempty"`
}

// implement Section() method
Expand Down
Loading

0 comments on commit 2712a73

Please sign in to comment.