Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ ifeq (, $(shell which controller-gen))
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.4 ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
CONTROLLER_GEN=$(GOBIN)/controller-gen
Expand Down
4 changes: 4 additions & 0 deletions api/v1alpha2/fluentbit_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ type FluentBitSpec struct {
PositionDB corev1.VolumeSource `json:"positionDB,omitempty"`
// Container log path
ContainerLogRealPath string `json:"containerLogRealPath,omitempty"`
// Compute Resources required by container.
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
// NodeSelector
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// Pod's scheduling constraints.
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// Tolerations
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
// Fluentbitconfig object associated with this Fluentbit
Expand Down
6 changes: 6 additions & 0 deletions api/v1alpha2/zz_generated.deepcopy.go

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

759 changes: 382 additions & 377 deletions config/crd/bases/logging.kubesphere.io_filters.yaml

Large diffs are not rendered by default.

469 changes: 236 additions & 233 deletions config/crd/bases/logging.kubesphere.io_fluentbitconfigs.yaml

Large diffs are not rendered by default.

3,072 changes: 1,858 additions & 1,214 deletions config/crd/bases/logging.kubesphere.io_fluentbits.yaml

Large diffs are not rendered by default.

471 changes: 237 additions & 234 deletions config/crd/bases/logging.kubesphere.io_inputs.yaml

Large diffs are not rendered by default.

2,011 changes: 1,015 additions & 996 deletions config/crd/bases/logging.kubesphere.io_outputs.yaml

Large diffs are not rendered by default.

175 changes: 88 additions & 87 deletions config/crd/bases/logging.kubesphere.io_parsers.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

---
apiVersion: apiextensions.k8s.io/v1beta1
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: parsers.logging.kubesphere.io
spec:
Expand All @@ -15,95 +15,96 @@ spec:
plural: parsers
singular: parser
scope: Namespaced
validation:
openAPIV3Schema:
description: Parser is the Schema for the parsers API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ParserSpec defines the desired state of Parser
properties:
decoders:
description: 'Decoders are a built-in feature available through the
Parsers file, each Parser definition can optionally set one or multiple
decoders. There are two type of decoders type: Decode_Field and Decode_Field_As.'
items:
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
description: Parser is the Schema for the parsers API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ParserSpec defines the desired state of Parser
properties:
decoders:
description: 'Decoders are a built-in feature available through the
Parsers file, each Parser definition can optionally set one or multiple
decoders. There are two type of decoders type: Decode_Field and
Decode_Field_As.'
items:
properties:
decodeField:
description: If the content can be decoded in a structured message,
append that structure message (keys and values) to the original
log message.
type: string
decodeFieldAs:
description: Any content decoded (unstructured or structured)
will be replaced in the same key/value, no extra keys are
added.
type: string
type: object
type: array
json:
description: JSON defines json parser configuration.
properties:
decodeField:
description: If the content can be decoded in a structured message,
append that structure message (keys and values) to the original
log message.
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
decodeFieldAs:
description: Any content decoded (unstructured or structured)
will be replaced in the same key/value, no extra keys are added.
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
type: array
json:
description: JSON defines json parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
type: object
logfmt:
description: Logfmt defines logfmt parser configuration.
type: object
ltsv:
description: LTSV defines ltsv parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
types:
type: string
type: object
regex:
description: Regex defines regex parser configuration.
properties:
regex:
type: string
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
types:
type: string
type: object
type: object
type: object
version: v1alpha2
versions:
- name: v1alpha2
logfmt:
description: Logfmt defines logfmt parser configuration.
type: object
ltsv:
description: LTSV defines ltsv parser configuration.
properties:
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
types:
type: string
type: object
regex:
description: Regex defines regex parser configuration.
properties:
regex:
type: string
timeFormat:
description: Time_Format, eg. %Y-%m-%dT%H:%M:%S %z
type: string
timeKeep:
description: Time_Keep
type: boolean
timeKey:
description: Time_Key
type: string
types:
type: string
type: object
type: object
type: object
served: true
storage: true
status:
Expand Down
5 changes: 3 additions & 2 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
loggingv1alpha2 "kubesphere.io/fluentbit-operator/api/v1alpha2"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
// +kubebuilder:scaffold:imports
Expand All @@ -44,15 +45,15 @@ func TestAPIs(t *testing.T) {

RunSpecsWithDefaultAndCustomReporters(t,
"Controller Suite",
[]Reporter{envtest.NewlineReporter{}})
[]Reporter{printer.NewlineReporter{}})
}

var _ = BeforeSuite(func(done Done) {
logf.SetLogger(zap.LoggerTo(GinkgoWriter, true))

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
CRDDirectoryPaths: []string{filepath.Join("..", "manifests", "setup")},
}

var err error
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module kubesphere.io/fluentbit-operator

go 1.12
go 1.13

require (
github.com/go-logr/logr v0.1.0
github.com/go-openapi/errors v0.19.2
github.com/joho/godotenv v1.3.0
github.com/json-iterator/go v1.1.8
github.com/onsi/ginkgo v1.10.3
github.com/onsi/gomega v1.7.1
github.com/onsi/ginkgo v1.11.0
github.com/onsi/gomega v1.8.1
k8s.io/api v0.17.2
k8s.io/apimachinery v0.17.2
k8s.io/client-go v0.16.4
k8s.io/client-go v0.17.2
k8s.io/klog v1.0.0
sigs.k8s.io/controller-runtime v0.4.0
sigs.k8s.io/controller-runtime v0.5.2
)
Loading